• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A CLI tool to transform Swagger/OpenAPI/AsyncAPI docs to beautiful HTML pages via Shins/Widdershins.

api2html

A CLI tool to transform Swagger/OpenAPI/AsyncAPI docs to beautiful HTML pages via Shins/Widdershins.

You can find an example generated page at http://tobilg.github.io/api2html/petstore/.

Installation

To install api2html globally, use

$ npm i api2html -g

You can also install it to use as devDependencies, and use it locally via a npm run task in your package.json:

$ npm i api2html --save-dev

Usage in package.json:

{
  "scripts": {
    "api-docs": "node_modules/.bin/api2html -o docs/api.html -l shell,javascript--nodejs docs/openapi/api.yml"
  }
}

Usage

Available commands

$ api2html --help 
Usage: api2html [options] <sourcePath>
  
  Options:
    -V, --version                   output the version number
    -r, --resolve <source>          resolve external dependencies, source should be a url or a path
    -o, --out <outputPath>          output path for the resulting HTML document
    -t, --theme <themeName>         theme to use (see https://highlightjs.org/static/demo/ for a list)
    -c, --customLogo <logoPath>     use custom logo at the respective path
    -u, --customLogoUrl <logoURL>   url for the custom logo to point to
    -C, --customCss                 use custom css
    -P, --customCssPath <cssPath>   use custom css file
    -i, --includes <includesList>   comma-separated list of files to include
    -l, --languages <languageList>  comma-separated list of languages to use for the language tabs (out of shell, http, javascript, javascript--nodejs, ruby, python, java, go)
    -s, --search                    enable search
    -S, --summary                   use summary instead of operationId for TOC
    -b, --omitBody                  Omit top-level fake body parameter object
    -R, --raw                       Show raw schemas in samples, not example values
    -h, --help                      output usage information

Usage examples

Render OpenAPI v3 file as HTML

This will render the api.yml file in the current directory as myapi.html file in the current directory.

$ api2html -o myapi.html myapi.yml

Use custom logo

This will render the api.yml file in the current directory as myapi.html file in the same directory, and use the custom logo mylogo.png.

$ api2html -o myapi.html -c mylogo.png myapi.yml

Define which language examples should be generated

This will render the api.yml file in the current directory as myapi.html file in the same directory, and use go and javascript examples.

$ api2html -o myapi.html -l go,javascript myapi.yml

Use different syntax highlighter

This will render the api.yml file in the current directory as myapi.html file in the same directory, and use go and javascript examples, as well as a different syntax higlighter from highlight.js.

$ api2html -o myapi.html -l go,javascript -t arta myapi.yml

Resolve external dependencies

If you add refs to external files in your source file, you can enable them by using -r <source>. The following command will resolve all your relative imports from the current directory.

$ api2html -o myapi.html -r ./ myapi.yml

More Repositories

1

facebook-events-by-location

[DEPRECATED] A Express.js-based webservice to get public Facebook events by location
JavaScript
332
star
2

lsh

Run interactive shell commands on AWS Lambda
JavaScript
141
star
3

facebook-events-by-location-core

[DEPRECATED] Search Facebook events by location and proximity.
JavaScript
139
star
4

aws-fullstack-website

Deploy your fullstack websites without all the hassle on AWS with CloudFront, S3, ACM, Route53, API Gateway and Lambda via Serverless.
JavaScript
137
star
5

serverless-aws-static-websites

Deploy your static websites without all the hassle on AWS with CloudFront, S3, ACM and Route53 via Serverless
JavaScript
128
star
6

python-lambda-layer-builder

A build tool for creating optimized Python AWS Lambda layers
Shell
119
star
7

mesos-framework

A wrapper around the Mesos HTTP APIs for Schedulers and Executors. Write your Mesos framework in pure JavaScript!
JavaScript
61
star
8

aws-edge-locations

List of AWS edge location code prefixes
JavaScript
44
star
9

marathon-slack

Integration for Marathon's Event Bus with Slack
JavaScript
42
star
10

netlify-functions-landingpage

A serverless-less landing page project on Netlify, including a Mailchimp mailing list signup via functions.
JavaScript
35
star
11

docker-zookeeper-webui

Docker image for using `zk-web` as ZooKeeper Web UI
Shell
32
star
12

duckdb-nodejs-layer

Packaging DuckDB for Lambda functions. Example application: https://github.com/tobilg/serverless-duckdb
Python
22
star
13

docker-mongodb-marathon

[DEPRECATED] Please use https://github.com/tobilg/dcos-commons/tree/mongodb-replicaset/frameworks/mongodb-replicaset
JavaScript
18
star
14

mesos-envoy-sds

An Envoy Service Discovery Service for Mesos
JavaScript
17
star
15

serverless-cubejs

Serverless Cube.js backend infrastructure on AWS
JavaScript
17
star
16

mesos-framework-boilerplate

A boilerplate for developing Mesos frameworks with JavaScript
JavaScript
16
star
17

docker-livy

A Docker image for Livy, the REST Spark Server
Shell
15
star
18

gitlab-ci-runner-marathon

A customized Docker image for running scalable GitLab CI runners on Marathon
Shell
15
star
19

aws-lambda-api-call-recorder

A recorder of AWS API calls for Lambda functions
JavaScript
14
star
20

serverless-duckdb

An example of how to run DuckDB on AWS Lambda & API Gateway.
JavaScript
13
star
21

docker-predictionio

Docker container for the latest prediction.io version with most recent dependencies
Shell
12
star
22

mesos-js-framework

[DEPRECATED] Use https://github.com/tobilg/mesos-framework instead
JavaScript
8
star
23

docker-mesos-dns

A lightweight Mesos DNS Docker image. Currently based on v0.5.2
Shell
7
star
24

serverless-parquet-repartitioner

Lambda function to serverlessly repartition parquet files in S3
JavaScript
7
star
25

cfn-cur-report-definition

A custom CloudFormation resource for Cost and Usage Report ReportDefinitions
JavaScript
7
star
26

mesosdns-resolver

A bash script to resolve Mesos DNS SRV records to actual host:port endpoints
Shell
7
star
27

tile38-lambda-layer

A AWS Lambda layer for Tile38
Shell
6
star
28

docker-kafka-marathon

[DEPRECATED] A Docker image of Apache Kafka to be run on a Mesos cluster via Marathon
Shell
6
star
29

marathon-event-bus-client

A Node.js package for listening to the Marathon Event Bus
JavaScript
6
star
30

ceph-admin-ops-client

A Node.js wrapper for Ceph Object Gateway's Admin Ops API
JavaScript
6
star
31

nodejs-lambda-layer-builder

Build custom AWS Lambda layers for Node
Shell
6
star
32

buffered-queue

A simple to use buffering queue (no dependencies) which flexibly buffers objects, strings, integers etc. until either a maximum size is reached, or an interval has come to an end.
JavaScript
6
star
33

mesos-operator-api-client

Node.js client for the Mesos Operator HTTP API events (see http://mesos.apache.org/documentation/latest/operator-http-api/)
JavaScript
6
star
34

docker-mini-webserver

Provides a server (via Express.js) to expose static files from the Docker host via HTTP
JavaScript
5
star
35

npm-stats-cli

A command line interface for npm statistics and insights
JavaScript
5
star
36

cfn-cognito-resource-server

A custom CloudFormation resource for Cognito Resource Servers
JavaScript
4
star
37

global-reverse-proxy

Building a global reverse proxy with on-demand SSL support on AWS
JavaScript
3
star
38

public-cloud-provider-ip-ranges

Unified datasets for public cloud provider IP ranges. Providers include AWS, Azure, CloudFlare, DigitalOcean, Fastly, Google Cloud and Oracle Cloud.
Shell
3
star
39

docker-spark-jobserver

A Docker container for Spark Jobserver
Shell
3
star
40

clair-dcos

A Docker image for running Clair on DC/OS
Dockerfile
2
star
41

docker-mesos-spark-shell

A docker image for creating a Spark shell on a Mesos cluster
Shell
2
star
42

docker-expose-socket

Docker image for exposing the Docker UNIX socket via TCP without having to reconfigure the daemon itself.
Shell
2
star
43

serverless-twitter-bot

An example application which tweets GitHub repo releases
JavaScript
1
star
44

GeoLocateURL

Node.js project to get geo information from an URL.
JavaScript
1
star
45

mesosdns-cli

A Node.js-based CLI for querying Mesos DNS service names
JavaScript
1
star
46

minio-dcos

Example on how to launch Minio in distributed mode (4 instances) on DC/OS
Shell
1
star
47

marathon-event-proxy

A proxy for the Server Sent Events endpoint of Marathon's Event Bus
JavaScript
1
star
48

docker-chronos

A Docker container for the latest Mesosphere Chronos version
Shell
1
star
49

nextjs-duckdb

Example project running for running DuckDB on Vercel
1
star
50

iterm2-ohmyzsh-config

Configuration for iTerm2 and oh-my-zsh
1
star