https://github.com/agregoreweb/api-render-markdown
https://github.com/agregoreweb/api-render-markdown
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/agregoreweb/api-render-markdown
- Owner: AgregoreWeb
- License: agpl-3.0
- Created: 2020-10-28T14:02:57.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-16T12:43:57.000Z (over 5 years ago)
- Last Synced: 2025-01-19T08:15:28.969Z (over 1 year ago)
- Language: JavaScript
- Size: 887 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# api-render-markdown
API for rendering markdown, made for use in Agregore
## Usage
This API is designed for use in vanilla javascript modules.
For imports you will need two things:
Key: `bfa59937d1c74437f015096ab07ef04c30c051ad5a9d4bdf9d01abb19ca97f1c`
> Note: This is a temporary drive and is due to change. Currently this is keyed by @KyGost
Version: `962`
> Note: This may be out of date and is also due to change.
### Importing main API
This includes highlighting and commonmark compliant markdown rendering. Uses [markdown-it](https://github.com/markdown-it/markdown-it).
```javascript
import Markdown from "hyper://
+/index.js";
```
### Importing plugins
```javascript
import from 'hyper://
+/plugins/.js'
Markdown.use(...)
```
## Plugins
This API has a few plugins to achieve a few objectives.
### Hider
**Name**: `hider`
**Achieves**: Hiding spoilers/warnings
**Uses**: [`markdown-it-container`](https://github.com/markdown-it/markdown-it-container)
**Markdown usage**:
```markdown
:::
Collapsed words
:::
::: Spoiler: The secrets lie within!
Collapsed words
:::
```
### IFrame
**Name**: `iframe`
**Achieves**: Embedding iframes
**Uses**: [`markdown-it-iframe`](https://github.com/rjriel/markdown-it-iframe)
**Markdown usage**:
```markdown
/i/
```
**Notes**: Will render at 100% width
### Todo
**Name**: `Todo`
**Achieves**: Adds Github-like todo lists
**Uses**: [`markdown-it-todo`](https://github.com/dexfire/markdown-it-todo)
**Markdown usage**:
```markdown
- [ ] Unchecked
- [x] Checked
```