hexo-pandoc-header-anchor

1.0.2 • Public • Published

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 --save

Add the following configurations to _config.yml:

pandoc:
  filters:
    - node_modules/hexo-pandoc-header-anchor/header-anchor.py

Then 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.

Readme

Keywords

Package Sidebar

Install

npm i hexo-pandoc-header-anchor

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

3.71 kB

Total Files

5

Last publish

Collaborators

  • seekstar