-
Notifications
You must be signed in to change notification settings - Fork 57
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
XML code-blocks in nxdl.xsd
are not picked up in the documentation
#1540
Comments
I'm in the blame because of the major refactoring in #1133. @prjemian was the original author. My 5 cents so far: we do XML escaping all over the docs and then we unescape in these two places: for field types definitions/dev_tools/docs/xsd.py Line 275 in a852e06
and for NeXus class definitions definitions/dev_tools/docs/nxdl.py Line 273 in a852e06
In your case it is field types and the string being unescaped 'Specify the parameters for each index of the ``dimensions``\nelement with a ``dim`` element.\nThe number of ``dim`` entries should be equal to\nthe ``rank`` of the array.\nFor example, these terms\ndescribe a 2-D array with lengths (``nsurf``, ``nwl``):\n\n.. code-block:: xml\n\t:linenos:\n\n\n\n\n\n\nThe ``value`` attribute is used by NXDL and also by\nthe NeXus data file validation tools to associate and coordinate the\nsame array length across multiple fields in a group.' After unescaping with the code
we have this string 'Specify the parameters for each index of the ``dimensions``\nelement with a ``dim`` element.\nThe number of ``dim`` entries should be equal to\nthe ``rank`` of the array.\nFor example, these terms\ndescribe a 2-D array with lengths (``nsurf``, ``nwl``):\n\n.. code-block:: xml\n\t:linenos:\n\n\n\n\n\n\nThe ``value`` attribute is used by NXDL and also by\nthe NeXus data file validation tools to associate and coordinate the\nsame array length across multiple fields in a group.' The generated RST file Specify the parameters for each index of the ``dimensions``
element with a ``dim`` element.
The number of ``dim`` entries should be equal to
the ``rank`` of the array.
For example, these terms
describe a 2-D array with lengths (``nsurf``, ``nwl``):
.. code-block:: xml
:linenos:
The ``value`` attribute is used by NXDL and also by
the NeXus data file validation tools to associate and coordinate the
same array length across multiple fields in a group. |
So the issue is that If I understand correctly, So using In other words, your solution in #1533 is the only possible solution I think. |
Thanks, this is also what I thought. Should we then simply change the other instances in the |
https://github.com/nexusformat/definitions/blob/main/nxdl.xsd#L1314 defines a code-block like this
inside an
xs:documentation
element of thenxdl.xsd
file. However, this does not properly converted into a code block in the docs, see https://manual.nexusformat.org/nxdl_desc.html#dim and the screenshot below.I believe the problem is in https://github.com/nexusformat/definitions/blob/main/dev_tools/docs/xsd.py#L265, where only the textual part of the documentation is retrieved and the XML is ignored.
There are two possible solutions:
nxdl.xsd
file, i.e. writeNXdata
is aAXISNAME
orDATA
#1533.dev_tools
to allow XML parts@woutdenolf any ideas? Git blame says this code was originally written by you, but could just be copied from somewhere else.
The text was updated successfully, but these errors were encountered: