Add choice element rendering in documentation#1613
Add choice element rendering in documentation#1613mretegan wants to merge 2 commits intonexusformat:mainfrom
Conversation
|
@PeterC-DLS Any idea why the CI does not get executed? |
|
We have chosen to set the Approval rule for running fork PR workflows to "Only users who have never had a commit or pull request merged into this repository will require approval to run workflows" - see (https://docs.github.com/en/actions/how-tos/manage-workflow-runs/approve-runs-from-forks) |
|
I don't seem to have permissions to give approval unless I'm missing something. |
|
Perhaps they can try rebasing it |
50fac34 to
7b2d11e
Compare
| "\n" | ||
| ) | ||
| # Process children in document order to preserve XML ordering. | ||
| for node in parent.xpath("nx:field|nx:group|nx:choice|nx:link", namespaces=ns): |
There was a problem hiding this comment.
The diff is very hard to read but as I understand instead of doing a for-loop for each tag, we do one loop for all tags and use an if-statement to distinguish between tags. And we do this to keep the order as defined in the XML file.
There was a problem hiding this comment.
@mretegan Why do we need to preserve the order here?
There was a problem hiding this comment.
It felt like the normal thing to do. There is always some logic behind the order in which people list things in the XML, so I think it should be kept in the HTML rendering. When I first added the <choice> rendering, I was surprised to see it at the end.
There was a problem hiding this comment.
There is always some logic behind the order in which people list things, so I think it should be kept in the HTML rendering.
But it could have been an explicit choice to systematically group fields, groups, links etc. in the HTML docs. The order within each group is still kept. Do you know @PeterC-DLS @prjemian ?
|
@PeterC-DLS This is a fix for showing |

This PR adds support for rendering
<choice>elements in the HTML documentation and ensures that all elements (fields, groups, choices, links) are rendered in their original XML document order. Closes #1439