0.0.1 • Published 6 years ago

@pdestrais/mdtohtml v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Built With Stencil

Markdown To HTML Component

This stencil markdowntohtml component will render a markdown text to HTML. It is based on marked.

Installation

Stencil components can be integrated with many javascript frameworks (angular, react, ...) or with javascript native.. More information on this here

Usage

Simply include the component into html code like any other HTML tag. Use the 'content' attribute to pass the markdown text to be rendered into HTML. Example :

<md-to-html content="# Markdown Component

This stencil markdown component will render a markdown text to HTML. It is based on [marked](https://marked.js.org/#/README.md)."></md-to-html>

Using this component

Script tag

  • Publish to NPM
  • Put a script tag similar to this <script src='https://unpkg.com/markdowntohtml-component@0.0.1/dist/markdowntohtmlcomponent.js'></script> in the head of your index.html

Node Modules

  • Run npm install markdown-component --save
  • Put a script tag similar to this <script src='node_modules/markdowntohtml-component/dist/markdowntohtmlcomponent.js'></script> in the head of your index.html

In a stencil-starter app

  • Run npm install markdowntohtml-component --save
  • Add an import to the npm packages import markdowntohtml-component;

Use in template

You can then use the element anywhere in your template, JSX, html etc Simply include the component into html code like any other HTML tag. Use the 'content' attribute to pass the markdown text to be rendered into HTML.

Example :

<markdown-component content="# Markdown Component

This stencil markdown component will render a markdown text to HTML. It is based on [marked](https://marked.js.org/#/README.md)."></markdown-component>