0.0.1 • Published 6 years ago

@angeeks/md v0.0.1

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

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 {}