forked from systemd/systemd
-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: python script for rst converstion #5
Open
Realtin
wants to merge
41
commits into
main
Choose a base branch
from
man_pages_in_sphinx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Realtin
changed the title
python script for rst converstion
WIP: python script for rst converstion
May 8, 2024
Realtin
force-pushed
the
man_pages_in_sphinx
branch
from
May 22, 2024 11:38
c3d9901
to
bbe865f
Compare
Realtin
force-pushed
the
man_pages_in_sphinx
branch
from
June 12, 2024 15:26
a3324d5
to
e9d09c4
Compare
Realtin
force-pushed
the
man_pages_in_sphinx
branch
from
June 17, 2024 10:17
e9d09c4
to
4930094
Compare
so they will not be turned into html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes
How to convert to sphinx (old)
// add includes
xmllint --xinclude busctl.xml
// turn xml into rst
pandoc -t rst -f docbook -s busctl.xml -o busctl.rst
// turn rst into html
make html
Problem: Includes
All Includes: {'journal-iterate-unique.c', 'systemd.link.xml', 'version-info.xml', 'journal-iterate-foreach.c', 'sd_bus_error-example.c', 'user-system-options.xml', 'sd_bus_add_match.xml', 'print-unit-path-call-method.c', 'journal-iterate-poll.c', 'sd_bus_message_read_basic.xml', 'check-os-release-simple.py', 'event-quick-child.c', 'sd_journal_get_data.xml', 'id128-app-specific.c', 'ethtool-link-mode.xml', 'systemd.mount.xml', 'yubikey-crypttab.sh', 'common-variables.xml', 'standard-conf.xml', 'org.freedesktop.locale1.xml', 'send-unit-files-changed.c', 'systemd.netdev.xml', 'timedatectl.xml', 'journal-stream-fd.c', 'sd_bus_message_append_basic.xml', 'systemd.service.xml', 'system-or-user-ns.xml', 'journal-iterate-wait.c', 'print-unit-path.c', 'logcontrol-example.c', 'glib-event-glue.c', 'tc.xml', 'standard-specifiers.xml', 'fido2-crypttab.sh', 'journal-enumerate-fields.c', 'tpm2-crypttab.sh', 'cgroup-sandboxing.xml', 'vtable-example.c', 'threads-aware.xml', 'inotify-watch-tmp.c', 'systemctl.xml', 'supported-controllers.xml', 'hwdb-usb-device.c', 'notify-selfcontained-example.c', 'uki.conf.example', 'system-only.xml', 'sd-bus-container-read.c', 'sd_bus_service_reconnect.c', 'check-os-release.sh', 'notify-selfcontained-example.py', 'path-documents.c', 'sd-bus-container-append.c', 'vtable-example.xml', 'check-os-release.py', 'vpick.xml', 'importctl.xml', 'standard-options.xml', 'libsystemd-pkgconfig.xml'}
Code Includes: {'journal-iterate-unique.c', 'journal-iterate-foreach.c', 'sd_bus_error-example.c', 'print-unit-path-call-method.c', 'journal-iterate-poll.c', 'check-os-release-simple.py', 'event-quick-child.c', 'id128-app-specific.c', 'yubikey-crypttab.sh', 'send-unit-files-changed.c', 'journal-stream-fd.c', 'journal-iterate-wait.c', 'print-unit-path.c', 'logcontrol-example.c', 'glib-event-glue.c', 'fido2-crypttab.sh', 'journal-enumerate-fields.c', 'tpm2-crypttab.sh', 'vtable-example.c', 'inotify-watch-tmp.c', 'hwdb-usb-device.c', 'notify-selfcontained-example.c', 'uki.conf.example', 'sd-bus-container-read.c', 'sd_bus_service_reconnect.c', 'check-os-release.sh', 'notify-selfcontained-example.py', 'path-documents.c', 'sd-bus-container-append.c', 'vtable-example.xml', 'check-os-release.py'}
Solution in Sphinx
Includes in sphinx: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-literalinclude
.. literalinclude:: example.py
Solution in Pandoc
```{.include}
chapters/introduction.md
chapters/methods.md
chapters/results.md
chapters/discussion.md
```
Problem: "Entity References"
lots of files use "Entity References" in xml and pandoc can't handle it
Solution in Sphinx
https://documatt.gitlab.io/sphinxcontrib-constdata/
sphinxcontrib-constdata is the extension for Sphinx documentation projects that allows showing values, listing tables, and generating links from CSV, JSON and YAML files.
Solution in Pandoc
Problem: Code Includes
Solution in Pandoc
https://github.com/pandoc/lua-filters/tree/master/include-code-files
```{include="hello.c"}
```
Problem
/tools/xml_helper.py
Problem: Tables !!!
see: standard-specifiers.xml, vtable-example (should this be turned into rst?)
Problem: Includes are more difficult?
<para id="plural">
seems to identify specific paragraph of an include (is removed in the rst translation)<xi:include href="threads-aware.xml" xpointer="getenv"/>
still ignoredTODOs:
<xi:include href="version-info.xml" xpointer="v198"/>
-->%v198%
(convert to placeholder)convert
version-info.xml
for palceholder useHandle Entity References as placeholders (by hand)
convert
custom-entities.ent.in
for placeholder usecode includes?
<programlisting>
(but needs manual adjustments)convert included section files to rst (currently listed in ignored files)
put all rst in a folder ?
manual adjustment of:
{.include}
){include=
)run pandoc to resolve includes & run sphynx
document rst and sphinx command
custom-entities.md
needs to be filled?ethtool-link-mode.xml
is used as an include but is in a different folder!!<citerefentry><refentrytitle>
? don't get a special formatting is that needed?