1.0.2 • Published 3 years ago
hexo-pandoc-header-anchor v1.0.2
hexo-pandoc-header-anchor
Add anchors to each header like markdown-it.
Getting started
Prerequisites
hexo-renderer-pandoc should be used as the renderer of hexo.
pandoc and panflute should be installed. Note that the version of panflute should match the version of pandoc: https://github.com/sergiocorreia/panflute#supported-pandoc-versions.
Install
npm install hexo-pandoc-header-anchor --saveAdd the following configurations to _config.yml:
pandoc:
filters:
- node_modules/hexo-pandoc-header-anchor/header-anchor.pyThen hexo clean && hexo s -g to preview effects. ¶ is the anchor of the corresponding header. Example: https://seekstar.github.io/2022/03/10/a-collection-of-matrix-groups/
Options
pandoc:
meta:
- header_anchor_str: '¶'
# 'left' | 'right'
- header_anchor_side: 'left'The above values are default. You may change them to customize.
LICENSE
This project is licensed under the ISC License.
Credits
This project is inspired by hexo-pandoc-tippy and leonfancy.github.io/pandocfilters/header_link.py.