https://github.com/zooniverse/markdown-api
Provides Zooniverse flavored markdown via an API
https://github.com/zooniverse/markdown-api
utility
Last synced: 4 months ago
JSON representation
Provides Zooniverse flavored markdown via an API
- Host: GitHub
- URL: https://github.com/zooniverse/markdown-api
- Owner: zooniverse
- License: apache-2.0
- Created: 2015-08-17T18:07:03.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T17:54:44.000Z (over 2 years ago)
- Last Synced: 2024-04-15T23:07:30.110Z (about 2 years ago)
- Topics: utility
- Language: JavaScript
- Homepage:
- Size: 206 KB
- Stars: 0
- Watchers: 17
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-api
Provides [Zooniverse flavored markdown](https://github.com/zooniverse-ui/markdownz) via an API.
As of 2017-10, this is used by [TalkApi](https://github.com/zooniverse/talk-api) to render posts and comments when it sends them out in HTML emails. By making Markdown rendering into a microservice, we can make sure to use the same engine as we use in the frontend.
## Usage
`NODE_ENV=production node .`
*Setting `NODE_ENV` will set the host url to localhost, staging, or production
`/html` Accepts a JSON post and returns HTML
params:
- markdown: the markdown to be converted to HTML
- project (optional): the `/` of the project
## Examples
Without specifying the project:
```
curl -H "Accept: text/html" -H "Content-Type: application/json" -X POST -d '{"markdown": "Hey @parrish, look at **this** #agn: @vrooje/galaxy-zoo-bar-lengths^S465826! :D"}' http://localhost:2998/html
```
```html
```
Specifying the project:
```
curl -H "Accept: text/html" -H "Content-Type: application/json" -X POST -d '{"markdown": "Hey @parrish, look at **this** #agn: ^S465826! :D", "project": "vrooje/galaxy-zoo-bar-lengths"}' http://localhost:2998/html
```
```html
```