0.0.2 • Published 4 years ago

remark-bilibili-autolink v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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'/'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.

0.0.2

4 years ago

0.0.1

5 years ago