Skip to content

A simple TypeScript library that formats Markdown and returns a formatted HTML.

Notifications You must be signed in to change notification settings

ruveydayilmaz/html-from-md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-from-md

A simple TypeScript library that formats Markdown and returns a formatted HTML.

Usage

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

Installation

$ npm install html-from-md

Contributing

  1. Fork this repo
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

About

A simple TypeScript library that formats Markdown and returns a formatted HTML.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published