HTML template for the AsyncAPI generator.
npm install @asyncapi/html-template
HTML template for the AsyncAPI Generator using an AsyncAPI React Component under the hood.
---

!npm
---
- Usage
- Supported parameters
- Development
- Contributors ✨
Install AsyncAPI CLI
``bash`
npm install -g @asyncapi/cli
Generate using CLI
> If you use template version v1 or v2 with AsyncAPI Generator v1
`bash`
asyncapi generate fromTemplate
> If you use template version v3 with AsyncAPI Generator v2
`bash`
asyncapi generate fromTemplate
> If you use template version v3.5 with AsyncAPI Generator v3 and AsyncAPI CLI v5
`bash`
asyncapi generate fromTemplate
You can replace with local path or URL pointing to any AsyncAPI document.
Look into Releases of this template to pick up the version you need. It is not recommended to always use the latest in production. Always use a specific version.
| Name | Description | Required | Default | Allowed values | Example |
|---|---|---|---|---|---|
| sidebarOrganization | Defines how the sidebar should be organized. Set its value to byTagsNoRoot to categorize operations by operations tags. Set its value to byTags when you have tags on a root level. These tags are used to model tags navigation and need to have the same tags in operations. | No | undefined | byTags, byTagsNoRoot | byTagsNoRoot |/
| baseHref | Sets the base URL for links and forms. | No | | Any | /docs |info.version
| version | Override the version of your application provided under location in the specification file. | No | Version is taken from the spec file. | Any (See Semver versioning) | 1.0.0 |false
| singleFile | Set output into one html-file with styles and scripts inside. | No | | true,false | true |index.html
| outFilename | The filename of the output file. | No | | Any | asyncapi.html |false
| pdf | Generates output HTML as PDF. | No | | true, false | true |assets/asyncapi-favicon.ico
| pdfTimeout | Timeout (in ms) used to generate the PDF. | No | 30000 | >=0 | 1000 |
| favicon | Defines the URL/Path used for the favicon. | No | | Any valid favicon URL/Path. | "https://studio.asyncapi.com/favicon.ico" |{ "show": { "sidebar": true }, "sidebar": { "showOperations": "byDefault" } }
| config | Inline stringified JSON or a path to a JSON file to override default React component config. The config override is merged with the default config using the JSON Merge Patch algorithm. | No | | JSON config for the React component | {"show":{"sidebar":false}} |
> NOTE: If you only generate an HTML website, set the environment variable PUPPETEER_SKIP_CHROMIUM_DOWNLOAD to true and the generator will skip downloading chromium.
The HTML-Template is built with an AsyncAPI React Component. For any changes regarding the styling of the page, rendering of the missing/existing elements, please contribute to the AsyncAPI React Component repository.
If you want make changes in template itself, please follow:
1. Make sure you have the latest generator installed: npm install -g @asyncapi/generator.
1. Modify the template or its helper functions.
>NOTE: If you have to modify the dummy.yml file to develop your features, open a PR with the changes in the asyncapi/generator repository.
1. Generate output with watcher enabled: npm run develop.ag
>NOTE: If your changes are not visible, this is maybe because the use the already installed html-template so you should use the --install optionnpm run develop:install
> * run html-template
> * if command failed, delete the cached module in your system and re-rerun the commandopen ./test/output/index.html`.
1. Open HTML in your browser:
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!