Render a markdown document as HTML
POST
/markdown
const url = 'https://gitea.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.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}
string
Mode
Mode to render (markdown, comment, wiki, file)
string
Text
Text markdown to render
string
Wiki
Is it a wiki page? (use mode=wiki instead)
Deprecated: true
boolean
Examplegenerated
{ "Context": "example", "Mode": "example", "Text": "example", "Wiki": true}Responses
Section titled “Responses”MarkdownRender is a rendered markdown document
Media typeapplication/json
string
Examplegenerated
exampleAPIValidationError is error format response related to input validation
Headers
Section titled “Headers”message
string
url
string