From: Vladimír Vondruš Date: Tue, 9 Jun 2020 11:25:19 +0000 (+0200) Subject: css: improve code highlighting for string escapes and interpolation. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=ea1d3d09750c946adfb7402eee1148ad9d165424;p=blog.git css: improve code highlighting for string escapes and interpolation. And test this look via the m.code plugin. --- diff --git a/css/m-dark+documentation.compiled.css b/css/m-dark+documentation.compiled.css index f3a4bf57..56fa1990 100644 --- a/css/m-dark+documentation.compiled.css +++ b/css/m-dark+documentation.compiled.css @@ -2532,9 +2532,9 @@ article:last-child, article section:last-child { margin-bottom: 0; } .m-code .dl { color: #e07f7c } .m-code .sd { color: #e07f7c } .m-code .s2 { color: #e07f7c } -.m-code .se { color: #e07f7c } +.m-code .se { color: #e07cdc } .m-code .sh { color: #e07f7c } -.m-code .si { color: #e07f7c } +.m-code .si { color: #a5c9ea } .m-code .sx { color: #e07f7c } .m-code .sr { color: #e07f7c } .m-code .s1 { color: #e07f7c } diff --git a/css/m-dark.compiled.css b/css/m-dark.compiled.css index 5a9845f9..f0c2dc73 100644 --- a/css/m-dark.compiled.css +++ b/css/m-dark.compiled.css @@ -2532,9 +2532,9 @@ article:last-child, article section:last-child { margin-bottom: 0; } .m-code .dl { color: #e07f7c } .m-code .sd { color: #e07f7c } .m-code .s2 { color: #e07f7c } -.m-code .se { color: #e07f7c } +.m-code .se { color: #e07cdc } .m-code .sh { color: #e07f7c } -.m-code .si { color: #e07f7c } +.m-code .si { color: #a5c9ea } .m-code .sx { color: #e07f7c } .m-code .sr { color: #e07f7c } .m-code .s1 { color: #e07f7c } diff --git a/css/pygments-dark.css b/css/pygments-dark.css index f4f0bca6..5366579d 100644 --- a/css/pygments-dark.css +++ b/css/pygments-dark.css @@ -50,9 +50,9 @@ .m-code .dl { color: #e07f7c } /* Literal.String.Delimiter */ .m-code .sd { color: #e07f7c } /* Literal.String.Doc */ .m-code .s2 { color: #e07f7c } /* Literal.String.Double */ -.m-code .se { color: #e07f7c } /* Literal.String.Escape */ +.m-code .se { color: #e07cdc } /* Literal.String.Escape */ .m-code .sh { color: #e07f7c } /* Literal.String.Heredoc */ -.m-code .si { color: #e07f7c } /* Literal.String.Interpol */ +.m-code .si { color: #a5c9ea } /* Literal.String.Interpol */ .m-code .sx { color: #e07f7c } /* Literal.String.Other */ .m-code .sr { color: #e07f7c } /* Literal.String.Regex */ .m-code .s1 { color: #e07f7c } /* Literal.String.Single */ diff --git a/css/pygments-dark.py b/css/pygments-dark.py index b2617c90..d542f5eb 100644 --- a/css/pygments-dark.py +++ b/css/pygments-dark.py @@ -41,6 +41,8 @@ class DarkStyle(Style): Name: '#dcdcdc', String: '#e07f7c', String.Char: '#e07cdc', + String.Escape: '#e07cdc', # like char + String.Interpol: '#a5c9ea', # like comment Number: '#c7cf2f', Operator: '#aaaaaa', Punctuation: "#aaaaaa", diff --git a/plugins/m/test/code/page.html b/plugins/m/test/code/page.html index 910e75c3..9ae6384b 100644 --- a/plugins/m/test/code/page.html +++ b/plugins/m/test/code/page.html @@ -38,6 +38,9 @@ COPYING css fc]fc fc fc fc fc fc fc fc fc fa fa fa fa fa +

Syntax highlighting:

+
# Comment
+var = "string{}escape\n"

Console colors:

Named foreground colors:
   Black Red Green Yellow Blue Magenta Cyan White Default
diff --git a/plugins/m/test/code/page.rst b/plugins/m/test/code/page.rst
index 24e2f7d1..91e819a2 100644
--- a/plugins/m/test/code/page.rst
+++ b/plugins/m/test/code/page.rst
@@ -30,6 +30,13 @@ rendered as plain monospace text: :code:`code`.
 .. include:: console.ansi
     :code: ansi
 
+Syntax highlighting:
+
+.. code:: py
+
+    # Comment
+    var = "string{}escape\n"
+
 Console colors:
 
 .. include:: console-colors.ansi