npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@opendevise/antora-swagger-ui-extension

v1.0.0

Published

An Antora extension that integrates the Swagger UI (interactive API explorer) into an Antora site through AsciiDoc syntax extensions.

Readme

Antora Swagger UI Extension

An Antora extension that integrates the Swagger UI (interactive API explorer) into an Antora site. It does so by providing and registering an AsciiDoc swagger-ui block macro that adds an API explorer for an OpenAPI specification to a page. The Swagger UI dynamically generates interactive documentation for an API defined in the OpenAPI Specification format.

Prerequisites

In order to use this extension, you must be using Node.js 18 and Antora 3.1.0. The following instructions assume you’ve already set up an Antora playbook file (i.e., antora-playbook.yml) to build your site.

To learn about using extensions with Antora, see the Antora extension documentation.

Install

Use the following command to install the extension into your playbook project:

$ npm i @opendevise/antora-swagger-ui-extension

Register

Open your Antora playbook file and register the extension as an entry in the antora.extensions key. Create this key if it doesn’t yet exist in your playbook file.

antora-playbook.yml

antora:
  extensions:
  - '@opendevise/antora-swagger-ui-extension'

This extension automatically registers the swagger-ui block macro extension with Asciidoctor. The extension also patches the head-styles.hbs and footer-scripts.hbs UI templates to load the Swagger UI assets (CSS and JS) as needed.

Usage

The Swagger UI will automatically be loaded on any page that uses the swagger-ui AsciiDoc block macro. Any number of swagger-ui block macros can be used per page.

The target of the macro is an OpenAPI specification file that can be referenced using an Antora resource reference. The specification file must be in either JSON or YAML format and must have the suitable file extension (e.g., .json, .yaml, etc). The file can be resolved from the attachment, example, or partial families. For example:

swagger-ui::attachment$petstore.json[]

or

swagger-ui::api:attachment$specs/petstore.yaml[]

If the file extension is absent or not recognized, the JSON format is assumed.

If you don’t want the specification file to be published, you can make it hidden by prefixing it with an underscore. For example:

swagger-ui::attachment$_petstore.json[]

Alternately, the target of the macro can be a URL. For example:

swagger-ui::https://petstore3.swagger.io/api/v3/openapi.yaml[]

When the target is a URL, that URL is passed directly to the Swagger UI to load. In this case, a file extension is not required (as long as the server still serves the file).

Configure

The swagger-ui block macro supports the following attributes:

  • id
    Sets the ID of the insertion slot element in which to insert the explorer. By default, the ID swagger-ui-<n> is used, where <n> is managed as the 1-based index of the explorer on the page. You can use the swagger-ui-number AsciiDoc document attribute to control the start index (e.g., :swagger-ui-number: -1).
  • docExpansion
    Controls the docExpansion setting of the explorer. Value values are full, list, and none. The default value is list.

Copyright and License

Copyright (C) 2024-present by OpenDevise Inc. and the individual contributors of this project.

Use of this software is granted under the terms of the Mozilla Public License Version 2.0 (MPL-2.0).