@asyncapi/html-template

中文文档
3.5.6发布于 2026/03/15Apache-2.0构建来源已验证近 30 天下载 22.7万

HTML template for the AsyncAPI generator.

原始使用文档
文档目录4 节
  1. Usage
  2. Supported parameters
  3. Development
  4. Contributors ✨

AsyncAPI HTML Template

HTML template for the AsyncAPI Generator using an AsyncAPI React Component under the hood.


All Contributors

npm


Usage

Install AsyncAPI CLI

npm install -g @asyncapi/cli

Generate using CLI

If you use template version v1 or v2 with AsyncAPI Generator v1

asyncapi generate fromTemplate <asyncapi.yaml> @asyncapi/[email protected]

If you use template version v3 with AsyncAPI Generator v2

asyncapi generate fromTemplate <asyncapi.yaml> @asyncapi/[email protected] --use-new-generator

If you use template version v3.5 with AsyncAPI Generator v3 and AsyncAPI CLI v5

asyncapi generate fromTemplate <asyncapi.yaml> @asyncapi/[email protected]

You can replace <asyncapi.yaml> 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.

Supported parameters

NameDescriptionRequiredDefaultAllowed valuesExample
sidebarOrganizationDefines 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.NoundefinedbyTags, byTagsNoRootbyTagsNoRoot
baseHrefSets the base URL for links and forms.No/Any/docs
versionOverride the version of your application provided under info.version location in the specification file.NoVersion is taken from the spec file.Any (See Semver versioning)1.0.0
singleFileSet output into one html-file with styles and scripts inside.Nofalsetrue,falsetrue
outFilenameThe filename of the output file.Noindex.htmlAnyasyncapi.html
pdfGenerates output HTML as PDF.Nofalsetrue, falsetrue
pdfTimeoutTimeout (in ms) used to generate the PDF.No30000>=01000
faviconDefines the URL/Path used for the favicon.Noassets/asyncapi-favicon.icoAny valid favicon URL/Path."https://studio.asyncapi.com/favicon.ico"
configInline 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{ "show": { "sidebar": true }, "sidebar": { "showOperations": "byDefault" } }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.

Development

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.

  2. 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.

  3. Generate output with watcher enabled: npm run develop.

    NOTE: If your changes are not visible, this is maybe because the ag use the already installed html-template so you should use the --install option

    • run npm run develop:install
    • if command failed, delete the cached html-template module in your system and re-rerun the command
  4. Open HTML in your browser: open ./test/output/index.html.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

James Crowley
James Crowley

💻 🐛
Waleed Ashraf
Waleed Ashraf

💻 🐛
Julian Rabe
Julian Rabe

💻
Sebastián
Sebastián

⚠️ 💻
Gordeev Artem
Gordeev Artem

💻
Mitchell Sawatzky
Mitchell Sawatzky

💻
Talmiz Ahmed
Talmiz Ahmed

💻
Jürgen B.
Jürgen B.

🚇
Gabriel Claudino
Gabriel Claudino

💻
Barbara Szwarc
Barbara Szwarc

📖
Julian S.
Julian S.

💻
Ludovic Dussart
Ludovic Dussart

💻
David Weber
David Weber

💻
Maciej Urbańczyk
Maciej Urbańczyk

💻 ⚠️ 🐛 🚧 👀
Lukasz Gornicki
Lukasz Gornicki

🚧 💻 🐛 👀 ⚠️
Fran Méndez
Fran Méndez

🚧 💻 🐛 👀 ⚠️
Arya Gupta
Arya Gupta

📖
Tushar
Tushar

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

版本与发布记录

@asyncapi/html-template 共发布 130 个版本,首次发布于 2020/02/09;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.5.6latest2026/03/157 个月前
3.5.52026/02/128 个月前
3.5.42026/02/019 个月前
3.5.32026/02/019 个月前
3.5.22026/01/239 个月前
3.5.12026/01/229 个月前

关于 @asyncapi/html-template 的常见问题

@asyncapi/html-template 是什么?

HTML template for the AsyncAPI generator.

如何安装 @asyncapi/html-template?

在项目目录运行 npm install @asyncapi/html-template,或使用 pnpm add / yarn add / bun add。

@asyncapi/html-template 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/asyncapi__html-template 是否存在。

@asyncapi/html-template 可以商用吗?

@asyncapi/html-template 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@asyncapi/html-template 的下载量有多少?

根据 npm 官方下载统计,@asyncapi/html-template 在 2026/10/07 – 2026/11/05 这 30 天内被下载 227,427 次,日均约 7,581 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@asyncapi/html-template 还在维护吗?

最新版本 3.5.6 发布于 2026/03/15(7 个月前);至今共发布 130 个版本,其中过去 12 个月发布了 10 个;首次发布于 2020/02/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。