• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ“– Insert a markdown TOC before posts be rendered.

hexo-toc

MIT License

npm: Package Quality

Insert a markdown TOC(Table Of Content) before posts be rendered.

Unlike the native toc helper, this plugin will inject a TOC only when a placeholder(<!-- toc -->) found in the raw markdown files. And the TOC will be injected after the placeholder.

All you need to do is placing a placeholder(<!-- toc -->) in your post when and where needed.

Note: this plugin will not mangle your posts(markdown files), so you can use it bold.

Install

npm install hexo-toc --save

Options

All the options of markdown-toc, slugify function, and heading anchor options can be specified as follow in your _config.yml:

toc:
  maxdepth: 3
  class: toc
  slugify: transliteration
  decodeEntities: false
  anchor:
    position: after
    symbol: '#'
    style: header-anchor
  • maxdepth: Use headings whose depth is at most maxdepth.
  • class: The CSS Class for the toc. (Default is false)
  • slugify: Choose which slugify function you want to use. Currently support uslug (Default) and transliteration.
  • decodeEntities: Select whether to enable decode entities. ( Default is false and please see #15).
  • anchor: Whether should have an anchor for each headings. (Default is false)
    • position: Where should the anchor be, before the title, or after the title. (Default is after);
    • symbol: Which symbol you want the anchor be. (Default is #);
    • style: The CSS class for the anchor, (Default is header-anchor);

Known issues

#8

Working with hexo-renderer-markdown-it.

# Markdown-it config
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki
markdown:
  render:
    html: true

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

More Repositories

1

html-to-image

โœ‚๏ธ Generates an image from a DOM node using HTML5 canvas and SVG.
TypeScript
5,680
star
2

ascii-progress

๐Ÿ“ Ascii progress-bar(s) in the terminal.
TypeScript
197
star
3

hexo-filter-flowchart

Generate flowchart diagrams for Hexo.
JavaScript
122
star
4

natsort

๐ŸŒด Javascript natural sort algorithm with unicode support.
TypeScript
74
star
5

logo.svg

Generate a svg logo, then you can embed it in you README.
JavaScript
48
star
6

grunt-restful-mock

๐Ÿš€ A mock server returning random JSON-data.
JavaScript
42
star
7

hexo-theme-formula

๐Ÿ‘™ Hexo theme base on jade and less.
JavaScript
40
star
8

hexo-filter-sequence

Generate UML sequence diagrams for Hexo.
JavaScript
39
star
9

text2svg

๐Ÿ„ Convert text to svg path.
JavaScript
29
star
10

get-cursor-position

๐Ÿพ Get the cursor's current position in your terminal.
C++
27
star
11

hexo-filter-fenced-code

๐ŸŽจ Extend syntax for the native fenced code block.
JavaScript
18
star
12

global-proxy

Set system proxy for mac and windows platform.
TypeScript
14
star
13

run-shared-scripts

Define and run shared npm scripts of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm
JavaScript
14
star
14

grunt-file-hash

๐Ÿ‘พ Generate hashed mapping for your static files.
JavaScript
10
star
15

ansi.js

ansi escape sequences for terminal cursor positioning and coloring.
TypeScript
8
star
16

number-abbreviate

๐ŸŽฑ Abbreviate number to a more human-friendly format (3.6K, 6.8M, etc.)
TypeScript
8
star
17

vscode-action-buttons

A vscode plugin to append action buttons in the status bar.
TypeScript
6
star
18

ocr.it

โฐ A tool to recognize text from images.
TypeScript
6
star
19

configs

Shared configs for my projects
JavaScript
6
star
20

electron-tray-indicator

๐Ÿ“A progress indicator in tray for your Electron app.
TypeScript
5
star
21

coder-calendar

็จ‹ๅบๅ‘˜็š„่€้ป„ๅŽ†
TypeScript
5
star
22

dataurl-to-blob

Convert the given dataURL to a Blob.
JavaScript
5
star
23

awesome-badge-list

๐Ÿ‘“ A collection awesome badges.
5
star
24

spelling-suggestion

Given a name and a list of names that are not equal to the name, return a spelling suggestion if there is one that is close enough.
TypeScript
3
star
25

fetch-client

A convenient fetch client with middleware support.
JavaScript
3
star
26

moment

Moment is a Menu Bar and Notification Center based countdown app to help you remember the most memorable days of your life.
3
star
27

global-proxy-cli

Set system proxy for mac and windows platform.
JavaScript
3
star
28

bot

A GitHub App for me.
TypeScript
3
star
29

licen

Generate license files for your projects.
JavaScript
3
star
30

find-monorepo-root

Find the root directory of a monorepo using Yarn workspaces, Bolt, Lerna or pnpm
TypeScript
3
star
31

bubkoo.com

JavaScript
3
star
32

grunt-underscore-compiler

Compile underscore templates into JavaScript files.
JavaScript
3
star
33

semantic-release-monorepo

Apply semantic-release's automatic publishing to a monorepo.
TypeScript
3
star
34

bubkoo

๐Ÿคนโ€โ™€๏ธ
3
star
35

365dots

Presenting the time progress of a year.
TypeScript
2
star
36

daily-saying

Fetch a daily saying from iciba.com and output it
JavaScript
2
star
37

position-sticky-polyfill

position: sticky; The shim/polyfill!
JavaScript
2
star
38

bubkoo.github.com

bubkoo's blog. Welcome
HTML
2
star
39

boxup

Wrap content with a box in the terminal
JavaScript
2
star
40

reusable-workflows

2
star
41

hexo-theme-flight

Hexo's theme for bubkoo's blog
JavaScript
2
star
42

hexo-filter-sub

Generate subscript (<sub>) tag for Hexo.
JavaScript
1
star
43

boxup-preset

Some presets for boxup.
JavaScript
1
star
44

loadrc

Load runtime configuration files for your module.
JavaScript
1
star
45

toolbox

dotfiles, scripts, etc.
Shell
1
star
46

cert-generator

Generate a root certificate.
JavaScript
1
star
47

semantic-release-config

1
star
48

rsw-b

JavaScript
1
star
49

break-string

Break string into lines according to visual width
JavaScript
1
star
50

on-new-line

Hijacks NodeJS Stream and emits events when newline(s) written to the output.
JavaScript
1
star
51

boxup-cli

Create boxes in the terminal
JavaScript
1
star
52

regexper

Regular expression visualizer using railroad diagrams.
TypeScript
1
star