A simple TypeScript library that formats Markdown and returns a formatted HTML.
const { html, links } = formatMarkdown(mdFile)
| Option | Description |
|---|---|
formatMarkdown(mdFile, { keepSections: ["Features"] }) |
keeps only specified section |
formatMarkdown(mdFile, { excludeSections: ["License"] }) |
excludes a section |
formatMarkdown(mdFile, { gfm: true }) |
applies GitHub-Flavored Markdown |
formatMarkdown(mdFile, { useImgAltText: true }) |
replaces images with alt text |
formatMarkdown(mdFile, { maxChars: 50 }) |
truncates output when maxChars is set |
formatMarkdown(mdFile, { removeImages: true }) |
removes images |
$ npm install html-from-md- Fork this repo
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request