# @kohaku/hexo-renderer-markdown-it

> A faster and CommonMark compliant alternative for Hexo.

Latest version **0.0.3** (published 2023-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kohaku/hexo-renderer-markdown-it
pnpm add @kohaku/hexo-renderer-markdown-it
yarn add @kohaku/hexo-renderer-markdown-it
bun add @kohaku/hexo-renderer-markdown-it
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-06-12 |
| First published | 2023-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 40.6 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Nanami |
| Maintainers | kohaku |
| Keywords | hexo, render, markdown, markdown-it |

## Links

- npm: https://www.npmjs.com/package/@kohaku/hexo-renderer-markdown-it
- Repository: https://github.com/ymd45921/hexo-renderer-markdown-it-plus
- npm.io page: https://npm.io/package/@kohaku/hexo-renderer-markdown-it

## Dependencies (15)

- [clone](https://npm.io/package/clone.md) ^2.1.1
- [katex](https://npm.io/package/katex.md) ^0.16.7
- [uslug](https://npm.io/package/uslug.md) ^1.0.4
- [markdown-it](https://npm.io/package/markdown-it.md) ^13.0.1
- [highlight.js](https://npm.io/package/highlight.js.md) ^11.5.1
- [markdown-it-ins](https://npm.io/package/markdown-it-ins.md) ^3.0.1
- [markdown-it-sub](https://npm.io/package/markdown-it-sub.md) ^1.0.0
- [markdown-it-sup](https://npm.io/package/markdown-it-sup.md) ^1.0.0
- [markdown-it-toc](https://npm.io/package/markdown-it-toc.md) ^1.1.0
- [markdown-it-abbr](https://npm.io/package/markdown-it-abbr.md) ^1.0.4
- [markdown-it-mark](https://npm.io/package/markdown-it-mark.md) ^3.0.1
- [markdown-it-emoji](https://npm.io/package/markdown-it-emoji.md) ^2.0.2
- [markdown-it-deflist](https://npm.io/package/markdown-it-deflist.md) ^2.1.0
- [markdown-it-checkbox](https://npm.io/package/markdown-it-checkbox.md) ^1.1.0
- [markdown-it-footnote](https://npm.io/package/markdown-it-footnote.md) ^3.0.3

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-06-12
- 0.0.2 — 2023-05-11
- 0.0.1 — 2023-05-11

## README

# Hexo Renderer Markdown-it

Modified from [markdown-it-katex](https://github.com/iktakahiro/markdown-it-katex/tree/fd03d2d21dbc02c73c8e651abd5386af076a1440) and [hexo-renderer-markdown-it-plus](https://github.com/CHENXCHEN/hexo-renderer-markdown-it-plus/tree/c94ed9305c1d5ddb9b1c305d7e2e53a1d84d76ce). For better KaTeX writing experience. You can find the original README file in `doc`.

> Local Git: lilyknight/hexo-related/hexo-renderer-markdown-it  
> Github: https://github.com/ymd45921/hexo-renderer-markdown-it-plus  
> NPM: `@kohaku/hexo-renderer-markdown-it`

## Usage

Recommend use it with `hexo-theme-ymd45921`.

You should remove your previous Markdown renderer before install this.

```bash
yarn remove hexo-renderer-marked
yarn add @kohaku/hexo-renderer-markdown-it
```

## Options

You can configure this renderer by adding a section to your hexo main `_config.yml` file like below. Of course, do-nothing is also recommend.

```yml
ymd45921:
  markdown_it:
    highlight: true
    html: true
    xhtmlOut: true
    breaks: true
    langPrefix:
    linkify: true
    typographer:
    quotes: “”‘’
    plugins:
      - plugin:
          name: markdown-it-mark
          enable: false
    katex:
      throwOnError: false
      errorColor: '#c00'
      strict: ignore          # ignore | warn | error
      output:                 # mathml | html | htmlAndMathml
      leqno: false
      fleqn: false
      macros: 
        "\\and": "\\mathbb{∧}"
```

The `plugins` object contains all plugins to markdown-it you want to add. If you want to add a plugin named as `markdown-it-something`, you should install it as a dependency first, and add it to the `plugins` object as provided format.

The `katex` object contains options that directly apply to KaTeX. Some options' meaning is as follows:

- `throwOnError`: when error occurred in KaTeX parsing, renderer will return the TeX formula if it set to `true`, or try to continue the parse by ignoring the part of the parse that went wrong.
- `errorColor`: while `throwOnError` set to `false`, renderer will set the ignored part to this color.
- `output`: determines the markup language of the output. Valid choices includes MathML, HTML and both.

 You can also check the [KaTeX official doc](https://katex.org/docs/options.html) to see what other key does in the example above.

## Some notes

If you set katex output format to `HTML`, you should import KaTeX's stylesheet in your webpage to ensure rendered block displays correctly in browsers. 

```html
<link rel="stylesheet" href="https://unpkg.com/katex@0.16.7/dist/katex.min.css">
```

Alternatively, if you set `MathML` as output, which will place rendered results to `<math>` blocks that have long been supported by Firefox long, and are supported by most modern browsers today.

---
_Source: https://npm.io/package/@kohaku/hexo-renderer-markdown-it · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
