Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

panchaow/remark-bilibili-autolink

Repository files navigation

Remark bilibili autolink

CircleCI codecov

autolink bilibili short refs in markdown to bilibili videos & articles

Install

with yarn:

yarn add remark-bilibili-autolink

with npm:

npm install --save remark-bilibili-autolink

Usage

const remark = require('remark');
const bili = require('remark-bilibili-autolink');

const markdown = `
# Markdown
I found a awesome video here: av47343863.
`

remark().use(bili, {
  video: true
}).process(markdown, (err, file) => {
  console.log(String(file));
})

Configuration

processor.use(bili[, options])

This will replace words that starts with 'av'/'bv'/'cv' inside Paragraph and Heading elements (see mdast) with links pointing to corresponding video/article.

  • article (boolean, default: true).

    If set to false, article short ref (e.g. cv123) will not be replaced.

  • video (boolean, default: true)

    If set to false, video short ref (e.g. av123) will not be replaced.

About

Remark 插件,将 Markdown 文档中的bilibili短引用转换成对应的链接

Resources

Stars

Watchers

Forks

Packages

No packages published