Angular 2 Markdown
Notice: This package is depricated use https://www.npmjs.com/package/ngx-md instead.
Table of contents
angular2-markdown contains MarkdownModule for Angular.
npm install angular2-markdown --save
yarn add angular2-markdown
How to use it with:
angular-cli— please refer to Getting started with
angular-seed— please refer to Getting started with
system.js(and Angular 2 QuickStart) — please checkout sample repository
webpack— you can view our demo page source code
plnkr— sample available here
rollup— please refer to How to use
angular2-markdownin Angular 2 with
Usage & Demo
Main source of API documentation and usage scenarios is available at https://dimpu.github.io/angular2-markdown/.
Is very welcome! And remember, contribution is not only PRs and code, but any help with docs or helping other developers to solve issues are very appreciated! Thanks in advance!
If you want syntax highlighting you need to import the prism css file.
Alternative 1: Import from cdn
Alternative 2: Download the css file (or copy it from
node_modules/prismjs/themes/, place it somewhere in your src folder and import
Alternative 3: Include the prism css file in your sass style file
### your markdown code<!-- or use angular component -->### your markdown code<!-- to load from remote URL --><!-- load remote source code with auto syntax highlighting --><!-- load remote source code from url stored in variable(see additional details about variable binding in the next section) -->
Now, with >1.4.x you can bind a variable to the
markdown component. To do so:
Marked can be customized/extended by accessing the renderer from the MarkdownService:
See marked documentation for all renderer extension points.
You can find a working example inside the
To serve it locally, run:
git clone https://github.com/dimpu/angular2-markdown.gitnpm inpm run demo.serve
- Variable binding
- Code refactor
- Write more unit tests
- Angular 5 support
- Module configuration for markdown settings
- Module configuration for prismjs settings
The following is a list of all the people that have helped build this project. Thanks for your contributions!