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

Allow generating complex metadata from existing metadata #969

Closed
tabatkins opened this issue Mar 31, 2017 · 3 comments
Closed

Allow generating complex metadata from existing metadata #969

tabatkins opened this issue Mar 31, 2017 · 3 comments

Comments

@tabatkins
Copy link
Collaborator

In whatwg/meta#23, Domenic wants to be able to include the bare minimum of metadata information in his specs, and have the rest of it (which is generally boilerplate, and inferrable from the shortname) auto-generate.

I think the best way to go about this is to have a Python hook that runs after all metadata is processed, before metadata validation, that lets you fill in additional metadata. I don't think anything less powerful will work; in particular, string substitution probably isn't sufficient.

@domenic
Copy link
Collaborator

domenic commented Apr 1, 2017

Hmm, so what would this end up looking like? Would we have to write Python? For our use case, string substitution would work, I am pretty sure...

@tabatkins
Copy link
Collaborator Author

Yeah, it looks like I should probably do a dumb string substitution first, because it's easy, and then perhaps do a Python thing after for more complicated use-cases.

@tabatkins
Copy link
Collaborator Author

Ok, just pushed this fix. Went with a simple solution for now - there's a new computed-metadata.include boilerplate file you can use, which will get macro-substituted before being evaluated and added to the document's metadata. Otherwise it's identical to defaults.include.

Note that, by necessity, this overrides any metadata set by any other source, so make sure that everything you put in that file is what you definitely want in every spec for your Group.

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

No branches or pull requests

2 participants