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

3

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?

Jaques answered 2/12, 2014 at 12:27 Comment(0)
P
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.

Pastern answered 28/5, 2015 at 11:18 Comment(1)
Aglio was an excellent suggestion by itself, but I appreciate you taking the time to give some instructions.Toadstool
E
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).

Erastus answered 2/12, 2014 at 13:58 Comment(3)
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/222Evangelical
G
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

Glister answered 15/3, 2023 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.