bensonning / swagger2html

This Dockerfile create a docker image to convert swagger yaml to html.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

修改支持中文

  • 将themy.yml 拷贝到当前目录
  • 将yh.ttf 拷贝到 font/
  • 用dockerfile 创建 image
  • docker build -t swagger2htmlnew .
  • docker run --rm --volume $(pwd):/mnt swagger2htmlnew swagger.yaml

swagger2html

This Dockerfile create a Docker image to convert swagger yaml to html.

DockerHub Status

Description

The docker container which is run from this image convert the swagger 2.0 yaml file to html file using below:

Install

Pull nmatsui/swagger2html from DockerHub:

docker pull nmatsui/swagger2html

Or build nmatsui/swagger2html from Dockerfile:

git clone https://github.com/nmatsui/swagger2html.git
cd swagger2html
docker build -t nmatsui/swagger2html .

Usage

In the directory of swagger file, run this image with mounting current directory and with swagger filename as a command argument:

docker run --rm --volume $(pwd):/mnt nmatsui/swagger2html swagger_filename.yaml

properties of swagger2markup

Default properties of swagger2markup are below:

swagger2markup.generatedExamplesEnabled=true
swagger2markup.tagOrderBy=AS_IS
swagger2markup.operationOrderBy=AS_IS
swagger2markup.definitionOrderBy=AS_IS
swagger2markup.parameterOrderBy=AS_IS
swagger2markup.propertyOrderBy=AS_IS
swagger2markup.responseOrderBy=AS_IS
swagger2markup.pathsGroupedBy=TAGS

If you put a swagger2markup.properties file at the same directory of target yaml file, you can customize the properties of swagger2markup.

Show below to understand the properties of swagger2markup: Swagger2Markup API Usage

arguments of asciidoctor

The arguments of asciidoctor are below:

asciidoctor -a toc=left -a toclevels=3 <<swagger2markup_converted_file.adoc>>

The 'Table of Contents (depth 3)' is placed on the left side of page.

License

MIT License

Copyright

Copyright (c) 2018 Nobuyuki Matsui nobuyuki.matsui@gmail.com

About

This Dockerfile create a docker image to convert swagger yaml to html.

License:MIT License


Languages

Language:Dockerfile 100.0%