aglio
aglio copied to clipboard
Expose a render function which accepts a preparsed blueprint as input
Motivation: Sometimes it would be useful to be able to modify the blueprint before it's rendered (without touching the markdown). The proposed changes would allow users to parse the markdown, make changes to the resulting blueprint object and, finally, ask aglio to render the blueprint using renderBlueprint
.
@rasapetter thanks for this pull request. I really like this idea! I only have one concern, and it involves the format of the blueprint's internal representation. Currently, it is API Blueprint AST, but Protagonist (the parser based on Drafter) now outputs Refract by default and I'm working on updating the default theme to use this format instead.
I would propose that we do support this feature, but wait until everything is based on Refract elements. Then your code modifying the blueprint will work with Refract elements instead of today's AST. What do you think?
Sounds good to me! It'd be great if you could ping me when you're done.
Hi ... could this be used to resolve ? So in the end I have one blueprint file that I can upload to eg. apiary?
bests
@wirtsi you can already do that with the --compile
option, which outputs the final compiled blueprint instead of the rendered HTML. You can use that file with Apiary, Dredd, Drakov, and other tools.
Just wanted to post an update. I am now in the process of moving everything over to Refract, but am finding bugs and issues here and there so the progress has been a bit slow. Coming along nicely now so please expect pushes in the coming weeks!