Last active
October 30, 2018 20:28
-
-
Save DaneWeber/c24cc3abd360cc3621b58574fbc6125f to your computer and use it in GitHub Desktop.
Makefile command to use docker images for swagger2markdown piped to asciidoctor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
api_pdf: | |
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 config.properties file and specify with | |
# -c /opt/config.properties | |
# asciidoctor-pdf supports pretty extensive styling: | |
# https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#applying-your-theme |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.