Add MyST-Parser and link community files in docs sidebar#835
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #835 +/- ##
=======================================
Coverage 78.19% 78.19%
=======================================
Files 41 41
Lines 4788 4788
Branches 547 547
=======================================
Hits 3744 3744
Misses 905 905
Partials 139 139 |
|
Need to decide how to deal w/ https://github.com/cherrypy/cheroot/actions/runs/28755500504/job/85261942391#step:16:82. I think where were a few toggles in the Sphinx config. One way could be cutting the doc on inclusion. I'd need to check how I used to handle this in other places but if you want to look, the solution is probably in one of sphinx-contrib/towncrier, ansible/pylibssh, ansible/awx-plugins or jazzband/pip-tools. |
| furo | ||
| myst-parser | ||
| sphinx-issues # Sphinx roles providing support for linking GitHub | ||
| sphinxcontrib-apidoc >= 0.3.0 |
There was a problem hiding this comment.
For the future: modern versions of Sphinx can do this natively, we should try to migrate some day.
| @@ -0,0 +1,3 @@ | |||
| Added ``myst-parser`` to enable Markdown support in Sphinx documentation, | |||
There was a problem hiding this comment.
I think sphinx-issues provides a :pypi: role. Let's try it out:
| Added ``myst-parser`` to enable Markdown support in Sphinx documentation, | |
| Added :pypi:`myst-parser` to enable Markdown support in Sphinx documentation, |
| @@ -0,0 +1,3 @@ | |||
| Added ``myst-parser`` to enable Markdown support in Sphinx documentation, | |||
| and linked the Code of Conduct and License in the docs sidebar | |||
There was a problem hiding this comment.
We could also reference said docs via relevant Sphinx roles.
| Code of Conduct <code_of_conduct> | ||
| License <license> |
There was a problem hiding this comment.
Instead of putting these on the top-level, have the docs under the contrib dir. Just like the guidelines above.
There was a problem hiding this comment.
Also, no need to add explicit titles in two places if they don't differ.
| @@ -0,0 +1,4 @@ | |||
| # License | |||
There was a problem hiding this comment.
This breaks the docs build: https://app.readthedocs.org/projects/cheroot/builds/33450467/#328554371--132. There's even not PR preview because the build doesn't complete.
There was a problem hiding this comment.
Is this a symlink? No need to do this. Use the Sphinx-native include role like https://github.com/ansible/pylibssh/blob/0efb3df9a8f1a32ba7ac0c4ee073b950481e0527/docs/contributing/code_of_conduct.rst?plain=1#L1 / https://github.com/ansible/awx-plugins/blob/7c6a7cf97ec1e2ed3c36c0dd2e0dbb29436dea78/docs/contributing/code_of_conduct.md?plain=1#L1
| sphinx-tabs >= 1.1.0 | ||
|
|
||
| furo | ||
| myst-parser |
There was a problem hiding this comment.
I've started annotating the direct dep additions w/ their purpose in other projects
| myst-parser | |
| myst-parser[linkify] # Markdown documents support w/ in-text link detector |
| 'sphinx.ext.intersphinx', | ||
| # Third-party extensions: | ||
| 'jaraco.packaging.sphinx', | ||
| 'myst_parser', |
There was a problem hiding this comment.
| 'myst_parser', | |
| 'myst_parser', # extended markdown; https://pypi.org/p/myst-parser |
There was a problem hiding this comment.
I'm not entirely sure we should be rendering the license text in the docs. A lot of projects just have it in the packaging metadata + GH. But if you fix the build, we could see how it renders, I suppose.
Otherwise, I'd just postpone. Having CoC included should be enough to test how MyST-Parser integrates and would give us the build infra for adding more Markdown separately w/o having to think about the configuration bits.
|
|
||
| # local | ||
| "furo", | ||
| "myst-parser", |
There was a problem hiding this comment.
Let's not include this change. I think we should be able to get rid of the docs extra here as it's an ancient leftover. Try doing so in a separate PR to see if anything depends on this docs extra.
|
I think #828 should be completed first to reduce the amount of noise in CI as it's difficult to sort through the unrelated failures otherwise. |
Documentation build overview
3 files changed+ contributing/code_of_conduct/index.html± history/index.html± pkg/cheroot.server/index.html |
Add myst-parser to docs dependencies and Sphinx extensions, enabling Markdown support. Link the Code of Conduct in the docs sidebar as an initial test of the integration.
| @@ -0,0 +1,3 @@ | |||
| Added :pypi:`myst-parser` to enable Markdown support in Sphinx documentation, | |||
| and linked the Code of Conduct in the docs sidebar | |||
There was a problem hiding this comment.
Can we make that Code of Conduct a link? Would a :ref: work? Or something similar?
There was a problem hiding this comment.
@julianz- as an alternative, this should work
| and linked the Code of Conduct in the docs sidebar | |
| and linked the :doc:`Code of Conduct <contributing/code_of_conduct>` in the docs sidebar |
| :hidden: | ||
|
|
||
| contributing/guidelines | ||
| contributing/code_of_conduct |
There was a problem hiding this comment.
I didn't realize the CoC doc title was so long. Let's make the sidebar link shorter for now and maybe improve it later if needed.
| contributing/code_of_conduct | |
| Code of Conduct <contributing/code_of_conduct> |
There was a problem hiding this comment.
Sure. I also renamed "Private (dev) API autodoc" to "Internal API" in the sidebar as I thought the old name looks quite clunky. Happy to revert or use a different label if you prefer something else.
There was a problem hiding this comment.
I'm not sure about the internal API. This isn't in the scope of the PR and I'm also not sure how to name it. That name might be long but it's clear that it's not for public consumption and it just a dump of something generated w/o careful curating. Maybe, once we get to documenting the public API and pick the public and private bits apart, into different sections, it'll make sense to thing of better naming as a part of that move.
There was a problem hiding this comment.
Calling it "Private" though seems counter intuitive. It's the whole API currently no?
Add myst-parser to docs dependencies and Sphinx extensions, enabling Markdown support. Link the Code of Conduct and License in the docs sidebar as an initial test of the integration.
❓ What kind of change does this PR introduce?
📋 What is the related issue number (starting with
#)Resolves #
❓ What is the current behavior? (You can also link to an open issue here)
❓ What is the new behavior (if this is a feature change)?
📋 Other information:
📋 Contribution checklist:
(If you're a first-timer, check out
[this guide on making great pull requests][making a lovely PR])
the changes have been approved
and description in grammatically correct, complete sentences