Skip to content

miao1007/mdbook-node-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version download

Current API is not stable.

mdbook-node-wrapper

A bridge between rust and NodeJS for mdbook.

mdbook-preprocessor(rust) --(stdin)--> mdbook-node-wrapper --(stdout)--> modified files

Features:

  • custom fragment handler
  • inject front matters into
  • add tags page

Usage

First install bin

npm install -g https://github.com/miao1007/mdbook-node-wrapper.git

Add following your book.toml

cat >> book.toml << EOF
[preprocessor.node-wrapper]
EOF

Create a js for markdown fragment handling

// <book_root>/plugin/node-wrapper.js
module.exports = {
    js: function(str){
        // eg: make all js content uppercase
        return str.toUpperCase();
    }
}

TODO & Problems

  • no cache now.
  • bring node_modules back
  • add tokenize(dict from tags)

About

A bridge between rust and NodeJS for mdbook.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published