-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Fix DocBook XSD, making it deterministic again #4615
base: master
Are you sure you want to change the base?
Conversation
Also updated the generated doc files for tools, builders and variables.
@dirkbaechle That moved the error, but still an error:
|
I see the same error. |
Okay, so I did some further digging:
|
In my case, for the check I let pip upgrade the otherwise-pinned lxml, pip reports: Be nice not to have to change the base docbook, but... if you're convinced it's not one of the SCons definitions which is somehow affecting that element, then it probably doesn't hurt, either. The DocBook team rewrote everything for the 5.x series and doesn't use these files any longer, so we shouldn't have the "divergent mods" issue common to vendoring. I discarded the idea of trying to Docbook 5.x since it looks like our adds would have to be considerably reworked, didn't seem worth the effort. |
@mwichmann Yes, switching to DocBook 5.x isn't possible with our current tooling around documentation, because they don't support entities anymore (that we use for linking to tools/builders and such) IIRC. In the meantime I found a rather crude "hack" to get things going again: removing line 99 (ref="lot") from the file doc/xsd/dbhierx.xsd. This would make the XSD deterministic again, but would prevent us from using the "lot" tag early in an article document. We could still use it at the end of the document though (see https://tdg.docbook.org/tdg/4.5/article ). My plan would be:
Questions:
|
I forgot to mention to just run RE docbook 5.0, do they replace entities with something else? or is the concept dropped entirely? Would moving to DB 5.0 more future proof our doc process, while maintaining the bulk of it's current abilities? |
Plan sounds reasonable to me, anyway (I'm not "the maintainer" :-) ). I'm guessing it's not really worth the investment to do a lot more fixing. The current state forces us to either pin an aging version of lxml or not be able to build the docs the current way, since the formal build includes a validation, so it fails, so that's not a good state to be in. Personally, I'm okay with just getting past that and not doing more (even though there may be another sticking plaster needed when something else changes) - don't consider that a "decision"! |
Yes. I think fix and allow us to update our lxml is a great fix for this immediate problem. My other questions above, are really to try an get a handle what our options are when we move on from our docbook 4.5 solution, and what we'd lose/gain with such changes. |
Okay, I'll do the simple hack first...however this might take a week or two, since I'm a little swamped at the moment. Some more food for the "future of SCons docs" discussion:
|
Just found this...other projects have similar problems: https://discourse.nixos.org/t/documentation-format/4650 ...pointing also to |
(ugh, put this reply in the wrong place at first) Yes, roughly been through those same thoughts. I prefer rst because it's a Python project, so we're already writing rst in the docstrings so it's less "switch" between docs-in-code and separate-docs. Someone else was an asciidoc fan and was ready to do the conversion a few years back. And MD is the most ubiquitous, but least expressive. None give us the easy ability to write doc for a feature together (function, cvars, builders, tools) and have them generated into their own sections like our extensions to docbook allow now. I suppose that could be written but that's another big chunk of work for a project that already has far too few contributing resources. Also, ability to generate into manpage (*roff) is still expected by distros who package SCons, asciidoc can do that natively but I'm less sure how easy that is with other forms. |
realistically @mwichmann is responsible (historically) for the lion share of doc edits. For other users making edits, CI can catch issues so having every developer set up docbook toolchains not strictly necessary. So I don't think we really need to query the users mailing list on this, we can make an executive decision amoung @mwichmann @dirkbaechle and @bdbaddog . Currently we're using entities extensively to provide hyperlinking, does asciidoc have similar? |
You can create roles in restructured text... like the things that look like adoc is fairly sophisiticated in that it can generate to docbook and then use the docbook chain to generate further stuff (it doesn't generate only to docbook, but is can). I'm not sure if that would be a good or bad thing for us though :-) |
I'm not sure that we could directly publish EPub from AsciiDoc, for example. There seems to be EPUB3 ( https://docs.asciidoctor.org/epub3-converter/latest/ ) but I haven't tried it, yet. And even if we simply use AsciiDoc as "driver" for our current DocBook toolchain, being able to edit sources in a non-XML format can be seen as a pro. Plus we'd get rid of all the fiddling with XSD/RelaxNG schemata and validation errors, relying on AsciiDoctor to output valid DocBook as soon as its input is valid AsciiDoc... Creating the SCons output from given examples, and the whole linking stuff around tools/builders/cvars and such, can probably be kept by adapting the SConsDoc module accordingly. This holds true for both, ReST and AsciiDoc. |
adoc is fine by me, excepting the one thing I mentioned: I'm doing Sphinx-aware reST in docstrings, which are gradually improving, thus the context-switching comment. |
@dirkbaechle - just a ping to see if you had a chance to push your "simple hack" from above? |
Working on it...I'm creating a RelaxNG version of the "SCons DocBook 4.5 extensions" in compact format (RNC). This will be the new "master" for all derived formats like RNG and XSD. Note: This approach should also make it easier to transition to DocBook v5.x, if this should ever come up. But I don't see a switch to DB 5.x happening, as long as the current doc toolchain is running fine again. |
Overview of changes
Back when I created the first version of the SCons DocBook XSD, a lot of cruft was added by copy-n-paste. In addition, most SCons tags were allowed to appear 'almost everywhere', leading to it being reported as "not deterministic" by some XML scanners/validators.
This got corrected, and the new grammar is much stricter now, regarding where SCons-specific XML tags may be used.
I also had to patch doc files in several places accordingly.
Contributor Checklist:
CHANGES.txt
(and read theREADME.rst
).