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

Extend YAML parsing with dynamic & flattened vars #31

Open
briandominick opened this issue Jan 27, 2018 · 1 comment
Open

Extend YAML parsing with dynamic & flattened vars #31

briandominick opened this issue Jan 27, 2018 · 1 comment

Comments

@briandominick
Copy link
Collaborator

briandominick commented Jan 27, 2018

The way @mojavelinux has extended YAML parsing in the asciidoctor-pdf gem is pretty amazing. The code is here and the DSL documentation is here. This is a really simple and elegant enhancement. It lets you build cumulative variable values and it enables unique, flattened variables formed from the nested structure.

domain: codewriting.org
uri:
  base: http://$domain
  base_ssl: https://$domain
  blog: $uri_base_ssl/blog

Which can then produce variables that are called as such in AsciiDoc: {uri_blog}.

This should probably be a module inside LiquiDoc until it's ready to stand on its own, then maybe spin off its own gem to share this functionality more broadly.

@mojavelinux
Copy link

For how sophisticated YAML is, I'm surprised something like this isn't built in.

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

No branches or pull requests

2 participants