|
12 | 12 | # -- General configuration --------------------------------------------------- |
13 | 13 |
|
14 | 14 | extensions = [ |
15 | | - "sphinx_plover", |
16 | | - "myst_parser", |
17 | | - "sphinx.ext.todo", |
| 15 | + "sphinx_plover", |
| 16 | + "myst_parser", |
| 17 | + "sphinx.ext.todo", |
18 | 18 | ] |
19 | 19 |
|
20 | 20 | myst_enable_extensions = ["colon_fence"] |
|
41 | 41 | html_favicon = "_static/favicon.ico" |
42 | 42 |
|
43 | 43 | html_css_files = [ |
44 | | - "custom.css", |
| 44 | + "custom.css", |
45 | 45 | ] |
46 | 46 |
|
47 | 47 | html_theme_options = { |
48 | | - "navigation_with_keys": True, |
49 | | - "light_css_variables": { |
50 | | - "color-brand-primary": "#3d6961", |
51 | | - "color-brand-content": "#3d6961", |
52 | | - "color-sidebar-background": "#3d6961", |
53 | | - "color-sidebar-brand-text": "white", |
54 | | - "color-sidebar-brand-text--hover": "white", |
55 | | - "color-sidebar-caption-text": "white", |
56 | | - "color-sidebar-link-text": "white", |
57 | | - "color-sidebar-link-text--top-level": "white", |
58 | | - "color-sidebar-item-background--hover": "#71a89f", |
59 | | - "color-sidebar-item-expander-background--hover": "#71a89f", |
60 | | - "color-inline-code-background": "transparent", |
61 | | - "font-stack--header": "'Patua One', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'", |
62 | | - "font-stack--monospace": "'JetBrains Mono', SFMono-Regular, Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace", |
63 | | - }, |
64 | | - "dark_css_variables": { |
65 | | - "color-link": "#68a69b", |
66 | | - "color-link--hover": "#68a69b", |
67 | | - }, |
68 | | - "light_logo": "dolores.svg", |
69 | | - "dark_logo": "dolores.svg", |
| 48 | + "navigation_with_keys": True, |
| 49 | + "light_css_variables": { |
| 50 | + "color-brand-primary": "#3d6961", |
| 51 | + "color-brand-content": "#3d6961", |
| 52 | + "color-sidebar-background": "#3d6961", |
| 53 | + "color-sidebar-brand-text": "white", |
| 54 | + "color-sidebar-brand-text--hover": "white", |
| 55 | + "color-sidebar-caption-text": "white", |
| 56 | + "color-sidebar-link-text": "white", |
| 57 | + "color-sidebar-link-text--top-level": "white", |
| 58 | + "color-sidebar-item-background--hover": "#71a89f", |
| 59 | + "color-sidebar-item-expander-background--hover": "#71a89f", |
| 60 | + "color-inline-code-background": "transparent", |
| 61 | + "font-stack--header": "'Patua One', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'", |
| 62 | + "font-stack--monospace": "'JetBrains Mono', SFMono-Regular, Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace", |
| 63 | + }, |
| 64 | + "dark_css_variables": { |
| 65 | + "color-link": "#68a69b", |
| 66 | + "color-link--hover": "#68a69b", |
| 67 | + }, |
| 68 | + "light_logo": "dolores.svg", |
| 69 | + "dark_logo": "dolores.svg", |
70 | 70 | } |
71 | 71 |
|
72 | 72 | from pygments.lexer import RegexLexer, bygroups |
|
75 | 75 |
|
76 | 76 |
|
77 | 77 | class RTFLexer(RegexLexer): |
78 | | - name = "rtf" |
79 | | - |
80 | | - tokens = { |
81 | | - "root": [ |
82 | | - (r"(\\[a-z*\\_~\{\}]+)(-?\d+)?", bygroups(t.Keyword, t.Number.Integer)), |
83 | | - (r"{\\\*\\cxcomment\s+", t.Comment.Multiline, "comment"), |
84 | | - ( |
85 | | - r"({)(\\\*\\cxs)(\s+)([A-Z#0-9\-/#!,]+)(})", |
86 | | - bygroups(t.Operator, t.Keyword, t.Text, t.String, t.Operator), |
87 | | - ), |
88 | | - (r"{", t.Operator), |
89 | | - (r"}", t.Operator), |
90 | | - (r".+?", t.Text), |
91 | | - ], |
92 | | - "comment": [ |
93 | | - (r"{", t.Comment.Multiline, "#push"), |
94 | | - (r"}", t.Comment.Multiline, "#pop"), |
95 | | - (r".+", t.Comment.Multiline), |
96 | | - ], |
97 | | - } |
| 78 | + name = "rtf" |
| 79 | + |
| 80 | + tokens = { |
| 81 | + "root": [ |
| 82 | + (r"(\\[a-z*\\_~\{\}]+)(-?\d+)?", bygroups(t.Keyword, t.Number.Integer)), |
| 83 | + (r"{\\\*\\cxcomment\s+", t.Comment.Multiline, "comment"), |
| 84 | + ( |
| 85 | + r"({)(\\\*\\cxs)(\s+)([A-Z#0-9\-/#!,]+)(})", |
| 86 | + bygroups(t.Operator, t.Keyword, t.Text, t.String, t.Operator), |
| 87 | + ), |
| 88 | + (r"{", t.Operator), |
| 89 | + (r"}", t.Operator), |
| 90 | + (r".+?", t.Text), |
| 91 | + ], |
| 92 | + "comment": [ |
| 93 | + (r"{", t.Comment.Multiline, "#push"), |
| 94 | + (r"}", t.Comment.Multiline, "#pop"), |
| 95 | + (r".+", t.Comment.Multiline), |
| 96 | + ], |
| 97 | + } |
98 | 98 |
|
99 | 99 |
|
100 | 100 | lexers["rtf"] = RTFLexer(startinline=True) |
0 commit comments