markdown2html-less
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

markdown2html-less

GitHub Status

Build Status Coverage Status MIT license

NPM Status

Build Status Code Climate Dependency Status Issue Stats Issue Stats Conventional Commits

A parser of Markdown and a render to html, written in typescript, that aims for preview-code , which is published as an extension on Visual Studio Code to preview Markdown, ReStructured Text, HTML, Jade, Pug or Mermaid files, Image's URI or CSS while editing them in VSCode.

It is built on top of markdown-it, a CommonMark markdown parser. You can use markdown2html-less:

markdown2html-less is the thing that parses package READMEs on http://www.npmjs.com. If you see a markdown parsing bug there, file an issue here!

[programmatically in NodeJS]: #Using this module in other modules

README

An extension to preview Markdown, ReStructured Text, HTML, Jade, Pug or Mermaid files, Image's URI or CSS while editing them in VSCode

Installation

npm install markdown2html-less --save

Using this module in other modules

Here is a quick example of how this module can be used in other modules. The TypeScript Module Resolution Logic makes it quite easy. The file src/index.ts is a barrel that re-exports selected exports from other files. The package.json file contains main attribute that points to the generated lib/index.js file and typings attribute that points to the generated lib/index.d.ts file.

If you are planning to have code in multiple files (which is quite natural for a NodeJS module) that users can import, make sure you update src/index.ts file appropriately.

Now assuming you have published this amazing module to npm with the name markdown2html-less, and installed it in the module in which you need it -

  • To use the Markdown2HtmlLess class in a TypeScript file -
import { Markdown2HtmlLess } from "markdown2html-less";
const markdownContent = "";
const markdown2HtmlLess = new Markdown2HtmlLess();
markdown2HtmlLess.markdown2html(markdownContent);
  • To use the Markdown2HtmlLess class in a JavaScript file -
const Markdown2HtmlLess = require('markdown2html-less').Markdown2HtmlLess;
const markdownContent = "";

const markdown2HtmlLess = new Markdown2HtmlLess();
markdown2HtmlLess.markdown2html(markdownContent);

Setting travis and coveralls badges

  1. Sign in to travis and activate the build for your project.
  2. Sign in to coveralls and activate the build for your project.
  3. Replace searKing/markdown2html-less with your repo details like: "ospatil/generator-node-typescript".

Tests

npm install
npm test

Thanks to

Package Sidebar

Install

npm i markdown2html-less

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

30.5 kB

Total Files

15

Last publish

Collaborators

  • searking