aglio icon indicating copy to clipboard operation
aglio copied to clipboard

Expose a render function which accepts a preparsed blueprint as input

Open rasapetter opened this issue 8 years ago • 5 comments

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 avatar Nov 11 '15 23:11 rasapetter

@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?

danielgtaylor avatar Nov 13 '15 20:11 danielgtaylor

Sounds good to me! It'd be great if you could ping me when you're done.

rasapetter avatar Nov 13 '15 22:11 rasapetter

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 avatar Jan 18 '16 13:01 wirtsi

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

danielgtaylor avatar Jan 28 '16 00:01 danielgtaylor

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!

danielgtaylor avatar Jan 28 '16 00:01 danielgtaylor