Add back heading anchors via markdown-it-anchors plugin

This commit is contained in:
Chase Sterling 2016-09-04 16:03:16 -04:00
parent 2bf11e6604
commit d2bd13da46
3 changed files with 10 additions and 0 deletions

View file

@ -11,6 +11,7 @@
"ace-builds": "~1.2.3", "ace-builds": "~1.2.3",
"parsleyjs": "~2.3.10", "parsleyjs": "~2.3.10",
"markdown-it": "~7.0.0", "markdown-it": "~7.0.0",
"markdown-it-anchor": "https://wzrd.in/standalone/markdown-it-anchor@2.5.0",
"js-yaml": "~3.6.0", "js-yaml": "~3.6.0",
"store-js": "~1.3.16", "store-js": "~1.3.16",
"bootswatch-dist": "3.3.6-flatly", "bootswatch-dist": "3.3.6-flatly",

View file

@ -230,6 +230,7 @@ assets.register('main.js',
'vendor/handlebars/handlebars.js', 'vendor/handlebars/handlebars.js',
'vendor/js-yaml/dist/js-yaml.js', 'vendor/js-yaml/dist/js-yaml.js',
'vendor/markdown-it/dist/markdown-it.js', 'vendor/markdown-it/dist/markdown-it.js',
'vendor/markdown-it-anchor/index.0',
'js/html-sanitizer-minified.js', # don't minify? 'js/html-sanitizer-minified.js', # don't minify?
'vendor/highlightjs/highlight.pack.js', 'vendor/highlightjs/highlight.pack.js',
'vendor/parsleyjs/dist/parsley.js', 'vendor/parsleyjs/dist/parsley.js',

View file

@ -52,6 +52,14 @@ var markdownit = window.markdownit({
return ''; // use external default escaping return ''; // use external default escaping
} }
}).use(markdownItAnchor, {
level: 1,
// slugify: string => string,
permalink: false,
// renderPermalink: (slug, opts, state, permalink) => {},
permalinkClass: 'header-anchor',
permalinkSymbol: '¶',
permalinkBefore: false
}); });
// Markdown Renderer // Markdown Renderer