Skip to content

Commit 4952473

Browse files
authored
enable syntax highlighting in include directive (#2222)
1 parent 6bcd855 commit 4952473

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

docs/docutils.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# this file instructs docutils to use "short" classnames on lexed source code, so that
2+
# it's easier to write CSS that targets both docutils- and sphinx-generated code blocks.
3+
# see https://github.com/sphinx-doc/sphinx/issues/11185
4+
[restructuredtext parser]
5+
syntax-highlight: short

docs/user_guide/extending.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Then add the ``dropdown`` class to any admonition directive (shown here on a ``n
3333
:start-after: begin-example-dropdown
3434
:end-before: .. end-example-dropdown
3535
:code: rst
36-
:class: highlight-rst
36+
:class: highlight
3737

3838
.. tab-item:: markdown
3939

@@ -73,7 +73,7 @@ The title is specified on the same line as the ``.. admonition::`` directive:
7373
:start-after: begin-example-title
7474
:end-before: .. end-example-title
7575
:code: rst
76-
:class: highlight-rst
76+
:class: highlight
7777

7878
.. tab-item:: markdown
7979

@@ -108,7 +108,7 @@ Note that it updates both the color and the icon. See :doc:`./styling` for a lis
108108
:start-after: begin-example-semantic
109109
:end-before: .. end-example-semantic
110110
:code: rst
111-
:class: highlight-rst
111+
:class: highlight
112112

113113
.. tab-item:: markdown
114114

@@ -145,7 +145,7 @@ Be sure to use the same color for ``border-color`` and ``color`` and a different
145145
:start-after: begin-example-color
146146
:end-before: .. end-example-color
147147
:code: rst
148-
:class: highlight-rst
148+
:class: highlight
149149

150150
.. tab-item:: markdown
151151

@@ -163,7 +163,7 @@ And add the following to your ``custom.css`` file:
163163
:start-after: begin-custom-color
164164
:end-before: /* end-custom-color
165165
:code: css
166-
:class: highlight-css
166+
:class: highlight
167167

168168

169169
Using a custom icon
@@ -186,7 +186,7 @@ Customizing the icon uses a similar process to customizing the color: create a n
186186
:start-after: begin-example-icon
187187
:end-before: .. end-example-icon
188188
:code: rst
189-
:class: highlight-rst
189+
:class: highlight
190190

191191
.. tab-item:: markdown
192192

@@ -204,7 +204,7 @@ And add the following css to your ``custom.css`` file:
204204
:start-after: begin-custom-icon
205205
:end-before: /* end-custom-icon
206206
:code: css
207-
:class: highlight-css
207+
:class: highlight
208208

209209

210210
Combining all three customizations
@@ -227,7 +227,7 @@ Here we demonstrate an admonition with a custom icon, color, and title (and also
227227
:start-after: begin-example-youtube
228228
:end-before: .. end-example-youtube
229229
:code: rst
230-
:class: highlight-rst
230+
:class: highlight
231231

232232
.. tab-item:: markdown
233233

@@ -247,4 +247,4 @@ And add the following css to your custom.css file:
247247
:start-after: begin-custom-youtube
248248
:end-before: /* end-custom-youtube
249249
:code: css
250-
:class: highlight-css
250+
:class: highlight

0 commit comments

Comments
 (0)