Markdown template for the AsyncAPI Generator.
The template converts an AsyncAPI document into a Markdown document.
The generated Markdown documents can be used to create static HTML documentation websites with Slate or shins.
Install the AsyncAPI Generator:
npm install -g @asyncapi/generatorRun the generator on your asyncapi.yml with the template:
ag ./asyncapi.yml @jcmellado/markdown-template -o ./docsCheck the AsyncAPI Generator Documentation to learn more about the available options.
AsyncAPI specification of fictional API service:
Server, channel, operation and message bindings for all the supported protocols:
Security schemes for all the supported protocols:
Simple and complex schemas:
The AsyncAPI Generator allows to pass additional parameters to the template with the -p name=value option.
Example:
ag ./asyncapi.yml @jcmellado/markdown-template -o ./docs -p slate.enabled=true -p slate.languages="json: JSON,Rust"The following sections describe the available parameters.
| Parameter | Description |
|---|---|
| output | File name for the output file. Default: asyncapi.mdThe -o parameter of the generator specifies the output directory, the -p output parameter of the template specifies the output filename.Example: -o ./docs -p output=api-1.0.0.md |
| Parameter | Description |
|---|---|
| sections | Comma-separated list of sections to be included in the Markdown document. Default: servers,channels,messages,security,tags,license,termsOfService,contactSections are included in the Markdown document in the same order that they appear in the list. Only the listed sections will be included. Example: -p sections=channels,messages,servers,license |
| sections.server | Comma-separated list of subsections to be included in the servers section. Default: variables,security,bindingsExample: -p sections.server=variables |
| sections.channels | Comma-separated list of subsections to be included in the channels section. Default: parameters,bindings,messages,publish,subscribe,operation.bindings,operation.tagsExample: -p sections.channels=parameters,subscribe,publish,messages |
| sections.messages | Comma-separated list of subsections to be included in the messages section. Default: payload,headers,correlationId,bindings,tagsExample: -p sections.messages=headers,payload |
| Parameter | Description |
|---|---|
| toc.headingLevel | Number of heading levels to show in the table of contents. Default: 0Allowed values: 0, 1, or 2.Example: -p toc.headingLevel=2 |
| Parameter | Description |
|---|---|
| slate.enabled | Enables the output of the Slate header in the Markdown document. Default: falseThe header contains some parameters used by Slate to build the HTML documentation. Example: -p slate.enabled=true |
| slate.theme | Name of the syntax-highlighter theme to use. Default: darkulaExample: -p slate.theme=monokai |
| slate.searchEnabled | Enables the search option in the table of contents. Default: trueExample: -p slate.searchEnabled=false |
| slate.headingLevel | Number of heading levels to show in the table of contents. Default: 2Currently only supported by shins. Example: -p slate.headingLevel=3 |
| slate.languages | Comma-separated list of languages to add as tabs. Default: nullExample: -p slate.languages="json: JSON" |
| slate.includes | Comma-separated list of files to include at the bottom of the content. Default: nullExample: -p slate.includes=/extra/info |
| slate.footers | Comma-separated list of texts to add at the bottom of the table of contents. Default: nullExample: -p slate.footers="Copyright (c) 2020 www.example.com" |