7

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?

Rodja
  • 7,998
  • 8
  • 48
  • 55

3 Answers3

10

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.

Gábor Imre
  • 5,899
  • 2
  • 35
  • 48
  • Aglio was an excellent suggestion by itself, but I appreciate you taking the time to give some instructions. – csotiriou Sep 13 '15 at 18:06
2

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

Ján Sáreník
  • 1,517
  • 1
  • 16
  • 13
  • 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. – Josh Benner Apr 07 '15 at 21:02
  • It can be hacked, see other answer. – Gábor Imre May 28 '15 at 11:30
  • 1
    Agilo has a bug. It drops trailing slashes from paths. Issue opened, no response so far. https://github.com/danielgtaylor/aglio/issues/222 – decades Feb 17 '16 at 10:03
0

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