Sorry, this app only provides REST APIs.
See the documentation below for the usage.

Qiita Markdown Server

Deploy to Heroku

A REST API Markdown Server powered by Qiita::Markdown


Qiita Markdown Server provides API to render Markdown texts posted via HTTP and responds with rendered HTML elements.
APIs are (mostly) compatible with GitHub Markdown API.

API Reference

1. POST /markdown

This API renders Markdown text in the text attribute. Request parameter must be a JSON object.


Name Type Description
text string The Markdown text to render (Required)
options hash Context options (see qiita-markdown#context for details)


$ curl -X POST -H 'Content-Type: application/json' -d '
  "text": "Hello my twitter ID is @_nao8 :smile:",
  "options": {
    "asset_root": "",
    "base_url": ""

Response Header

HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8
Content-Length: 276
Access-Control-Allow-Origin: *

Response Body

<p>Hello my twitter ID is <a href="" class="user-mention" title="_nao8">@_nao8</a> <img class="emoji" title=":smile:" alt=":smile:" src="" height="20" width="20" align="absmiddle"></p>

2. POST /markdown/raw

The raw API is for plaintext (text/plain or text/x-markdown) and renders whole content body.


$ curl -X POST -H 'Content-Type: text/plain' -d '
# Task List
- [x] task1
- [ ] task2

Response Header

HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8
Content-Length: 342
Access-Control-Allow-Origin: *

Response Body

<span id="task-list" class="fragment"></span><a href="#task-list"><i class="fa fa-link"></i></a>Task List</h1>

<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" checked disabled>task1</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled>task2</li>

Installation and Usage

1. Clone the source

$ git clone

2. Install dependencies

$ cd qiita-markdown-server
$ bundle install

3. Install Emoji (optional)

If you want to serve assets on a same server, you can install Emoji images with gemoji.
Run following Rake task to copy images into public/images/emoji.

$ bundle exec rake -f $(gem contents gemoji | grep 'emoji\.rake') emoji

Asset host can be set with environment variable ASSET_ROOT.

4. Set environment variables (optional)

export RACK_ENV=production
export HOSTNAME=          # FQDN, required
export WEB_CONCURRENCY=1                       # worker processes, default: 2
export ASSET_ROOT= # url for emoji images
export BASE_URL=            # url for @username

You can also use dotenv if you are going to run app with foreman.

5. Start Application

$ bundle exec rackup -s Rhebok -O ConfigFile=config/rhebok.rb -p 8080
$ PORT=8080 foreman start

Running with Docker

Latest Docker image is available at nkwhr/qiita-markdown-server


$ docker run \
    --rm \
    --env WEB_CONCURRENCY=$(nproc) \
    --env ASSET_ROOT= \
    -p 8080:8080 \

See Also