Sage-Bionetworks/markdown-it-synapse-server

Name: markdown-it-synapse-server

Owner: Sage Bionetworks

Description: Node.js based markdown-it web service - designed to be used for server-side Synapse markdown processing.

Created: 2016-05-05 16:35:09.0

Updated: 2016-05-05 17:02:51.0

Pushed: 2017-09-18 16:53:43.0

Homepage: null

Size: 24

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

markdown-it-synapse-server

Node.js based web service to process Synapse markdown to html.

Installation

node.js:

m install
Run
start
How to use
m start
rkdown-it-synapse-server@1.0.0 start /Users/jayhodgson/markdown-it-synapse-server
de ./bin/www
POST json to /markdown2html
rl -d '{"markdown":"## a heading"}' -H "Content-Type: application/json" http://localhost:3000/markdown2html
sult":"<h2 toc=\"true\" style=\"word-wrap: break-word; margin-top: 10px; font-weight: 200; color: #000000; font-size: 32px; line-height: 40px; margin-bottom: 10px;\">a heading</h2>\n"}
Set output format to “html”, “plain”, or leave as default (Synapse styled html)
rl -d '{"markdown":"## a heading", "output":"html"}' -H "Content-Type: application/json" http://localhost:3000/markdown2html
sult":"<h2 toc=\"true\">a heading</h2>\n"}

rl -d '{"markdown":"## a heading", "output":"plain"}' -H "Content-Type: application/json" http://localhost:3000/markdown2html
sult":"A HEADING"}
Set base url for automatically linked Synapse IDs, or leave blank for relative path.
rl -d '{"markdown":"syn12345", "output":"html", "baseURL":"https://www.synapse.org/"}' -H "Content-Type: application/json" http://localhost:3000/markdown2html
sult":"<p><a href=\"https://www.synapse.org/#!Synapse:syn12345\" target=\"_blank\">syn12345</a></p>\n"}

rl -d '{"markdown":"syn12345", "output":"html"}' -H "Content-Type: application/json" http://localhost:3000/markdown2html
sult":"<p><a href=\"#!Synapse:syn12345\">syn12345</a></p>\n"}

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.