Render a markdown document as HTML
POST
/markdown
const url = 'https://gitea.example.com/api/v1/markdown';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"Context":"example","Mode":"example","Text":"example","Wiki":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://gitea.example.com/api/v1/markdown \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "Context": "example", "Mode": "example", "Text": "example", "Wiki": true }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
MarkdownOption markdown options
object
Context
URL path for rendering issue, media and file links Expected format: /subpath/{user}/{repo}/src/{branch, commit, tag}/{identifier/path}/{file/dir}
in: body
string
Mode
Mode to render (comment, gfm, markdown)
in: body
string
Text
Text markdown to render
in: body
string
Wiki
Is it a wiki page ?
in: body
boolean
Examplegenerated
{ "Context": "example", "Mode": "example", "Text": "example", "Wiki": true}Responses
Section titled “Responses”MarkdownRender is a rendered markdown document
Media typetext/html
string
APIValidationError is error format response related to input validation
Media typetext/html
Headers
Section titled “Headers”message
string
url
string