Skip to content

Commit

Permalink
chore: doc for npm usage
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 8, 2020
1 parent 6b06eff commit 7b4dd16
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Markdown service in atom-ide-community packages (e.g. ide-datatip).

Just install.

### Developer Usage
### Developer Usage - As apm package

Put this in your `package.json`

Expand Down Expand Up @@ -41,3 +41,30 @@ export function consumeMarkdownRenderer(markdownService: MarkdownService) {
```js
let renderer: (markdownText: string, grammar: string) => Promise<string>
```

### Developer Usage - as npm package - ES6 modules
```
npm install --save atom-ide-markdown-service
```

and use it inside your package like this:

```js
import { render as renderer } from "atom-ide-markdown-service/lib/renderer"
```

in which renderer is a function with this type `renderer(markdownText: string, grammar: string) => Promise<string>`

### Developer Usage - as npm package - commonjs
```
npm install --save atom-ide-markdown-service
```

and use it inside your package like this:

```js
const { provideMarkdownRenderer } = require("atom-ide-markdown-service")
const { render } = provideMarkdownRenderer()
```

in which render is a function with this type `renderer(markdownText: string, grammar: string) => Promise<string>`

0 comments on commit 7b4dd16

Please sign in to comment.