
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
markdown-it-plugin-gitbook
Advanced tools
:book: A markdown-it plugin for parsing GitBook-specific block tags
markdown-it-plugin-gitbook
is a plugin for markdown-it
that allows parsing GitBook-specific block tags. It currently supports the embed
block.
Install via npm:
npm install markdown-it-plugin-gitbook
Or install via yarn:
yarn add markdown-it-plugin-gitbook
const markdownIt = require('markdown-it');
const markdownItGitBook = require('markdown-it-plugin-gitbook');
const md = markdownIt();
md.use(markdownItGitBook, {
// embedUrls: { 'url': 'https://example.com/real/url' }
embedUrls: (url) => {
// Replace this to get real video player url instead of website url
// This function does not support async call as markdown-it not support async
return url
}
});
const markdown = `Your GitBook content with embed blocks`;
const result = md.render(markdown);
console.log(result);
The embed
block tag allows you to embed various content such as videos, audios, or other web pages within GitBook.
{% embed url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" %}
Replace the url
attribute with the URL of the content you want to embed.
We also support embed
block tag with caption, like this
{% embed url="https://www.bilibili.com/video/BV1w24y1U7fx" %}
Abort fireboom
{% endembed %}
If you want to contribute or make modifications to the markdown-it-plugin-gitbook
plugin, you can follow these steps for local development:
Clone the repository:
git clone https://github.com/your-username/markdown-it-plugin-gitbook.git
Install dependencies:
We use bun to develop this plugin, so install bun first, then
cd markdown-it-plugin-gitbook
bun i
Make your modifications and perform development.
Run tests:
bun test
Commit your changes and create a Pull Request.
This project is licensed under the MIT License.
FAQs
A markdown-it plugin to recognize gitbook blocks
The npm package markdown-it-plugin-gitbook receives a total of 4 weekly downloads. As such, markdown-it-plugin-gitbook popularity was classified as not popular.
We found that markdown-it-plugin-gitbook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.