npm i --save @dev4ndy/markdown
- Version: 1.0.0
- GitHub:
- NPM: https://www.npmjs.com/package/%40dev4ndy%2Fmarkdown
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
@dev4ndy/markdown
ns plugin add @dev4ndy/markdown
A plugin for native markdown rendering.
Completely based on this code code.
Note: All credit to @flore2003, what we did here was to start using the plugin template (plugin-seed), update it and make it work with NS8... This plugin has only been tested on NS8.
Usage
Angular
- Register the element in apps module
registerElement("Markdown", () => require("@dev4ndy/markdown").Markdown);
@NgModule({
...
});
- Now you can use it in you template
<Markdown [markdown]="'_This_ should be **bold**!'"></Markdown>
Vue
- Register the element in the vue environment
Vue.registerElement( 'Markdown', () => require("@dev4ndy/markdown").Markdown )
You need to add xmlns:mv="nativescript-markdown-view"
to your page tag, and then simply use <mv:Markdown/>
in order to add the widget to your page.
<!-- test-page.xml -->
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" xmlns:mv="markdown">
<StackLayout class="p-20">
<mv:Markdown markdown="_This_ should be **bold**!" />
</StackLayout>
</Page>
API
Property | Default | Description |
---|---|---|
markdown | "" | The markdown to be rendered on screen |
License
Apache License Version 2.0