Skip to content

bent10/marked-extensions

Repository files navigation

marked-extensions

Marked extensions workspace.

Install

Follows the steps below to get up and running:

# clone this repo
> git clone https://github.com/bent10/marked-extensions.git

# go to the project directory and install dependencies
> cd marked-extensions && npm i

Packages

Package Description Version (click for changelog)
marked-alert Enables GFM alerts. npm
marked-code-format Formatting code blocks using Prettier npm
marked-code-jsx-renderer Render JSX code blocks using a custom renderer and components npm
marked-code-preview Transform code blocks into code previews npm
marked-footnote Enables GFM footnotes. npm
marked-sequential-hooks Enables the sequential preprocessing and post-processing npm

Sequential hooks

Incorporate the power of sequential hooks using the following packages within sequential hooks:

Show the example code 🚀
import { Marked } from 'marked'
import markedSequentialHooks from 'marked-sequential-hooks'

const html = new Marked()
  .use(
    markedSequentialHooks({
      markdownHooks: [mdHoook1(), mdHook2],
      htmlHooks: [htmlHook1(), htmlHook2]
    })
  )
  .parse('# Content')

console.log(html)
Package Types Description Version (click for changelog)
marked-hook-data MarkdownHook A sequential hook to load data from files or objects npm
marked-hook-ejs any A sequential hook to support EJS npm
marked-hook-frontmatter MarkdownHook A sequential hook to support frontmatter npm
marked-hook-handlebars any A sequential hook to support Handlebars npm
marked-hook-layout HtmlHook A sequential hook that handles layouts npm

Contributing

We 💛  issues.

When committing, please conform to the semantic-release commit standards. Please install commitizen and the adapter globally, if you have not already.

npm i -g commitizen cz-conventional-changelog

Now you can use git cz or just cz instead of git commit when committing. You can also use git-cz, which is an alias for cz.

git add . && git cz