Skip to content

Commit

Permalink
docs: added extensions overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
bandantonio committed Mar 30, 2022
1 parent bdddfb9 commit d11e5cf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
36 changes: 36 additions & 0 deletions docs/extensions.md
Original file line number Diff line number Diff line change
@@ -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
<script src="src/showdown.js"></script>
<script src="src/extensions/twitter.js"></script>
<script>var converter = new showdown.Converter({ extensions: ['twitter'] });</script>
```

=== "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
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ nav:
- Available options: available-options.md
- Flavors: flavors.md
- CLI: cli.md
- Integrations: integrations.md
- Integrations: integrations.md
- Extensions:
- Overview: extensions.md

0 comments on commit d11e5cf

Please sign in to comment.