We need to export our Apiary Blueprint for task assignment purposes as a self containing "deliverable" like PDF or ZIP or similar. I'm aware of the feature request and the discussion below. Is it possible to "hack" something better than the poor html exporter? Maybe by injecting some css style into the page with chrome? Has somebody found a "good-enough" solution?
How to export Apiary Blueprint as PDF, stand-alone HTML or similar "deliverable"?
Ján Sáreník mentioned aglio, you can make it work locally by the following steps.
- Save your API definition markdown (e.g.
myfile.md
) - Install aglio
npm install aglio -g
- Start aglio server
aglio -i myfile.md -s
- Open
localhost:3000
and download the HTML file - Hack the HTML by commenting out the
<div id="localFile" ...>...</div>
warning - Hack the HTML by replacing
http://localhost:3000/
with empty string everywhere
Aaand it's done.
Aglio was an excellent suggestion by itself, but I appreciate you taking the time to give some instructions. –
Toadstool
You can use https://github.com/danielgtaylor/aglio to render API Blueprint into static HTML files which can be zipped (or maybe also PDF-exported, but I haven't tried).
Aglio's HTML must be served from a web server to function, as it depends on external resources and browsers will not allow them to be loaded if read from local filesystem. –
Gardell
It can be hacked, see other answer. –
Stryker
Agilo has a bug. It drops trailing slashes from paths. Issue opened, no response so far. github.com/danielgtaylor/aglio/issues/222 –
Evangelical
As mentioned in previous answers. https://github.com/danielgtaylor/aglio is a good way to go. I just tested this, and following command works for using aglio in docker.
- build aglio
docker build -t aglio .
- create some folder and add files you want to cenvert (i used input)
mkdir input
cp path_to_my_file input/input.md
- run command
docker run -v $(pwd)/input:/tmp -t aglio -i /tmp/input.md -o /tmp/output.html
© 2022 - 2024 — McMap. All rights reserved.