From d11e5cf6e0d1be435fb7c1e446a952f574dc29a1 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 30 Mar 2022 23:35:17 +0300 Subject: [PATCH] docs: added extensions overview page --- docs/extensions.md | 36 ++++++++++++++++++++++++++++++++++++ mkdocs.yml | 4 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 docs/extensions.md diff --git a/docs/extensions.md b/docs/extensions.md new file mode 100644 index 0000000..320cefa --- /dev/null +++ b/docs/extensions.md @@ -0,0 +1,36 @@ +Showdown allows you to load additional functionality via extensions. You can find a list of known Showdown extensions [here][ext-wiki]. + +You can also check the [boilerplate repo][boilerplate-repo], to create your own extension(s). + +## Usage + +=== "Server-side" + + ```js + // Using a bundled extension + var showdown = require('showdown'); + var converter = new showdown.Converter({ extensions: ['twitter'] }); + + // Using a custom extension + var mine = require('./custom-extensions/mine'); + var converter = new showdown.Converter({ extensions: ['twitter', mine] }); + ``` + +=== "Client-side" + + ```js + + + + ``` + +=== "CLI" + + In the CLI tool, use the [`-e` flag](/cli/#-e-extensions) to load an extension. + + ```sh + showdown -e twitter -i foo.md -o bar.html + ``` + +[ext-wiki]: https://github.com/showdownjs/showdown/wiki/extensions +[boilerplate-repo]: https://github.com/showdownjs/extension-boilerplate \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index b87fdf0..a1d77cd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,4 +38,6 @@ nav: - Available options: available-options.md - Flavors: flavors.md - CLI: cli.md - - Integrations: integrations.md \ No newline at end of file + - Integrations: integrations.md + - Extensions: + - Overview: extensions.md \ No newline at end of file