@angeeks/md
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ngk-markdown aka ngk-md

Build Status npm version

Another markdown wrapper component for Angular, build with simplicity and clarity in mind. Note that by default, it use marked.js as the parser (that's why this project called), see below to use your own parser.

Installation

npm i -P @angeeks/md

Usage

// app.module.ts
+import { MdModule } from '@angeeks/md';

@NgModule({
  imports: [
+   MdModule
  ]
})
export class AppModule {}
<!-- app.component.html -->
<ngk-md [src]='src'></ngk-md>
<!-- or if you type fast -->
<ngk-markdown [src]='src'></ngk-markdown>

Replace parser

// app.module.ts
+import { mdParser, Parser } from '@angeeks/md';

+export function yourMarkdownParser(): Parser {
+  return { parse };
+}

@NgModule({
  imports: [
    MdModule
  ],
  providers: [
+   { provide: mdParser, useFactory: yourMarkdownParser }
  ]
}
})
export class AppModule {}

Package Sidebar

Install

npm i @angeeks/md

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

56.4 kB

Total Files

29

Last publish

Collaborators

  • speed.of.light