markdown-it
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
argparse | 2.0.1 | 38.81 kB | Python-2.0 | prod | |
entities | 3.0.1 | 45.15 kB | BSD-2-Clause | prod | |
linkify-it | 4.0.1 | 10.3 kB | MIT | prod | |
mdurl | 1.0.1 | 7.18 kB | MIT | prod | |
uc.micro | 1.0.6 | 2.99 kB | MIT | prod |
Markdown-it is a highly customizable, modern, pluggable markdown parser written in JavaScript. It follows the CommonMark spec, which provides a clear specification of markdown syntax. Additionally, the package includes syntax extensions like URL autolinking and typographer, along with many others through plugins.
Utilizing markdown-it is a fairly straightforward process. First, it must be installed via node.js using the following command: npm install markdown-it --save
. After installation, it can be used in a project as shown in the examples below:
For a Node.js environment:
var MarkdownIt = require('markdown-it'),
md = new MarkdownIt();
var result = md.render('# markdown-it rulezz!');
// Alternatively, using the "sugar" method:
var md = require('markdown-it')();
var result = md.render('# markdown-it rulezz!');
For a browser environment without AMD:
var md = window.markdownit();
var result = md.render('# markdown-it rulezz!');
The 'render' function is then called on the markdown-it instance to convert markdown text to HTML.
Markdown-it can also be used with presets and options, like enabling HTML tags in the source or automatic conversion of URL-like text to links. Plugins can also be loaded by calling '.use' on the markdown-it instance.
The documentation for markdown-it is available on the package's GitHub repository at https://github.com/markdown-it/markdown-it, where you can also find information on syntax extensions, API, and usage examples. There's also a separate API documentation available at https://markdown-it.github.io/markdown-it/. For plugin developers, there is development info provided within the 'docs' directory of the project repository. There, you can find information on creating and implementing plugins for markdown-it.