Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a render function which accepts a preparsed blueprint as input #196

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rasapetter
Copy link

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.

Exports renderBlueprint as a separate function which can be used
with a preparsed blueprint.
@danielgtaylor
Copy link
Owner

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

@rasapetter
Copy link
Author

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

@wirtsi
Copy link

wirtsi commented Jan 18, 2016

Hi ... could this be used to resolve ? So in the end I have one blueprint file that I can upload to eg. apiary?

bests

@danielgtaylor
Copy link
Owner

@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
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants