-
Notifications
You must be signed in to change notification settings - Fork 93
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
Docs (User + Design Guides) conversion to Sphinx #2910
Docs (User + Design Guides) conversion to Sphinx #2910
Conversation
ac10165
to
4732a6d
Compare
Assigning @oliver-sanders given his in-depth knowledge of Sphinx & documentation overhaul. @matthewrmshin: I have unassigned you as the one of the formal reviewing pair, but of course feel free to provide feedback or review otherwise. |
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.
Docs build OK under 1.7.9 but with some warnings which will get fixed when the theme is hardcoded. The HTML is pretty smooth, successfully de-LaTeXed!
doc/src/installation.rst
Outdated
|
||
- `mock <https://mock.readthedocs.io>`_ | ||
|
||
The User Guide is generated from LaTeX source files by running |
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 section might need updating :)
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.
Ah yes, well spotted. I'll just need to change is
to was
, right!? 😁
doc/src/suite-config.rst
Outdated
- And any include-files used in it (see below; may be | ||
kept in sub-directories). | ||
|
||
- **A ``bin/`` sub-directory** (optional) |
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.
Annoyingly RST can't handle a literal inside bold text, other markup languages can but RST is somewhat deficient here.
This will find other examples (along with some false positives):
$ git grep -E '\*[^\*]+`[^\*]+\*'
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'll go through & amend those instances.
.. code-block:: cylc | ||
|
||
# include the file $CYLC_SUITE_DEF_PATH/inc/foo.rc: | ||
%include inc/foo.rc |
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 code-block gets rendered in red as an error, this is my fault (sorry) I didn't add the include file syntax to the cylc_lang
lexer. These errors can be ignored in this PR.
[scheduling] | ||
[[dependencies]] | ||
[[[T00, T12]]] | ||
graph = "my-foo<other.suite::foo> => bar" |
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.
Inter-suite triggers render in red as errors, my fault again, the cylc_lang
lexer doesn't like these (probably the colon character). Again these errors can be ignored in this PR.
I've updated the table in #2752 accordingly.
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.
No problem, thanks for investigating. I did notice there were a few syntax highlighting abnormalities in the built docs & intended to add that into one of the lists for future work (& seem to have neglected to). But #2752 is a more appropriate home.
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've now fixed these issues in metomi/rose#2274, we can copy across the updated cylc_lang.py
once it's merged (in a future PR if this gets merged first).
doc/src/running-suites.rst
Outdated
warm start) the cycle point at which it starts can be given on the command | ||
line or hardwired into the suite.rc file: | ||
|
||
.. code-block:: cylc |
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 code block renders in red as an error but this time it's actually a genuine error!
-.. code-block:: cylc
+.. code-block:: bash
There are a few other code blocks showing up in red (most are probably my fault, I'll fix the syntax file) some are genuine. Here is a list of the effected files:
$ grep -l --color=none -r '<span class="err"' | sed 's/\.html/\.rst/' | sed 's/^/doc\/src\//'
doc/src/install/html/built-sphinx/appendices/cylc-6-migration-ref.rst
doc/src/install/html/built-sphinx/appendices/suiterc-config-ref.rst
doc/src/install/html/built-sphinx/running-suites.rst
doc/src/install/html/built-sphinx/suite-config.rst
doc/src/install/html/built-sphinx/suite-design-guide/general-principles.rst
doc/src/install/html/built-sphinx/suite-design-guide/portable-suites.rst
doc/src/install/html/built-sphinx/suite-design-guide/style-guide.rst
doc/src/built-sphinx/appendices/cylc-6-migration-ref.rst
doc/src/built-sphinx/appendices/suiterc-config-ref.rst
doc/src/built-sphinx/running-suites.rst
doc/src/built-sphinx/suite-config.rst
doc/src/built-sphinx/suite-design-guide/general-principles.rst
doc/src/built-sphinx/suite-design-guide/portable-suites.rst
doc/src/built-sphinx/suite-design-guide/style-guide.rst
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.
Nice, thanks for extracting that as a list for me. I'll get those errors ironed out.
doc/src/custom/auto_cli_doc.py
Outdated
@@ -0,0 +1,485 @@ | |||
#!/usr/bin/env python2 |
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 file can go as you have implemented another script to do the job.
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.
Yes, good spot; I forgot to remove this once I realised it was out of scope to adapt it to work for Cylc commands for this initial PR.
doc/src/custom/make-index.sh
Outdated
@@ -20,20 +20,16 @@ | |||
|
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 we can ditch this script as well, Sphinx can take care of handling multiple versions of the build docs.
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.
[Addressing in latest comment; see 🔆.]
licensing | ||
|
||
|
||
.. insert vertical whitespace else sidebar menu overhangs short page (ugly) |
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 hack might work for the HTML version (provided that a particular theme is used), however, if we change the theme or build to a different format (e.g. PDF, slides)...
We could probably fix this in the chosen theme either in the Sphinx repository or with a custom CSS file (which would only affect that theme).
doc/src/custom/numfig.py
Outdated
@@ -0,0 +1,124 @@ | |||
# |
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 extension hasn't been updated since 2012 which makes it a little high risk. If we are lucky this functionality might be provided in a more contemporary version of Sphinx. The Cylc tutorial requires 1.5.3 so we will have to up this anyway.
If not it looks like someone has put it up on pypi which would at least save us bundling the script: https://pypi.org/project/sphinx_numfig/
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.
[Addressing in latest comment; see 🔆.]
To register, & follow-up on, new points discussed with @oliver-sanders in person last week, including those covered in his previous feedback set (as tagged ':high_brightness:'):
|
Can't help much as I really know very little about Sphinx. But I must say I am impressed by the amount of work done so quickly. Looking forward to being able to build and browse the documentation 👏 👏 . I enjoyed refreshing my memory on LaTeX... but Sphinx sounds a lot easy/simpler. Could it be that sphinx gives that error only for Python 2.6.? For me
Gives:
Cheers |
Ah, thank you @kinow you've solved it ( |
The
|
I originally thought this created a 'homepage' (as in e.g. https://cylc.github.io/cylc/documentation.html) which previously linked to the User & Suite Design Guides & I thought as a stepping-stone should change to linking straight to the Sphinx HTML docs index page. But on closer inspection this is not the case, so I will get rid of it. I also will work out where |
Nice work @sadielbartholomew (I had thought we'd have to wait much longer for this!). |
I assume you mean the main cylc web site? That is served from the |
The generated HTML here is a massive improvement 🎆 🍾 🎈 |
@hjoliver thanks for the explanation in #2910 (comment), I was really quite puzzled as to where that page was emerging from! I thought it must be something to do with
I am sure we can, but would it be okay to add this to the list of possible follow-on work, instead of including it in this PR? I am keen to get this in with minimal complications, especially since any new changes to the docs on master need to be incorporated manually (rather than via Given the procedure you outlined, I assume you can just link to the Sphinx docs instead of the User Guide PDF etc., as before, when you push the This all relates to the point from my original comment (as below). What additional documents do we want to include or link to in what will become the main index page of the Cylc docs?
|
@hjoliver I think we are going to have a small run of PRs for the docs where we bring across features from the Rose docs, get PDF output, streamline the build -> deploy process, etc. |
Configure Sphinx documentation builder Copy all CUG & SDG text & split into .rst files w/ better sectioning Convert all text content from TeX to RST Create basic docs-building wrapper command 'make-docs'
Update 'cylc make-docs' & 'cylc documentation' accordingly Add numfig extension to get numerical figure refs in Sphinx 1.2.x
Rebase branch to updated master to include all recent changes Amend Cylc homepage 'index' page Amend .gitignore to include all generated docs content Amend documentation/00-make.t to account for new make method Amend relevant tests to account for changed [documentation][files]
Adapt for clean build with sphinx version range >= 1.5.3, <= 1.7.9: * apply available built-in to remove external extension numfig * "classic" theme now hardcoded as required for these versions Fix literals inside bold & (amendable) cylc_lang lexer error cases Update 'check-software' command & installation instruction text Remove redundant files (auto_cli_doc.py, make-index.sh)
e5358cd
to
86d503d
Compare
New commit # 1
...and the same for newly-merged #2930. New commit # 2I did spot one (hopefully the last) component requiring a change to be made, namely the specified Cylc version; during development I manually set references to this to The system/docs The approach I took was to extract it via |
(I think we can ignore the |
We can ignore the codecov failure as you have only changed two lines! |
Merged! 💥 |
I'll get an Issue opened to collate further work we could do for enhancements, when other priorities are cleared. This will largely be from movement of text from my initial comment, but I will migrate uncompleted items contained in #2651 to this new Issue, so it's distinct end goal according to its strict title, i.e. the documentation conversion, can be marked as closed. |
This PR
Addresses #2651 (by title & opening description, where subsequent comments extend the scope). Minimal (:eight_spoked_asterisk:) reformulation of the core documentation to be auto-generated with Sphinx, to replace the LaTeX-sourced Cylc User & Suite Design Guides:
doc/
, notably excluding the Cylc "index" homepage, which after this PR still remains & links across to the Sphinx docs index page.cylc documentation
accordingly & set-up a new admin command,cylc make-docs
, to build the docs, which for the moment at least simply wraps the Sphinx HTML build command.Review process
To build & view (from the new index page):
cylc make-docs
to build.cylc documentation
to access the HTML index page & navigate around e.g. via the sidebar to view.For review, I suggest at least one reviewer needs to:
Note:
❗ (as-is) requires no higher than Sphinx version1.2.x
, which is that on the MO RHEL6 environment, so downgrade yourpython-sphinx
package if necessary. With a later version, you will get errors &/or warnings upon building. We should agree the version to converge upon going forward, then I can make amendments accordingly.version range >= 1.5.3, <= 1.7.9 agreed
find . -type f | wc -l
= 158) & the fact that the.tex
to.rst
file extension changes are not registered as a split-up & rename. Only ~40 files essentially have been amended, mostly corresponding to partitioning the CUG into files for each section.[Initial follow-on work listing moved into #2933.]