@@ -157,15 +157,11 @@ myst:
157157You may add comments by putting the ` % ` character at the beginning of a line. This will
158158prevent the line from being parsed into the output document.
159159
160- For example, this code:
161-
162- ``` md
163- % my comment
164- ```
165-
166- Is below, but it won't be parsed into the document.
160+ For example, this won't be parsed into the document:
167161
162+ :::{myst-example}
168163% my comment
164+ :::
169165
170166```` {important}
171167Since comments are a block-level entity, they will terminate the previous block.
@@ -197,16 +193,12 @@ like [jupyter notebooks](https://jupyter.org/),
197193to indicate a new text cell. It will not show up in the rendered text,
198194but is stored in the internal document structure for use by developers.
199195
200- For example, this code :
196+ For example, this won't be parsed into the document :
201197
202- ``` md
198+ ``` {myst-example}
203199+++ some text
204200```
205201
206- Is below, but it won't be parsed into the document.
207-
208- +++
209-
210202(syntax/referencing)=
211203
212204## Markdown Links and Referencing
@@ -529,24 +521,21 @@ markdown: `[](syntax.md)` will result in: [](syntax.md).
529521Code blocks contain a language identifier, which is used to determine the language of the code.
530522This language is used to determine the syntax highlighting, using an available [ pygments lexer] ( https://pygments.org/docs/lexers/ ) .
531523
532- ```` markdown
533- ``` python
534- from a import b
535- c = " string"
536- ```
537- ````
538524
525+ :::{myst-example}
539526``` python
540527from a import b
541528c = " string"
542529```
530+ :::
543531
544532You can create and register your own lexer, using the [ ` pygments.lexers ` entry point] ( https://pygments.org/docs/plugins/#register-plugins ) ,
545533or within a sphinx extension, with the [ ` app.add_lexer ` method] ( inv:sphinx#*.Sphinx.add_lexer ) .
546534
547535Using the ` myst_number_code_blocks ` configuration option, you can also control whether code blocks are numbered by line.
548536For example, using ` myst_number_code_blocks = ["typescript"] ` :
549537
538+ :::{myst-example}
550539``` typescript
551540type MyBool = true | false ;
552541
@@ -555,58 +544,45 @@ interface User {
555544 id: number ;
556545}
557546```
547+ :::
558548
559549### Show backticks inside raw markdown blocks
560550
561551If you'd like to show backticks inside of your markdown, you can do so by nesting them
562552in backticks of a greater length. Markdown will treat the outer-most backticks as the
563553edges of the "raw" block and everything inside will show up. For example:
564554
565- ``` `` `hi` `` ``` will be rendered as: `` `hi` ``
566-
567- and
568-
569- `````
570- ````
571- ```
572- hi
573- ```
574- ````
575- `````
576-
577- will be rendered as:
555+ :::{myst-example}
556+ `` `hi` ``
578557
579558````
580559```
581560hi
582561```
583562````
563+ :::
584564
585565## Tables
586566
587567Tables can be written using the standard [ Github Flavoured Markdown syntax] ( https://github.github.com/gfm/#tables-extension- ) :
588568
569+ :::{myst-example}
589570``` md
590571| foo | bar |
591572| --- | --- |
592573| baz | bim |
593574```
594-
595- | foo | bar |
596- | --- | --- |
597- | baz | bim |
575+ :::
598576
599577Cells in a column can be aligned using the ` : ` character:
600578
579+ :::{myst-example}
601580``` md
602581| left | center | right |
603582| :--- | :----: | ----: |
604583| a | b | c |
605584```
606-
607- | left | center | right |
608- | :--- | :----: | ----: |
609- | a | b | c |
585+ :::
610586
611587:::{note}
612588
@@ -632,11 +608,9 @@ MyST provides a few different syntaxes for including images in your documentatio
632608
633609The standard Markdown syntax is:
634610
635- ``` md
636- ![ fishy] ( img/fun-fish.png )
637- ```
638-
611+ :::{myst-example}
639612![ fishy] ( img/fun-fish.png )
613+ :::
640614
641615But you can also enable extended image syntaxes, to control attributes like width and captions.
642616See the [ extended image syntax guide] ( syntax/images ) .
@@ -653,24 +627,18 @@ Their labels **start with `^`** and can then be any alphanumeric string (no spac
653627All footnote definitions are collected, and displayed at the bottom of the page (in the order they are referenced).
654628Note that un-referenced footnote definitions will not be displayed.
655629
656- ``` md
657- - This is a manually-numbered footnote reference.[ ^ 3 ]
658- - This is an auto-numbered footnote reference.[ ^ myref ]
659-
660- [ ^ myref ] : This is an auto-numbered footnote definition.
661- [ ^ 3 ] : This is a manually-numbered footnote definition.
662- ```
663-
630+ :::{myst-example}
664631- This is a manually-numbered footnote reference.[ ^ 3 ]
665632- This is an auto-numbered footnote reference.[ ^ myref ]
666633
667634[ ^ myref ] : This is an auto-numbered footnote definition.
668635[ ^ 3 ] : This is a manually-numbered footnote definition.
636+ :::
669637
670638Any preceding text after a footnote definitions, which is
671639indented by four or more spaces, will also be included in the footnote definition, and the text is rendered as MyST Markdown, e.g.
672640
673- ``` md
641+ :::{myst-example}
674642A longer footnote definition.[ ^ mylongdef ]
675643
676644[ ^ mylongdef ] : This is the _ ** footnote definition** _ .
@@ -683,37 +651,14 @@ A longer footnote definition.[^mylongdef]
683651that are not separated by a blank line
684652
685653This is not part of the footnote.
686- ```
687-
688- A longer footnote definition.[ ^ mylongdef ]
689-
690- [ ^ mylongdef ] : This is the _ ** footnote definition** _ .
691-
692- That continues for all indented lines
693-
694- - even other block elements
695-
696- Plus any subsequent unindented lines,
697- that are not separated by a blank line
698-
699- This is not part of the footnote.
654+ :::
700655
701656```` {important}
702657Although footnote references can be used just fine within directives, e.g.[^myref],
703658it is recommended that footnote definitions are not set within directives,
704659unless they will only be referenced within that same directive:
705660
706- ```md
707- [^other]
708-
709- [^other]: A definition within a directive
710- ```
711-
712- [^other]
713-
714- [^other]: A definition within a directive
715-
716- This is because, in the current implementation, they may not be available to reference in text above that particular directive.
661+ This is because, they may not be available to reference in text outside that particular directive.
717662````
718663
719664By default, a transition line (with a ` footnotes ` class) will be placed before any footnotes.
0 commit comments