Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Makefile command to use docker images for swagger2markdown piped to asciidoctor
# swagger2markup output fed to asciidoctor-pdf - all via published docker images
# The following is a Makefile command in the root of a web service repo with the following assumptions:
# ./swagger/v1/swagger.json is the swagger definition (created by rswag in my case)
# ./_docs/ is where we want the PDF and intermediate ADOC to live
# The ADOC file is pretty useful, but if you just want the PDF, it's a byproduct you might want to clean up
docker run --rm -v $(shell pwd):/opt swagger2markup/swagger2markup convert -i /opt/swagger/v1/swagger.json -f /opt/_docs/api-definition
docker run --rm -v $(shell pwd)/_docs:/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf api-definition.adoc
# To add configuration options for swagger2markup, create a file and specify with
# -c /opt/
# asciidoctor-pdf supports pretty extensive styling:
Copy link

Above is for a Unix environment. The same commands should work on Windows except for the $(shell pwd) bits, which are just about getting the full path to the current directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment