Miscellaneous

无闻 edited this page Aug 18, 2015 · 6 revisions

Miscellaneous

Markdown

Render an arbitrary Markdown document

POST /markdown
Parameters
Name Type Description
text string Required The Markdown text to render
mode string The rendering mode, can be empty or gfm. In gfm mode, Markdown will be rendered with repository context
context string The repository context. Only taken into account when rendering mode is gfm
Example
{
  "text": "Hello world gogits/gogs#1 **cool**, and #1!",
  "mode": "gfm",
  "context": "gogits/gogs"
}
Response
Status: 200 OK
Content-Type: text/html
<p>Hello world gogits/gogs#1 <strong>cool</strong>, and <a href="https://try.gogs.io:3000/gogits/gogs/issues/1" rel="nofollow">#1</a>!</p>

Render a Markdown document in raw mode

POST /markdown/raw
Parameters

The raw API takes a Markdown document as plaintext(text/plain) and renders it as plain Markdown without a repository context.

Response
Status: 200 OK
Content-Type: text/html
<p>Hello world gogits/gogs#1 <strong>cool</strong>, and #1!</p>
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.