Sfoglia il codice sorgente

chore: update REAMDE.md to include reference to flavors

Estevão Soares dos Santos 8 anni fa
parent
commit
e00d270383
1 ha cambiato i file con 22 aggiunte e 2 eliminazioni
  1. 22 2
      README.md

+ 22 - 2
README.md

@@ -262,7 +262,27 @@ var defaultOptions = showdown.getDefaultOptions();
 
  * **disableForced4SpacesIndentedSublists**: (boolean) [default false] Disables the requirement of indenting sublists by 4 spaces for them to be nested, 
  effectively reverting to the old behavior where 2 or 3 spaces were enough. (since v1.5.0)
- 
+
+## Flavors
+
+You can also use flavors or presets to set the correct options automatically, so that showdown behaves like popular markdown flavors.
+
+Currently, there are two flavors available:
+
+ * github - GFM (GitHub Flavored Markdown)
+ * vanilla - original markdown flavor
+
+### Global
+```javascript
+showdown.setFlavor('github');
+```
+
+### Instance
+```javascript
+converter.setFlavor('github');
+```
+
+
 ## CLI Tool
 
 Showdown also comes bundled with a Command Line Interface tool. You can check the [CLI wiki page][cli-wiki] for more info
@@ -388,4 +408,4 @@ Showdown is powered by:<br/>
 [ext-wiki]: https://github.com/showdownjs/showdown/wiki/extensions
 [coding-rules]: https://github.com/showdownjs/code-style/blob/master/README.md
 [ng-commit-guide]: https://github.com/showdownjs/code-style/blob/master/README.md#commit-message-convention
-[boilerplate-repo]: https://github.com/showdownjs/extension-boilerplate
+[boilerplate-repo]: https://github.com/showdownjs/extension-boilerplate