-
Notifications
You must be signed in to change notification settings - Fork 350
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
Proposal: Migrate comment documentation to nodedef doc attributes for std libraries #1950
Comments
I think it's a great idea to formalize the documentation, and move it away from comments in the code, and in to the actual data. Another win in the fight to make MaterialX a data driven library :). I think it perhaps also opens future doors to auto generated node library documentation in an easier way. Another possible syntax to consider (not weighing any heavy opinion in either direction yet) would be to add a ie.
Which might perhaps allow for multiple line documentation strings? I'm not sure if new-line characters are allowed inside of XML attributes.... I also don't know if it might allow for a slightly more optimized XML reader - if we knew we didn't need the documentation (ie. when we're doing shader gen only) we could skip the Or perhaps if we don't want XML text elements in the document, we could add
still giving us the advantage of filtering out the read of |
Currently only the AFAIK it should be assumed there are no special characters such as newlines, tabs etc. The W3C XML/HTML spec says you should not put any special characters including I'd rather formalize formatting than keep newlines, tabs, etc, For instance if a Anyways, just "pie in the sky" stuff. As a first step if moving comments into |
Proposal
This is an off-shoot of a discussion about PugiXML custom changes with @jstone-lucasfilm and @ld-kerley
The impetus being to remove the custom comment and line spacing custom changes to the library.
The main reason to have this is to allow for documentation of node definitions using XML comments.
The proposal here is to move the comments into the
nodedef
doc meta-data tag which makes it publiclyvisible to integrations. (@ashwinbhat , for glTF PBR spec ratification this will at least start to have docs on nodes
which can be enhanced with things like boundary conditions).
As an additional change, if
nodegraph
XML comments are to be preserved then the doc tag would be needed there.Test
Here is some sample code which could work for
nodedefs
and the result. It's mostly a heuristic to try andguess what comments go with which nodedefs. The comment immeiate before a nodedef(s) is the doc string.
Snippets from result on stdlib_defs.mtlx
The text was updated successfully, but these errors were encountered: