Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qazsato/openapi-generate-html
Generate standalone HTML from OpenAPI Specification. ๐
https://github.com/qazsato/openapi-generate-html
openapi redoc stoplight swagger
Last synced: 19 days ago
JSON representation
Generate standalone HTML from OpenAPI Specification. ๐
- Host: GitHub
- URL: https://github.com/qazsato/openapi-generate-html
- Owner: qazsato
- License: mit
- Created: 2024-10-24T23:09:40.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-12-01T01:31:10.000Z (about 2 months ago)
- Last Synced: 2025-01-01T08:47:56.097Z (24 days ago)
- Topics: openapi, redoc, stoplight, swagger
- Language: JavaScript
- Homepage:
- Size: 1.81 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openapi-generate-html
![test](https://github.com/qazsato/maplibre-gl-compass/actions/workflows/test.yml/badge.svg)
[![npm version](https://badge.fury.io/js/maplibre-gl-compass.svg)](https://badge.fury.io/js/maplibre-gl-compass)
[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)Generate standalone HTML from OpenAPI Specification.
## Feature
One of the key benefits of `openapi-generate-html` is its portability.
By generating a single, self-contained HTML file, all required assets (CSS, JavaScript, and OpenAPI data) are embedded directly in the document.
This makes it easy to:
1. **Share** : the file as a single, standalone document without additional dependencies.
2. **Hosting** : the file on any server or serve it locally, with no need for additional resources or configurations.
3. **Distribute** : the file via email or other methods, knowing that it will display consistently across environments.This portability makes `openapi-generate-html` ideal for situations where reliable, standalone documentation is required.
![Using openapi-generate-html](docs/images/mermaid.png)
## How to use
```bash
npx openapi-generate-html -i openapi.json
```Use dark theme ๐
```bash
npx openapi-generate-html -i openapi.json --theme=dark
```> [!NOTE]
> The dark theme is an experimental feature ๐งช## CLI Options
| command | default | description |
| ------------- | -------------- | --------------------------------------- |
| --input (-i) | | Input OpenAPI file path or URL |
| --output (-o) | "openapi.html" | Output HTML file name |
| --ui | "stoplight" | Choose UI (stoplight / swagger / redoc) |
| --theme | "light" | Choose Theme (light / dark) |
| --title | "OpenAPI Docs" | Title of the HTML page |
| --description | | Description of the HTML page |## UI Pattern
| | Light | Dark ๐งช |
| --------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| Stoplight | ![Stoplight Light](docs/images/stoplight_light.png)
`--ui=stoplight --theme=light`
[sample](https://qazsato.github.io/openapi-generate-html/examples/stoplight-light.html) | ![Stoplight Dark](docs/images/stoplight_dark.png)
`--ui=stoplight --theme=dark`
[sample](https://qazsato.github.io/openapi-generate-html/examples/stoplight-dark.html) |
| Swagger | ![Swagger Light](docs/images/swagger_light.png)
`--ui=swagger --theme=light`
[sample](https://qazsato.github.io/openapi-generate-html/examples/swagger-light.html) | ![Swagger Dark](docs/images/swagger_dark.png)
`--ui=swagger --theme=dark`
[sample](https://qazsato.github.io/openapi-generate-html/examples/swagger-dark.html) |
| Redoc | ![Redoc Light](docs/images/redoc_light.png)
`--ui=redoc --theme=light`
[sample](https://qazsato.github.io/openapi-generate-html/examples/redoc-light.html) | ![Redoc Dark](docs/images/redoc_dark.png)
`--ui=redoc --theme=dark`
[sample](https://qazsato.github.io/openapi-generate-html/examples/redoc-dark.html) |## License
This project is licensed under the terms of the [MIT license](./LICENSE).