-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add asciidoc guide #21515
base: main
Are you sure you want to change the base?
Add asciidoc guide #21515
Conversation
Simply the output of pandoc conversion from docbook to asciidoc format without any tweaking. The conversion script `convert.py` is included.
cockpit-guide is an index page and pandoc can not process it correctly. Thus any changes in it need to be reviewed and transferred to cockpit-guide.adoc manually
- adjust convert.py to include man pages - add Makefile to produce single page html and man pages - include man pages to the html guide index page (cockpit-guide.adoc)
I've tried this out, apparently I use
Few things I noticed:
The most notable change is that instead of an inline TOC, we now have a sidebar. Regarding your question about CSS, @garrett theme'd the documentation on our website to be more in line with the general website look and feel. The CSS overrides for that are here https://github.com/cockpit-project/cockpit-project.github.io/blob/main/assets/site/guide.scss (We sync the documentation from Cockpit to our website every release) |
Since man pages need to be adjusted manually, I wanted to clarify the chosen direction first before editing each of them. So the
This is one issue, i think. The api doc files are included, but they do not have a top-level header inside their own file, so the first header they show is "Description". As we agreed at the call to proceed with asciidoc forward, I am going to add the remaining formatting fixes. And then we should decide on single vs multipage html approach, sidebar layout and css. |
Thanks @bookwar ! Wrt. your questions:
We embed these links a lot:
Not sure how much control we have over the file names, but if multi-page can spit out these file names, that'd be a good reason to stay with multi-page.
Yes, please.
This is more of a @garrett question, but not from my side -- to be honest, I'd really like to avoid CSS customizations unless there is a really compelling reason. These are always a long-time commitment to maintaining and checking them, and we have no automated way to alert us of regressions. |
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.
Thanks! I didn't dive into any details yet, as this is a PoC.
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" | ||
[ | ||
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> | ||
<!ENTITY version SYSTEM "version"> | ||
]> | ||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" > | ||
<book id="index"> | ||
<bookinfo> | ||
<title>Cockpit Guide</title> | ||
<releaseinfo>Documentation for Cockpit &version; -- |
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.
OOI, why is this necessary? The .xml files will go away completely, no?
cockpit | ||
|
||
cockpit-bridge | ||
|
||
1 | ||
|
||
cockpit-bridge | ||
|
||
Cockpit Host Bridge | ||
|
||
cockpit-bridge | ||
|
||
--help | ||
|
||
--packages | ||
|
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 looks really strange -- This should get some more structure, like "NAME", "SYNOPSIS", and proper verbatim formatting and such. But I suppose that's what you meant with "man pages need work".
Regarding the CSS overrides: They were made so we could integrate the docs into the site, and therefore have the docs searchable on the site. This is useful for people who are looking for information in our documentation when they are on our website. People have been able to find the doc by browsing to the documentation and also searching for the documentation, and it meant that we could have a cohesive docs section with the documentation from anywhere (exclusively on the website for some, others from the docbook guide, and still others from various files in git repos, and even from the GitHub wiki too). Of all the documentation we have, it is all handled by the website natively via Markdown, except for the docbook-generated HTML guide. The guide is the only thing that has needed special handling (build docbook to HTML first) and it is the only one with custom CSS, as it had really awful inline CSS in the (horrific) docbook-generated HTML that needed to be overridden. As for the "maintenance burden" for the docs CSS... in the past half decade, it was effectively 0. The CSS was never updated by itself once I did the overrides initially, aside from very minor fixes around 6 years ago. The docs transformation from docbook was consistent; the tooling and conversion did not change. The only changes in the past several years were global changes across the site; we had nothing doc-specific for many years. And doc-specific stuff was a couple of commits containing a few lines in 2020 and 2019 prior, and they were small enhancements (like improving tables on mobile). You can see that in the history: And the SASS prior: In other words, the benefits (having docs integrated into our site, being searchable) outweigh the cost (basically no real specific maintenance needed since 2018, aside from 2 extremely minor mobile tweaks in 2019, which was 6 years ago). If we converted the AsciiDoc to Docbook for doc generation for integration on the website, nothing should really change. If we use AsciiDoc directly for the website, then we probably don't have to have any special CSS (or very minimal CSS), as AsciiDoc in Jekyll would work like Markdown in Jekyll. HOWEVER (and this is a big however), GitHub Pages does not support AsciiDoc. See https://pages.github.com/versions/ and note that AsciiDoc support is not there. We'd need to change the way we build the website to be able to use the plugin to have native AsciiDoc support. So, that all said, we could implement this in three passes, with minimal disruption during each:
We could even be able to skip step 1, merge 2 and 3 (as step 3 is basically adding a module line to the Summary:
|
Note, there's an example AsciiDoc-powered website via GitHub Actions starter @ https://github.com/asciidoctor/jekyll-asciidoc-quickstart with probably the most relevant part to us @ https://github.com/asciidoctor/jekyll-asciidoc-quickstart/blob/main/.github/workflows/publish.yml I don't know how this would impact our fork preview method, if that is even still possible via GitHub Actions. Hopefully. And I hope it's easy and transparent for us to do that still too. It's very useful for us to each have our own staging site like we have had. |
This change converts the guide from docbook to asciidoc format via several steps:
pandoc
to convert existing xml pages to the asciidoc format.Most of the pages from the guise can be converted automatically except the index page (cockpit-guide.xml)
cockpit-guide.adoc
file as a new index page for the guide, which contains proper include directives for all other pages.Makefile
to build html and man pages from asciidoc sourcesTo see the local copy you can run
Questions to consider: