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
Fixes doc auto-formatting oopsies #41342
Conversation
|
The other definitions broke term, cmdsynopsis and arg tags; spaces inside were removed, making workdsrun-ininstead of keeping them spaced.
This script is used to automatically fix issues within xml documentation files. The script is *for now* intended to be used ad-hoc, and the commits to be examined. A future discussion will define whether: * This commit and scripts are kept. * The script is extended for common use. The biggest issue right now with the script is that it *could* in theory destroy a valid space-less varlistentry. The script could, in practical use, be changed and extended to normalize some parts of the XML files, mainly: * A common quoting style for attributes * Fix-up some weird formatting automatically that xmlformat doesn't catch
With visual inspection that nothing got worse.
With visual inspection that nothing got worse.
e722899
to
6bf5419
Compare
<term>Else:</term> | ||
<term> | ||
Else: | ||
</term> | ||
<listitem> | ||
<para> | ||
<filename>misc</filename> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sort of think none of these should be <term>
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That if they are or aren't should be fixed in another PR :).
Though, it seems right in how it may be abusing the variablelist
for its appearance instead of its meaning. Except variablelist
could be more apt if instead of presenting it as a list of choices, it was more a description of the categories.
A list in which each entry is composed of a set of one or more terms and an associated description.
Doesn't make me think it's "programming" variables only. Looks like it's a catchall "term / definition" list. And it does look like term
is the only node in there that isn't the definition.
So (while this may be wrong WRT valid docbook) this may be turned outside in this way:
<term>
<filename>development/interpreters</filename> </term>
<listitem>
<para>
If it’s an <emphasis>interpreter</emphasis>.
(e.g. <filename>guile</filename>)
</para>
</listitem>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM merge away. I think the non-term terms can remain, despite not being really sematically correct.
<term><varname> | ||
$outputInfo</varname> | ||
<term> | ||
<varname> $outputInfo</varname> | ||
</term> | ||
<listitem> | ||
<para> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note this is adding an extra space after <varname>
, maybe it is fixed in a future commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't adding an extra space after <varname>
, but condensing the run of spacing into one.
<term>Java</term> | ||
<term> | ||
Java | ||
</term> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think none of these should be <term>
s too
<term>Directories in the Nix store</term> | ||
<term> | ||
Directories in the Nix store | ||
</term> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above three shouldn't be terms
As for fixing existing semantic markup, I really think it should be done in another PR; this is hard enough to review :). |
Motivation for this change
Documentation
(And other such examples can be found, see fixes.)
Man pages
Some options were broken like
--optionnamevalue
here.This fixes them and ensures
xmlformat
won't.Explanation
The
xmlformat
documentation has these passages:Open questions
Fixer tool
Should the fixer script be included in the repo the way I did it?
I'm really unsure. The commit was added mainly to show how it was fixed. I believe the commit can be safely
git rebase
dropped from the history. I'm ready to remove traces of the tool from the history :).Though, there is some value in having a tool that passes the XML files through ruby+REXML: it would normalise some stuff in our files. Those normalisations haven't been added to the commits, but it would mainly ensure one type of quotes would be used (configurable) and would fix some XML weirdness that xmlformat doesn't care about.
The separate tool for more fixing can and should be discussed in a separate issue I believe.
Things done
This was done for both the
doc
andnixos/doc
folders, and where there was changes, a commit was made. Do note thatmake format
was ran until there were no more changes, asxmlformat
apparently isn't idempotent, or at least, its output isn't deterministic in a way that re-running it can lead to more changes.Once all fixed, I did a high-level visual overview of the generated HTML, it looks like everything was caught, but it's hard to be entirely sure. If there are other sections exhibiting the same breakage, the fix is known.
The changes have been made to 18.03 as this break manpages and documentation.
See #41344
To test / check
I would HIGHLY suggest reading each commit as otherwise all the XML soup will quickly make you dizzy.
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)cc @grahamc as we went back and forth looking at the issue; I would like someone else to take a look at the PR too.