--- Title of sidebar The brief introduction of the article.--- [#id.classname1.classname2 title of page](doc path of page)--- [#id.classname1.classname2 title of page](doc path of page)...
1. Example
A example for page tabs
:header[![[../logo.png]][Showdowns Features](https://jhuix.github.io/showdowns)]{.doc-title.align-center.header-shadow.title1}!!--- :a[Reference]{.nav-link href="."} <br/> [Showdowns](https://github.com/jhuix/showdowns) is a lib that make markdown to html with some extensions of showdown.js. :::attention[Please pay more attention to us] If you think the showdowns library can help you or also hope to encourage the author, click on the top right corner to give me a [Star](https://github.com/jhuix/showdowns)⭐️. ::: Showdowns Markdown Syntax, refer to the document -- [Showdowns Features](https://jhuix.github.io/showdowns). The showdowns lib supports the following diagram rendering: :::tip[Diagram Render] | Diagram | Render | | ------- | :------: | | ABCJS | ✔ | | AntV infographic| ✔ | | Echarts | ✔ | | Flowchart | ✔ | | Gnuplot | Registration rendering method | | LaTex | Registration rendering method | | kroki | https://kroki.io | | Mermaid | ✔ | | Plantuml | http://plantuml.com | | Plotly | ✔ | | Railroad | ✔ | | Vega | ✔ | | Viz | ✔ | | WaveDrom | ✔ | | ZenUML for mermaid | ✔ | | ZenUML | ✔ | :::--- [.page-icons.icon-info Markdown syntax](../Showdown's-Markdown-syntax.md)--- [.page-icons.icon-pages Page Tabs](../pages/page-tabs.md)--- [.page-icons.icon-admontions Directives](../pages/directives.md)--- [.page-icons.icon-contenttabs Content Tabs](../pages/content-tabs.md)--- [.page-icons.icon-toc Table Of Content](../pages/toc.md)--- [.page-icons.icon-tables Tables](../pages/tables.md)--- [.page-icons.icon-images Images](../pages/images.md)--- [.page-icons.icon-footnotes Footnotes](../pages/footnotes.md)--- [.page-icons.icon-codeblocks Code Blocks](../pages/codeblocks.md)--- [.page-icons.icon-math Math](../pages/math.md)--- [.page-icons.icon-css CSS](../pages/css.md)--- [.page-icons.icon-mermaid Mermaid](../pages/mermaid.md)--- [.page-icons.icon-uml ZenUML](../pages/zenuml.md)--- [.page-icons.icon-uml Plantuml](../pages/plantuml.md)--- [.page-icons.icon-diagrams AntV Infographic](../pages/antv.md)--- [.page-icons.icon-diagrams Echarts](../pages/echarts.md)--- [.page-icons.icon-diagrams Flowchart](../pages/flowchart.md)--- [.page-icons.icon-diagrams GraphViz](../pages/graphviz.md)--- [.page-icons.icon-diagrams Network Sequence](../pages/network.md)--- [.page-icons.icon-diagrams Railroad](../pages/railroad.md)--- [.page-icons.icon-diagrams WaveDrom](../pages/wavedrom.md)--- [.page-icons.icon-diagrams Vega](../pages/vega.md)--- [.page-icons.icon-diagrams Plotly](../pages/plotly.md)--- [.page-icons.icon-diagrams Abc](../pages/abc.md)
Showdown was created by John Fraser as a direct port of the original parser written by markdown's creator, John Gruber. Although Showdown has evolved since its inception, in "vanilla mode", it tries to follow the original markdown spec (henceforth refereed as vanilla) as much as possible. There are, however, a few important differences, mainly due to inconsistencies in the original spec, which we addressed following the author's advice as stated in the markdown's "official" newsletter.
Showdown also support "extra" syntax not defined in the original spec as opt-in features. This means new syntax elements are not enabled by default and require users to enable them through options.
This document provides a quick description the syntax supported and the differences in output from the original markdown.pl implementation.
3. Paragraphs
Paragraphs in Showdown are just one or more lines of consecutive text followed by one or more blank lines.
On July 2, an alien mothership entered Earth's orbit and deployed several dozen saucer-shaped "destroyer" spacecraft, each 15 miles (24 km) wide.On July 3, the Black Knights, a squadron of Marine Corps F/A-18 Hornets, participated in an assault on a destroyer near the city of Los Angeles.
The implication of the “one or more consecutive lines of text” is that Showdown supports
“hard-wrapped” text paragraphs. This means the following examples produce the same output:
A very long line of text
A verylong lineof text
If you DO want to add soft line breaks (which translate to <br> in HTML) to a paragraph,
you can do so by adding 3 space characters to the end of the line ().
You can also force every line break in paragraphs to translate to <br> (as Github does) by
enabling the option simpleLineBreaks.
4. Headings
4.1. Atx Style
You can create a heading by adding one or more # symbols before your heading text. The number of # you use will determine the size of the heading. This is similar to atx style.
# The largest heading (an <h1> tag)## The second largest heading (an <h2> tag)…###### The 6th largest heading (an <h6> tag)
The space between # and the heading text is not required but you can make that space mandatory by enabling the option requireSpaceBeforeHeadingText.
You can wrap the headings in #. Both leading and trailing # will be removed.
## My Heading ##
If, for some reason, you need to keep a leading or trailing #, you can either add a space or escape it:
# # My header # ##\# My Header \# #
4.2. Setext style
You can also use setext style headings, although only two levels are available.
This is an H1=============This is an H2-------------
Note:
In live preview editors, when a paragraph is followed by a list it can cause an awkward effect.
![awkward effect][]
You can prevent this by enabling the option smoothPreview.
4.3. Header IDs
Showdown generates bookmarks anchors in titles automatically, by adding an id property to an heading.
# My cool header with ID
<h1 id="mycoolheaderwithid">My cool header with ID</h1>
This behavior can be modified with options:
noHeaderId disables automatic id generation;
ghCompatibleHeaderId generates header ids compatible with github style (spaces are replaced with dashes and a bunch of non alphanumeric chars are removed)
prefixHeaderId adds a prefix to the generated header ids (either automatic or custom).
headerLevelStart sets the header starting level. For instance, setting this to 3 means that # header will be converted to <h3>.
In the words of Abraham Lincoln:> Pardon my french
Blockquotes can have multiple paragraphs and can have other block elements inside.
> A paragraph of text>> Another paragraph>> - A list> - with items
6. Bold and Italic
You can make text bold or italic.
*This text will be italic*
**This text will be bold**
Both bold and italic can use either a * or an _ around the text for styling. This allows you to combine both bold and italic if needed.
**Everyone _must_ attend the meeting at 5 o'clock today.**
7. Strikethrough
With the option strikethrough enabled, Showdown supports strikethrough elements.
The syntax is the same as GFM, that is, by adding two tilde (~~) characters around
a word or groups of words.
a ~~strikethrough~~ element
a strikethrough element
8. Emojis
Since version 1.8.0, showdown supports github's emojis. A complete list of available emojis can be foun here.
this is a :smile: smile emoji
this is a 😄 smile emoji
9. Code formatting
9.1. Inline formats
Use single backticks (`) to format text in a special monospace format. Everything within the backticks appear as-is, with no other special formatting.
Here's an idea: why don't we take `SuperiorProject` and turn it into `**Reasonable**Project`.
<p>Here's an idea: why don't we take <code>SuperiorProject</code> and turn it into <code>**Reasonable**Project</code>.</p>
9.2. Multiple lines
To create blocks of code you should indent it by four spaces.
this is a piece of code
If the options ghCodeBlocks is activated (which is by default), you can use triple backticks (```) to format text as its own distinct block.
Check out this neat program I wrote:
```
x = 0
x = 2 + 2
what is x
```
10. Lists
Showdown supports ordered (numbered) and unordered (bulleted) lists.
10.1. Unordered lists
You can make an unordered list by preceding list items with either a *, a - or a +. Markers are interchangeable too.
* Item+ Item- Item
10.2. Ordered lists
You can make an ordered list by preceding list items with a number.
1. Item 12. Item 23. Item 3
It’s important to note that the actual numbers you use to mark the list have no effect on the HTML output Showdown produces. So you can use the same number in all items if you wish to.
10.3. TaskLists (GFM Style)
Showdown also supports GFM styled takslists if the tasklists option is enabled.
- [x] checked list item - [ ] unchecked list item
checked list item
unchecked list item
10.4. List syntax
List markers typically start at the left margin, but may be indented by up to three spaces.
* this is valid * this is too
List markers must be followed by one or more spaces or a tab.
To make lists look nice, you can wrap items with hanging indents:
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
But if you want to be lazy, you don’t have to
If one list item is separated by a blank line, Showdown will wrap all the list items in <p> tags in the HTML output.
So this input:
This differs from other markdown implementations such as GFM (github) or commonmark.
10.5. Nested blocks
List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:
1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.2. Suspendisse id sem consectetuer libero luctus adipiscing.
This is valid for other block elements such as blockquotes:
* A list item with a blockquote: > This is a blockquote > inside a list item.
or event other lists.
10.6. Nested lists
You can create nested lists by indenting list items by four spaces.
1. Item 1 1. A corollary to the above item. 2. Yet another point to consider.2. Item 2 * A corollary that does not need to be ordered. * This is indented four spaces * You might want to consider making a new list.3. Item 3
This behavior is consistent with the original spec but differs from other implementations such as GFM or commonmark. Prior to version 1.5, you just needed to indent two spaces for it to be considered a sublist.
You can disable the four spaces requirement with option disableForced4SpacesIndentedSublists
To nest a third (or more) sublist level, you need to indent 4 extra spaces (or 1 extra tab) for each level.
You can nest fenced codeblocks the same way you nest other block elements, by indenting by fours spaces or a tab:
1. Some code: ```js var foo = 'bar'; console.log(foo); ```
To put a indented style code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs:
1. Some code: var foo = 'bar'; console.log(foo);
11. Links
11.1. Simple
If you wrap a valid URL or email in <> it will be turned into a link whose text is the link itself.
link to <http://www.google.com/>this is my email <somedude@mail.com>
In the case of email addreses, Showdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots.
You can disable this obfuscation setting encodeEmails option to false.
With the option simplifiedAutoLink enabled, Showdown will automagically turn every valid URL it finds in the text body to links for you, without the need to wrap them in <>.
link to http://www.google.com/this is my email somedude@mail.com
11.2. Inline
You can create an inline link by wrapping link text in brackets ( [ ] ), and then wrapping the link in parentheses ( ( ) ).
For example, to create a hyperlink to github.com/showdownjs/showdown, with a link text that says, Get Showdown!, you'd write this in Markdown: [Get Showdown!](https://github.com/showdownjs/showdown).
11.3. Reference Style
You can also use the reference style, like this:
this is a [link to google][1][1]: www.google.com
Showdown also supports implicit link references:
this is a link to [google][][google]: www.google.com
12. Images
Markdown uses an image syntax that is intended to resemble the syntax for links, also allowing for two styles: inline and reference.
Showdown also supports Base64 encoded images, both reference and inline style. Since version 1.7.4, wrapping base64 strings, which are usually extremely long lines of text, is supported.
You can add newlines arbitrarily, as long as they are added after the , character.
Please note that with reference style base64 image sources, regardless of "wrapping", a double newline is needed after the base64 string to separate them from a paragraph or other text block (but references can be adjacent).
wrapped reference style
![Alt text][id]![Alt text][id2][id]:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAIAAAA7ljmRAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVBhXYwCC/2AAZYEoOAMs8Z+BgQEAXdcR7/Q1gssAAAAASUVORK5CYII=[id2]:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAIAAAA7ljmRAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVBhXYwCC/2AAZYEoOAMs8Z+BgQEAXdcR7/Q1gssAAAAASUVORK5CYII=this text needs to be separated from the references by 2 newlines
13. Tables
Tables aren't part of the core Markdown spec, but they are part of GFM and Showdown supports them by turning on the option tables.
Colons can be used to align columns.
In the new version, the outer pipes (|) are optional, matching GFM spec.
You also don't need to make the raw Markdown line up prettily.
You can also use other markdown syntax inside them.
Showdown supports github mentions by enabling the option ghMentions. This will turn every @username into a link to their github profile.
hey @tivie, check this out
Since version 1.6.2 you can customize the generated link in mentions with the option ghMentionsLink.
For instance, setting this option to http://mysite.com/{u}/profile:
<p>hey <a href="http://mysite.com/tivie/profile">@tivie</a>, check this out</p>
15. Handling HTML in markdown documents
Showdown, in most cases, leaves HTML tags alone, leaving them untouched in the output document.
some markdown **here**<div>this is *not* **parsed**</div>
<p>some markdown <strong>here</strong></p><div>this is *not* **parsed**</div>
However, there are exceptions to this. With <code> and <pre><code> tags, their contents are always escaped.
some markdown **here** with <code>foo & bar <baz></baz></code>
<p>some markdown <strong>here</strong> with <code>foo & bar <baz></baz></code></p>
If you wish to enable markdown parsing inside a specific HTML tag, you can enable it by using the html attribute markdown or markdown="1" or data-markdown="1".
some markdown **here**<div markdown="1">this is *not* **parsed**</div>
<p>some markdown <strong>here</strong></p><div markdown="1"><p>this is <em>not</em> <strong>parsed</strong></p></div>
16. Escaping entities
16.1. Escaping markdown entities
Showdown allows you to use backslash (\) escapes to generate literal characters which would otherwise have special meaning in markdown’s syntax. For example, if you wanted to surround a word with literal underscores (instead of an HTML <em> tag), you can use backslashes before the unserscores, like this:
\_literal underscores\_
Showdown provides backslash escapes for the following characters:
\ backslash` backtick* asterisk_ underscore{} curly braces[] square brackets() parentheses# hash mark+ plus sign- minus sign (hyphen). dot! exclamation mark
16.2. Escaping HTML tags
Since version 1.7.2 backslash escaping HTML tags is supported when backslashEscapesHTMLTags option is enabled.
\<div>a literal div\</div>
17. Known differences and Gotchas
In most cases, Showdown's output is identical to that of Perl Markdown v1.0.2b7. What follows is a list of all known deviations. Please file an issue if you find more.
Since version 1.4.0, showdown supports the markdown="1" attribute, but for older versions, this attribute is ignored. This means:
<div markdown="1">
Markdown does *not* work in here.
</div>
You can only nest square brackets in link titles to a depth of two levels:
If you need more, you can escape them with backslashes.
A list is single paragraph if it has only 1 line-break separating items and it becomes multi paragraph if ANY of its items is separated by 2 line-breaks:
It's implemented in showdown-directive.js, allows you to create container directive, leaf directive, text directive.
Generic directives syntax can refer to generic-directives-plugins-syntax of commonmark.
1. Container Directives
The special container directive syntax by wrapping text with a set of greater or equal 3 colons or exclamation marks, as seen below:
::: name [label] {attributes}contents, which are sometimes further block elements:::OR!!! name [label] {attributes}contents, which are sometimes further block elements!!!
Default the admonitions styles are note , alert, simple style name in admonitions syntax. Also customize the type name as a custom style name.
Each style includes the following types, each type corresponds to a class name of css:
Type Name
Flag
Color
summary, tldr, 概要, 摘要
rgb(0,176,255)
abstract, 抽象
info, todo, 信息, 待办
rgb(0,184,212)
tip, hint, 提示, 小窍门
rgb(0,191,165)
success, check, done, 成功, 检测, 完成
rgb(0,200,83)
question, help, faq, 问题, 帮助, 问答
rgb(100,221,23)
warning, caution, 警告, 提醒
rgb(255,145,0)
attention, 关注
failure, fail, missing, 故障, 失败, 缺失
rgb(255,82,82)
danger, 危险
rgb(255,23,68)
error, 错误
bug, 缺陷
example, 示例
rgb(101,31,255)
snippet, 片段
quote, cite, 引用, 引文
rgb(158, 158, 158)
important, key, 重点, 要点
rgb(230, 32, 196)
And you can also customize the style and type.
1.1. Container Syntax
Container blocks contain further blocks. The proposed syntax for container block directives is:
::: name [label] {#id.x.y attributes}contents, which are sometimes further block elements:::OR!!! name [label] {#id.x.y attributes}contents, which are sometimes further block elements!!!
Analogous to fenced code blocks, an arbitrary number of colons or exclamation marks greater or equal three could be used as long as the closing line is longer than the opening line. That way, you can even nest blocks (think divs) by using successively fewer colons for each containing block.
When the name string in the container directive syntax is container (also defaults to container when empty string), row, or col, it is called container syntax; details string is called details-summary syntax; other strings are called admonitions syntax.
The container syntax, for example:
:::::::::row:::col-one!!!tip[tip example]{#example-one.note style="width:100%;"}one contents, which are sometimes further block elements!!!::::::col-two!!! info [info example] {#example-two.alert style="width:100%;"}two contents, which are sometimes further block elements!!!::::::::::::
Which will be rendered as:
<div class="container"> <div class="container-content"> <div class="row"> <div class="row-content"> <div class="col one"> <div class="col-content"> <div id="example-one" class="admonition note tip" style="width:100%;"> <div class="admonition-title">tip example</div> <div class="admonition-content"> <p>one contents, which are sometimes further block elements</p> </div> </div> </div> </div> <div class="col two"> <div class="col-content"> <div id="example-two" class="admonition alert info" style="width:100%;"> <div class="admonition-title">info example</div> <div class="admonition-content"> <p>two contents, which are sometimes further block elements</p> </div> </div> </div> </div> </div> </div> </div></div>
tip example
one contents, which are sometimes further block elements
info example
two contents, which are sometimes further block elements
The details-summary syntax, for example:
::: details[summary title]{#example}contents, which are sometimes further block elements:::
Which will be rendered as:
<details id="example" class="details"> <summary class="details-title"> summary title </summary> <div class="details-content"> <p>contents, which are sometimes further block elements</p> </div></details>
summary title
contents, which are sometimes further block elements
When adding a '+' or '-' after the details token, the admonition is rendered as an expandable block with a small toggle on the right side:
summary title
Admonition, collapsible and initially expanded
The admonitions of container syntax, for example:
::: tip [tip example] {#example.alert style="width:100%;"}You should info that the title will be automatically capitalized.:::OR!!! tip [tip example] {#example.alert style="width:100%;"}You should info that the title will be automatically capitalized.!!!
Which will be rendered as:
<div id="example" class="admonition alert tip" style="width:100%;"> <div class="admonition-title"> tip example </div> <div class="admonition-content"> <p>You should info that the title will be automatically capitalized.</p> </div></div>
tip example
You should info that the title will be automatically capitalized.
!!! types "optional explicit title within double quotes" Any number of other indented markdown elements. This is the second paragraph.
Type will be used as the CSS class name and as default title. It must be a single word and default style is simple. So, for instance:
!!! info You should type name(info) or style name(simple) that the title will be automatically capitalized.
will render:
<div class="admonition simple info"> <div class="admonition-title"> info </div> <div class="admonition-content"> <p>You should info that the title will be automatically capitalized.</p> </div></div>
信息
You should type name(info) or style name(simple) that the title will be automatically capitalized.
Changing the title
By default, the title will equal the type qualifier in titlecase. However, it can be changed by adding a quoted string containing valid Markdown (including links, formatting, …) after the type qualifier:
!!! info "Phasellus posuere in sem ut cursus" Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
will render:
<div class="admonition simple info"> <div class="admonition-title"> Phasellus posuere in sem ut cursus </div> <div class="admonition-content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.</p> </div></div>
Phasellus posuere in sem ut cursus
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Collapsible blocks
When an admonition block is started with ??? instead of !!!, the admonition is rendered as an expandable block with a small toggle on the right side:
Admonition, collapsible
??? tip Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
will render:
<details class="admonition simple tip"> <summary class="admonition-title"> note </summary> <div class="admonition-content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.</p> </div></details>
提示
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
Adding a + after the ??? token renders the block expanded:
???+ info Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
will render:
<details class="admonition simple info" open> <summary class="admonition-title"> note </summary> <div class="admonition-content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.</p> </div></details>
信息
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
1.3. Compatible Syntax
A compatible admonitions syntax by wrapping text with a set of greater or equal 3 colons, as seen below:
You can make a callout foldable by adding a plus (+) or a minus (-) directly after the type identifier.
A plus sign expands the callout by default, and a minus sign collapses it instead.
> [!faq]- Are callouts foldable?> Yes! In a foldable callout, the contents are hidden when the callout is collapsed.
will render:
<details class="callout note faq"> <summary class="callout-title"> Are callouts foldable? </summary> <div class="callout-content"> <p>Yes! In a foldable callout, the contents are hidden when the callout is collapsed.</p> </div></details>
Are callouts foldable?
Yes! In a foldable callout, the contents are hidden when the callout is collapsed.
:: name [title | content] {#id.x.y attributes(key=val)}
To be recognized as a directive, this has to form an otherwise empty paragraph. But as opposed to text directives, there are two colons now, the brackets [] are optional as well, and spaces may be interspersed for readability.
Leaf blocks are defined by default in three types: media or video or 媒体 or 音视频, css-link, and css. See the table below for details:
And you can also customize the type that can be triggered by event leafDirective to output custom HTML code.
3. Text Directives
Common text directive
The syntax for common text directives, it is also an inline directives:
:name[content without `\f\v\r\n\[\]`]{#id.x.y attributes(key=val)}
Exactly one colon, followed by the name which is the identifier for the extension and must be a string without spaces, content without \f\v\r\n\[\] char may be further inline markdown elements to be interpreted and then printed in one way or another and the {#myId.myClass key=val key2="val 2"} contain generic attributes (i.e. key-value pairs) and are optional.
Rendered by default as:
<name id="id" class="x y" key=val>content</name>
Content without '\f\v\r\n[]'
:div[*This is a common text directive*]{#hello-1 style="font-size: 2rem;font-height: bold;"}
This is a common text directive
And you can also customize the type that can be triggered by event textDirective to customize and reset default HTML code.
Embed text directive
The syntax for embed text directives, it is also an inline and embed directives:
:name[content without '\f\v\r\n']{#id.x.y attributes(key=val)}!!
Exactly one colon, followed by the name which is the identifier for the extension and must be a string without spaces, content without \f\v\r\n char may be further inline markdown elements to be interpreted and then printed in one way or another and the {#myId.myClass key=val key2="val 2"} contain generic attributes (i.e. key-value pairs) and are optional, finally use two !! end.
And you can also customize the type that can be triggered by event embedDirective to customize and reset default HTML code.
Sometimes, it's desirable to group alternative content under different tabs, e.g. when describing how to access an API from different languages or environments. It allows for beautiful and functional tabs, grouping code blocks and other content. Syntax format as follow:
Content tabs Syntax
=== "Tab Title one"Table content one=== "Tab Title two"Table content two
1. Grouping code blocks
Code blocks are one of the primary targets to be grouped, and can be considered
a special case of content tabs, as tabs with a single code block are always
rendered without horizontal spacing:
Content tabs with code blocks
=== "C" ``` c #include <stdio.h> int main(void) { printf("Hello world!\n"); return 0; } ```=== "C++" ``` c++ #include <iostream> int main(void) { std::cout << "Hello world!" << std::endl; return 0; } ```
When a content tab contains more than one code block, it is rendered with
horizontal spacing. Vertical spacing is never added, but can be achieved
by nesting tabs in other blocks:
Content tabs
=== "Unordered list" * Sed sagittis eleifend rutrum * Donec vitae suscipit est * Nulla tempor lobortis orci=== "Ordered list" 1. Sed sagittis eleifend rutrum 2. Donec vitae suscipit est 3. Nulla tempor lobortis orci
Sed sagittis eleifend rutrum
Donec vitae suscipit est
Nulla tempor lobortis orci
Sed sagittis eleifend rutrum
Donec vitae suscipit est
Nulla tempor lobortis orci
3. Embedded content
When [SuperFences] is enabled, content tabs can contain arbitrary nested
content, including further content tabs, and can be nested in other blocks like
[admonitions] or blockquotes:
Content tabs in admonition
!!! example === "Unordered List" ``` markdown * Sed sagittis eleifend rutrum * Donec vitae suscipit est * Nulla tempor lobortis orci ``` === "Ordered List" ``` markdown 1. Sed sagittis eleifend rutrum 2. Donec vitae suscipit est 3. Nulla tempor lobortis orci ```
示例
* Sed sagittis eleifend rutrum* Donec vitae suscipit est* Nulla tempor lobortis orci
1. Sed sagittis eleifend rutrum2. Donec vitae suscipit est3. Nulla tempor lobortis orci
he TOC syntax consists of one or more '#' (the quantity of which is the current TOC header level) add the following string, and the syntax string is not case sensitive.
【TOC】【目录】【_TOC_】【Table Of Contents】【Table-Of-Contents】[TOC][目录][Table Of Contents][Table-Of-Contents]{{TOC}}{{_TOC_}}[[TOC]][[_TOC_]]
The main toc head level is one, and so follow syntax:
# [[TOC]]
The sub head of two level is two, and so follow syntax:
Footnotes are a great way to add supplemental or additional information to a specific word, phrase or sentence without interrupting the flow of a document. Material for MkDocs provides the ability to define, reference and render footnotes. It's implemented in showdown-footnotes.js, use for reference the showdown-footnotes.
1. Adding footnote references
A footnote reference must be enclosed in square brackets and must start with a caret ^, directly followed by an arbitrary identifier, which is similar to the standard Markdown link syntax.
Text with footnote references
Lorem ipsum[^1] dolor sit amet, consectetur adipiscing elit.[^2]
Lorem ipsum[1] dolor sit amet, consectetur adipiscing elit.[2]
2. Adding footnote content
The footnote content must be declared with the same identifier as the reference. It can be inserted at an arbitrary position in the document and is always rendered at the bottom of the page. Furthermore, a backlink to the footnote reference is automatically added.
2.1. On a single line
Short footnotes can be written on the same line:
Footnote
[^1]: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2.2. On multiple lines
Paragraphs can be written on the next line and must be indented by four spaces:
Footnote
[^2]: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
[1]: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
[2]: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Support inline image be defined, including the image path can be reset using a reset event. Its markdown syntax format Its grammatical format is the same as that of obsidian-style image links.
In order to provide additional context, a custom title can be added to a code block by using the title="" option directly after the shortcode, e.g. to display the name of a file:
Code block with title
``` py title="bubble_sort.py" def bubble_sort(items): for i in range(len(items)): for j in range(len(items) - 1 - i): if items[j] > items[j + 1]: items[j], items[j + 1] = items[j + 1], items[j] ```
2. Code Block examples
For JavaScript:
/** * Merge object with deepth * * @param {object} target * Target object * @param {object[]} sources * Source object or objects * @returns {object} * Meraged Object */export function deepMerge(target, ...sources) { for (const source of sources) { for (const [key, val] of Object.entries(source)) { // @ts-ignore if (isObject(val) && isObject(target[key])) { // @ts-ignore deepMerge(target[key], val); } else { Object.assign(target, { [key]: val }); } } } return target;}
PopularisationBritish popular psychologyauthor Tony BuzanResearchOn effectivenessand featuresOn Automatic creationUsesCreative techniquesStrategic planningArgument mappingToolsPen and paperMermaid
AntV Infographic is AntV's next-generation declarative infographic visualization engine. With a carefully designed infographic syntax, it can quickly and flexibly render high-quality infographics, making information presentation more efficient and data storytelling simpler.
ZenUML. is a family of diagramming tools operated by P&D Vision Pty Ltd. It works on Atlassian Confluence, any modern browser, JetBrains Intellij IDE. It is featured as a leading diagram-as-code solution for sequence diagrams. Extra capabilities are provided on different platforms.
Apache ECharts is a free, powerful charting and visualization library offering easy ways to add intuitive, interactive, and highly customizable charts to your commercial products. It is written in pure JavaScript and based on zrender, which is a whole new lightweight canvas library.
Besides the built-in chart types, ECharts also provides a custom series for users to create more specific chart types. To use it, just pass the renderItem callback function and return any graphic elements you wish to draw, according to the data. ECharts supports native interactivity and so there is no need for further configuration.
More features of Apache ECharts can be found in the feature document.
Javascript library for rendering standard music notation in a browser.
This library makes it easy to incorporate sheet music into your markdown. You can also turn visible ABC text into sheet music on markdown that you don't own using a greasemonkey script, or change your own markdown that contains ABC text with no other changes.
ABC Music Notation is a format for specifying sheet music using only a string of characters. For instance, the following string encodes the music that is shown below it. That music was drawn by including this library on this webpage.
X: 1T: Cooley'sM: 4/4L: 1/8K: Emin|:D2|EB{c}BA B2 EB|~B2 AB dBAG|FDAD BDAD|FDAD dAFD|EBBA B2 EB|B2 AB defg|afe^c dBAF|DEFD E2:||:gf|eB B2 efge|eB B2 gedB|A2 FA DAFA|A2 FA defg|eB B2 eBgB|eB B2 defg|afe^c dBAF|DEFD E2:|
Sheet Music for "Cooley's"Cooley's
In addition, the music can also be played by a synthesizer:
Sheet Music for "Clouds Thicken (云层变厚)"Clouds Thicken (云层变厚)Creepy JigPaul Rosen= 116EmC7EmC7B7EmC7EmD (Bm7)EmEmEm2GEmDEmGEmDEmSource: Copyright 2005, Paul Rosen
0123456789abcdefstartTxIDtypeargstags11872349ae11TxID1047020f091400100000000c (12)060606030606060603000000201100002104110000000011length11430length1Cue and loop point bytes40i+00110000003611numhot11numcuei+00i+1011length214length2Unknown bytesi+20i+00
An example for a RESTful endpoint
Go to the "Cheat sheet" tab or https://docs.zenuml.com
to find all syntax
POST /v1/book/{id}/borrow