The intened use of this repository is to create a PDF document from an existing Swagger API description. This container takes use from two tools:
- swagger2markup: Creates AsciiDoc files from Swagger API descriptions.
- Asciidoctor: Renders AsciiDoc files as PDF (for example).
The default container command creates a PDF document from a given Swagger YAML file.
docker run --rm -it -v <path-to-documents-dir>:/documents tepeka/swagger-to-document
There have to be two files mounted using the volume /documents
:
swagger.yaml
contains the full API documentationindex.adoc
is used to bundle the single AsciiDoc files generated by swagger2markup. It can also be extend by manually written AsciiDoc files. Here is an example of a basic AsciiDoc index file:
include::./generated/overview.adoc[]
include::./generated/security.adoc[]
include::./generated/paths.adoc[]
include::./generated/definitions.adoc[]
The example
folder contains a update-api-doc
command to update the Swagger API in documents
.
Simply change the swagger.yaml
API description or extend the index.adoc
by manually written documentation and then execute the update-api-doc
command to create the PDF.