Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atom-community/atom-ide-markdown-service
A service component offering markdown rendering
https://github.com/atom-community/atom-ide-markdown-service
atom atom-package hacktoberfest markdown provider
Last synced: about 2 months ago
JSON representation
A service component offering markdown rendering
- Host: GitHub
- URL: https://github.com/atom-community/atom-ide-markdown-service
- Owner: atom-community
- License: other
- Created: 2019-03-17T11:53:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-16T21:20:19.000Z (about 1 year ago)
- Last Synced: 2024-11-11T20:33:13.746Z (2 months ago)
- Topics: atom, atom-package, hacktoberfest, markdown, provider
- Language: TypeScript
- Homepage:
- Size: 1.07 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# atom-ide-markdown-service package
Markdown service in atom-ide-community packages (e.g. ide-datatip).
### Usage
Just install.
### Developer Usage - As apm package
Put this in your `package.json`
```json
"consumedServices": {
"markdown-renderer": {
"versions": {
"1.0.0": "consumeMarkdownRenderer"
}
}
}
```and use it inside your package like this:
```js
import type {MarkdownService} from "atom-ide-base"let render: MarkdownService["render"]
/**
* retrieves a reference to the markdown rendering service that should be used
* @param {MarkdownService} markdownService the service for rendering markdown text
*/
export function consumeMarkdownRenderer(markdownService: MarkdownService) {
render = markdownService.render
}
````render` is a function with this type:
```js
let render: (markdownText: string, grammar: string) => Promise
```### 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 } from "atom-ide-markdown-service/modules/renderer"
```in which renderer is a function with this type `render(markdownText: string, grammar: string) => Promise`
### Developer Usage - as npm package - commonjs
```
npm install --save atom-ide-markdown-service
```and use it inside your package like this:
```js
const { render } = require("atom-ide-markdown-service/dist/renderer")
```in which render is a function with this type `renderer(markdownText: string, grammar: string) => Promise`