Skip to content

Commit

Permalink
Merge pull request #117 from jacobmarble/jgm-markdown
Browse files Browse the repository at this point in the history
feat: enable marked options configuration in frontmatter
  • Loading branch information
MSzturc authored Aug 18, 2022
2 parents c2bd743 + e02ba39 commit b9517ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/content/yaml/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,25 @@ autoSlide | Controls automatic progression to the next slide | number (in millis
transition | Transition style | none / fade / slide / convex / concave / zoom | true
transitionSpeed | Transition speed | default / fast / slow | default
bg | Sets a default background for all slides | [see slide background docs]({{%relref "slideBackground"%}}) | '#ffffff'
markdown | Sets options for marked | (see note below) | (see note below)

<br>

{{%alert%}}You can find more possible parameters [here](https://revealjs.com/config/){{%/alert%}}

{{%alert%}}
[marked](https://marked.js.org/) is the Markdown parser used by reveal.js.
The complete set of marked options is [here](https://marked.js.org/using_advanced#options).

The default value of `markdown`:
```yaml
markdown:
gfm: true
mangle: true
pedantic: false
smartLists: false
smartypants: false
```
Other marked options exist, but should not be used with the Advanced Slides plugin.
{{%/alert%}}
7 changes: 7 additions & 0 deletions src/template/reveal.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@
mathjax3: {
mathjax: '{{{base}}}plugin/math/mathjax/tex-mml-chtml.js',
},
markdown: {
gfm: true,
mangle: true,
pedantic: false,
smartLists: false,
smartypants: false,
},

{{#enableCustomControls}}
customcontrols: {
Expand Down
1 change: 1 addition & 0 deletions src/yamlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class YamlParser {
'display',
'hideInactiveCursor',
'hideCursorTime',
'markdown',
];
const globalSettings = _.pick(_.omitBy(this.settings, _.isEmpty), revealProps);
const slideSettings = _.pick(options, revealProps);
Expand Down

0 comments on commit b9517ef

Please sign in to comment.