0.9.0 • Published 3 years ago

@jcmellado/markdown-template v0.9.0

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

markdown-template

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.

Usage

Install the AsyncAPI Generator:

npm install -g @asyncapi/generator

Run the generator on your asyncapi.yml with the template:

ag ./asyncapi.yml @jcmellado/markdown-template -o ./docs

Check the AsyncAPI Generator Documentation to learn more about the available options.

Examples

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:

Parameters

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.

Markdown

ParameterDescription
outputFile 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

Sections

ParameterDescription
sectionsComma-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.serverComma-separated list of subsections to be included in the servers section.Default: variables,security,bindingsExample: -p sections.server=variables
sections.channelsComma-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.messagesComma-separated list of subsections to be included in the messages section.Default: payload,headers,correlationId,bindings,tagsExample: -p sections.messages=headers,payload

Table of Contents

ParameterDescription
toc.headingLevelNumber of heading levels to show in the table of contents.Default: 0Allowed values: 0, 1, or 2.Example: -p toc.headingLevel=2

Slate/shins

ParameterDescription
slate.enabledEnables 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.themeName of the syntax-highlighter theme to use.Default: darkulaExample: -p slate.theme=monokai
slate.searchEnabledEnables the search option in the table of contents.Default: trueExample: -p slate.searchEnabled=false
slate.headingLevelNumber of heading levels to show in the table of contents.Default: 2Currently only supported by shins.Example: -p slate.headingLevel=3
slate.languagesComma-separated list of languages to add as tabs.Default: nullExample: -p slate.languages="json: JSON"
slate.includesComma-separated list of files to include at the bottom of the content.Default: nullExample: -p slate.includes=/extra/info
slate.footersComma-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"
0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.3.0

4 years ago

0.4.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago