How to export Apiary Blueprint as PDF, stand-alone HTML or similar "deliverable"?

6.3k Views Asked by At

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?

3

There are 3 best solutions below

1
On BEST ANSWER

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.

3
On

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).

0
On

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