This tool takes a Swagger API specification (in yaml or json) and converts it into a PDF file.
Surely you’re wondering what this tool can do for you. Have a look at some of our examples!
The tool can be executed from the command line.
Swagger2PDF -i path/to/spec.yaml -o path/to/api.pdf
Short | Long | Description | Example |
---|---|---|---|
Required options |
|||
-i |
--input |
Input Swagger spec |
spec.yaml |
-o |
--output |
Output PDF file |
api.pdf |
Other options |
|||
-t |
--toc |
Generate Table of Contents |
|
-g |
--groupbytags |
Group paths by tags. |
|
-r |
--headerregex |
RegEx pattern used for determining operation categories. First capture group will be category name. |
|
Styling options |
|||
-s |
--style |
Asciidoctor style |
default |
-d |
--styledir |
Asciidoctor styles directory |
styles |
-p |
--imagesdir |
Asciidoctor images directory |
styles/img |
-f |
--fontsdir |
Asciidoctor fonts directory |
style/fonts |
-h |
--highlighter |
Asciidoctor code highlighting engine |
coderay |
This project depends on a few different tools to make everything possible. Go give them some love too!
-
Swagger2Markup for converting the Swagger spec to an Asciidoc file
-
asciidoctorj and asciidoctorj-pdf for converting the Asciidoc file to a PDF file