From 8d9b8f2f9282d050a0263d498b789372a9d76b54 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 30 Mar 2022 01:27:06 +0300 Subject: [PATCH] docs: added page about flavors --- docs/flavors.md | 23 +++++++++++++++++++++++ mkdocs.yml | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 docs/flavors.md diff --git a/docs/flavors.md b/docs/flavors.md new file mode 100644 index 0000000..0850735 --- /dev/null +++ b/docs/flavors.md @@ -0,0 +1,23 @@ +## Overview + +You can use _flavors_ (or presets) to set the preferred options automatically. In this way, Showdown behaves like popular Markdown flavors. + +Currently, the following flavors are available: + + * `original`: Original Markdown flavor as in [John Gruber's spec](https://daringfireball.net/projects/markdown/) + * `vanilla`: Showdown base flavor (v1.3.1 onwards) + * `github`: [GitHub Flavored Markdown, or GFM](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) + +## Set flavor + +=== "Globally" + + ```js + showdown.setFlavor('github'); + ``` + +=== "Locally" + + ```js + converter.setFlavor('github'); + ``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 727eb4a..aaed006 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -35,4 +35,5 @@ nav: - Compatibility: compatibility.md - Configuration: - Showdown options: configuration.md - - Available options: available-options.md \ No newline at end of file + - Available options: available-options.md + - Flavors: flavors.md \ No newline at end of file