@@ -9,11 +9,10 @@ Leave one blank line before and after the block for easier reading.
99/// example | Code block
1010
1111```` md
12-
1312```javascript
1413console.log("Hello world");
1514```
16- `````
15+ ````
1716
1817``` javascript
1918console .log (" Hello world" );
@@ -53,13 +52,11 @@ To make your code block clearer, specify the language right after the first thre
5352/// example | Syntax highlighting
5453
5554```` md
56-
5755```python
5856print("Hello, world!")
5957for i in range(10):
6058 print(i)
6159```
62-
6360````
6461
6562renders as:
@@ -84,14 +81,12 @@ The number _must_ be quoted, and it is the number of the first line (it must be
8481/// example | Line Numbers
8582
8683```` md
87-
8884```python {linenums="1"}
8985import foo.bar
9086
9187a = "lorem"
9288b = "ipsum"
9389```
94-
9590````
9691
9792renders as:
@@ -110,15 +105,13 @@ If you want to start with a different line number, simply specify a number other
110105/// example | Line Numbers
111106
112107```` md
113-
114108```python {linenums="42"}
115109def foobar():
116110 a = "lorem"
117111 b = "ipsum"
118112
119113foobar()
120114```
121-
122115````
123116
124117renders as:
@@ -138,14 +131,12 @@ Pygments also has a few additional options regarding line numbers. One is "line
138131/// example | N^th^ line
139132
140133```` md
141-
142134``` {linenums="1 2"}
143135"""Some file."""
144136import foo.bar
145137import boo.baz
146138import foo.bar.baz
147139```
148-
149140````
150141
151142renders as:
@@ -167,14 +158,12 @@ You can specify certain lines for highlighting by using the `hl_lines` setting d
167158/// example | Highlight Lines
168159
169160```` md
170-
171161```python {hl_lines="1 3"}
172162"""Some file."""
173163import foo.bar
174164import boo.baz
175165import foo.bar.baz
176166```
177-
178167````
179168
180169renders as:
@@ -193,15 +182,13 @@ Line numbers are always referenced starting at 1, regardless of what the line nu
193182/// example | Highlight Lines with Line Numbers
194183
195184```` md
196-
197185```python {linenums="42" hl_lines="2"}
198186def foobar():
199187 a = "lorem"
200188 b = "ipsum"
201189
202190foobar()
203191```
204-
205192````
206193
207194renders as:
@@ -221,7 +208,6 @@ If you'd like to highlight a range of lines, you can use the notation x-y, where
221208/// example | Highlight Lines with Line Numbers
222209
223210```` md
224-
225211```python {hl_lines="1-2 5 7-8"}
226212import foo
227213import boo.baz
@@ -233,7 +219,6 @@ class Foo:
233219 self.bar = None
234220 self.baz = None
235221```
236-
237222````
238223
239224renders as:
@@ -253,14 +238,13 @@ class Foo:
253238///
254239
255240
256- ## Code Block Title Headers
241+ ## Title Headers
257242
258243A header with a title can be applied to a code block using the title option. Typically, you use it to show a filename, but it can be anything.
259244
260245/// example | Code block with a header
261246
262247```` md
263-
264248```python {title="cool_file.py"}
265249import foo
266250import boo.baz
@@ -272,7 +256,6 @@ class Foo:
272256 self.bar = None
273257 self.baz = None
274258```
275-
276259````
277260
278261renders as:
0 commit comments