docs: updated cli page to describe the updated format of passing extra options

This commit is contained in:
Antonio 2022-04-23 23:14:29 +03:00
parent 3e1731f1fe
commit 9e5d0f3f11
No known key found for this signature in database
GPG Key ID: B2925A0862737E97

View File

@ -152,19 +152,44 @@ showdown makehtml [options]
showdown makehtml -e ~/twitter.js -e ~/youtube.js showdown makehtml -e ~/twitter.js -e ~/youtube.js
``` ```
###### `-c/--config`
* Short format: `-c`
* Alias: `--config`
* Description: Enable or disable parser options.
* Introduced in: `2.0.1` (Breaking change. See the [`Extra options`](#extra-options) section below)
* Example:
!!! example ""
```sh
showdown makehtml -i foo.md -o bar.html -c strikethrough
showdown makehtml -i foo.md -o bar.html -c strikethrough -c emoji
```
## Extra options ## Extra options
Starting from the version `2.0.1`, CLI the format of passing extra options has changed. Please make the necessary changes to your code, if required.
=== "since `v2.0.1`"
```sh
showdown makehtml -i foo.md -o bar.html -c strikethrough -c emoji
```
=== "before `v2.0.1`"
```sh
showdown makehtml -i foo.md -o bar.html --strikethrough --emoji
```
You can specify any of the [supported options](available-options.md), and they will be passed to the converter. You can specify any of the [supported options](available-options.md), and they will be passed to the converter.
For example, you can enable strikethrough support via the following command:
``` The above commands are equivalent of doing:
showdown makehtml -i foo.md -o bar.html --strikethrough
```
this command is equivalent of doing:
```js ```js
var conv = new showdown.Converter({strikethrough: true}); var conv = new showdown.Converter({strikethrough: true, emoji: true});
``` ```
!!! warning "" !!! warning ""