aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pysite/rst/__init__.py2
-rw-r--r--requirements.txt1
-rw-r--r--static/css/pygments-monokai.css70
-rw-r--r--templates/main/base.html1
-rw-r--r--templates/wiki/base.html1
5 files changed, 74 insertions, 1 deletions
diff --git a/pysite/rst/__init__.py b/pysite/rst/__init__.py
index 0e5f6ffe..9b2ef23c 100644
--- a/pysite/rst/__init__.py
+++ b/pysite/rst/__init__.py
@@ -7,7 +7,7 @@ from pysite.rst.roles import icon_role
def render(rst: str):
return publish_parts(
- source=rst, writer_name="html5", settings_overrides={"halt_level": 2}
+ source=rst, writer_name="html5", settings_overrides={"halt_level": 2, "syntax_highlight": "short"}
)["html_body"]
diff --git a/requirements.txt b/requirements.txt
index f7afea00..bb66b59d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,3 +11,4 @@ Flask-Dance
logmatic-python
flask-wtf
docutils
+pygments
diff --git a/static/css/pygments-monokai.css b/static/css/pygments-monokai.css
new file mode 100644
index 00000000..250c8d44
--- /dev/null
+++ b/static/css/pygments-monokai.css
@@ -0,0 +1,70 @@
+.code .hll { background-color: #49483e }
+.code { background: #272822; color: #f8f8f2 }
+.code .c { color: #75715e } /* Comment */
+.code .err { color: #960050; background-color: #1e0010 } /* Error */
+.code .k { color: #66d9ef } /* Keyword */
+.code .l { color: #ae81ff } /* Literal */
+.code .n { color: #f8f8f2 } /* Name */
+.code .o { color: #f92672 } /* Operator */
+.code .p { color: #f8f8f2 } /* Punctuation */
+.code .ch { color: #75715e } /* Comment.Hashbang */
+.code .cm { color: #75715e } /* Comment.Multiline */
+.code .cp { color: #75715e } /* Comment.Preproc */
+.code .cpf { color: #75715e } /* Comment.PreprocFile */
+.code .c1 { color: #75715e } /* Comment.Single */
+.code .cs { color: #75715e } /* Comment.Special */
+.code .gd { color: #f92672 } /* Generic.Deleted */
+.code .ge { font-style: italic } /* Generic.Emph */
+.code .gi { color: #a6e22e } /* Generic.Inserted */
+.code .gs { font-weight: bold } /* Generic.Strong */
+.code .gu { color: #75715e } /* Generic.Subheading */
+.code .kc { color: #66d9ef } /* Keyword.Constant */
+.code .kd { color: #66d9ef } /* Keyword.Declaration */
+.code .kn { color: #f92672 } /* Keyword.Namespace */
+.code .kp { color: #66d9ef } /* Keyword.Pseudo */
+.code .kr { color: #66d9ef } /* Keyword.Reserved */
+.code .kt { color: #66d9ef } /* Keyword.Type */
+.code .ld { color: #e6db74 } /* Literal.Date */
+.code .m { color: #ae81ff } /* Literal.Number */
+.code .s { color: #e6db74 } /* Literal.String */
+.code .na { color: #a6e22e } /* Name.Attribute */
+.code .nb { color: #f8f8f2 } /* Name.Builtin */
+.code .nc { color: #a6e22e } /* Name.Class */
+.code .no { color: #66d9ef } /* Name.Constant */
+.code .nd { color: #a6e22e } /* Name.Decorator */
+.code .ni { color: #f8f8f2 } /* Name.Entity */
+.code .ne { color: #a6e22e } /* Name.Exception */
+.code .nf { color: #a6e22e } /* Name.Function */
+.code .nl { color: #f8f8f2 } /* Name.Label */
+.code .nn { color: #f8f8f2 } /* Name.Namespace */
+.code .nx { color: #a6e22e } /* Name.Other */
+.code .py { color: #f8f8f2 } /* Name.Property */
+.code .nt { color: #f92672 } /* Name.Tag */
+.code .nv { color: #f8f8f2 } /* Name.Variable */
+.code .ow { color: #f92672 } /* Operator.Word */
+.code .w { color: #f8f8f2 } /* Text.Whitespace */
+.code .mb { color: #ae81ff } /* Literal.Number.Bin */
+.code .mf { color: #ae81ff } /* Literal.Number.Float */
+.code .mh { color: #ae81ff } /* Literal.Number.Hex */
+.code .mi { color: #ae81ff } /* Literal.Number.Integer */
+.code .mo { color: #ae81ff } /* Literal.Number.Oct */
+.code .sa { color: #e6db74 } /* Literal.String.Affix */
+.code .sb { color: #e6db74 } /* Literal.String.Backtick */
+.code .sc { color: #e6db74 } /* Literal.String.Char */
+.code .dl { color: #e6db74 } /* Literal.String.Delimiter */
+.code .sd { color: #e6db74 } /* Literal.String.Doc */
+.code .s2 { color: #e6db74 } /* Literal.String.Double */
+.code .se { color: #ae81ff } /* Literal.String.Escape */
+.code .sh { color: #e6db74 } /* Literal.String.Heredoc */
+.code .si { color: #e6db74 } /* Literal.String.Interpol */
+.code .sx { color: #e6db74 } /* Literal.String.Other */
+.code .sr { color: #e6db74 } /* Literal.String.Regex */
+.code .s1 { color: #e6db74 } /* Literal.String.Single */
+.code .ss { color: #e6db74 } /* Literal.String.Symbol */
+.code .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
+.code .fm { color: #a6e22e } /* Name.Function.Magic */
+.code .vc { color: #f8f8f2 } /* Name.Variable.Class */
+.code .vg { color: #f8f8f2 } /* Name.Variable.Global */
+.code .vi { color: #f8f8f2 } /* Name.Variable.Instance */
+.code .vm { color: #f8f8f2 } /* Name.Variable.Magic */
+.code .il { color: #ae81ff } /* Literal.Number.Integer.Long */
diff --git a/templates/main/base.html b/templates/main/base.html
index edd79fb5..c554d360 100644
--- a/templates/main/base.html
+++ b/templates/main/base.html
@@ -10,6 +10,7 @@
<link rel="shortcut icon" href="{{ static_file('favicon.ico') }}">
<link rel="stylesheet" href="{{ static_file('uikit_blurple.css') }}"/>
<link rel="stylesheet" href="{{ static_file('style.css') }}"/>
+ <link rel="stylesheet" href="{{ static_file('css/pygments-monokai.css') }}"/>
<!-- OpenGraph metadata -->
<meta property="og:title" content="Python Discord | {% block og_title %}{% endblock %}">
diff --git a/templates/wiki/base.html b/templates/wiki/base.html
index baee4086..7d8d7d67 100644
--- a/templates/wiki/base.html
+++ b/templates/wiki/base.html
@@ -10,6 +10,7 @@
<link rel="shortcut icon" href="{{ static_file('favicon.ico') }}">
<link rel="stylesheet" href="{{ static_file('uikit_blurple.css') }}"/>
<link rel="stylesheet" href="{{ static_file('style.css') }}"/>
+ <link rel="stylesheet" href="{{ static_file('css/pygments-monokai.css') }}"/>
<!-- OpenGraph metadata -->
<meta property="og:title" content="Python Discord | {% block og_title %}{% endblock %}">