Closed Bug 2067092 Opened 3 months ago Closed 2 months ago

doc: drop reStructuredText support from ./mach doc

Categories

(Developer Infrastructure :: Source Documentation, task)

task

Tracking

(firefox157 fixed)

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(7 external files)

The in-tree documentation is now written entirely in Markdown, so ./mach doc no longer needs to parse reStructuredText.

Two things still produce RST:

  • build/docs/mozbuild-symbols.rst, the last .rst file left in the documentation build.
  • sphinx.ext.apidoc, which generates the Python API reference pages (python/mozbuild, python/mach, ...) as .rst at build time.

Dropping .rst from source_suffix in docs/conf.py requires:

  • converting build/docs/mozbuild-symbols.rst and reworking the mozbuildsymbols directive in python/mozbuild/mozbuild/sphinx.py, which relies on state_machine.insert_input() (not implemented by MyST's mock state machine);
  • pointing sphinx.ext.apidoc at MyST templates so the Python API pages are generated as Markdown;
  • cleaning up the remaining .rst references in docs/config.yml, tools/moztreedocs/, and in the documentation about the documentation.

eval-rst blocks stay supported: they are a MyST feature, independent of source_suffix, and are used to embed autodoc output whose docstrings are written in RST.

The mozbuildsymbols directive fed its generated reStructuredText back into the
including document with state_machine.insert_input(), which MyST does not
implement, so the page could not be converted to Markdown. Parse the generated
rst in a document of its own instead and return the resulting nodes.

Two details the move needs: the nodes cache the document they were parsed in,
which breaks the parent chain sphinx.ext.autosectionlabel walks, and the
mozbuild_subcontext_* targets are recorded on the throwaway document, so they
have to be carried over to stay referenceable.

Assignee: nobody → sledru
Status: NEW → ASSIGNED

sphinx.ext.apidoc emits reStructuredText by default, which is the last thing
in the build producing rst. Point it at Markdown templates and generate the
pages with a .md suffix. The automodule calls stay inside eval-rst fences
so the Python docstrings, which are written in rst, keep being parsed as rst.

The marionette docstrings relied on named hyperlink targets, whose definitions
do not resolve across an eval-rst boundary; use embedded URIs instead. Also
update the links pointing at the generated marionette_driver page.

Every page is Markdown now, so drop .rst from source_suffix and clean up the
.rst references left in the configuration, in mach doc itself, and in the
documentation about the documentation.

eval-rst blocks are unaffected: they are a MyST feature, independent of
source_suffix.

The rst linter was removed in bug 2038819, so these % rstcheck: comments no
longer configure anything.

The perfdocs linter reads index.md and metrics.md; the page still described
them as rst files.

Drop the rstcheck linter, removed in bug 2038819, from the mozlint skill, and
the mentions of .rst sources from the documentation skill.

The mzl.la shortlink and the Add-on Manager page on MDN are both gone.
Point at the in-tree localization docs and at the AddonManager.ERROR_*
constants instead.

Attachment #9631615 - Attachment description: Bug 2067092 - Build the mozbuild sandbox symbols reference without insert_input. r?#firefox-build-system-reviewers → Bug 2067092 - Generate the mozbuild sandbox symbols reference as Markdown. r?#firefox-build-system-reviewers
Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/63d8c55fcfa4 https://hg.mozilla.org/integration/autoland/rev/cd07e5e07f7c Generate the mozbuild sandbox symbols reference as Markdown. r=firefox-build-system-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/6f15ec52a4f2 https://hg.mozilla.org/integration/autoland/rev/d130c6e1368d Generate the Python API documentation as Markdown. r=firefox-source-docs-reviewers,jdescottes,ahal https://github.com/mozilla-firefox/firefox/commit/e709bfa957c7 https://hg.mozilla.org/integration/autoland/rev/e308123a029e Stop building the documentation from reStructuredText. r=firefox-source-docs-reviewers,ahal https://github.com/mozilla-firefox/firefox/commit/ecb4c3c5c23c https://hg.mozilla.org/integration/autoland/rev/e1bfe88461f7 Remove the leftover rstcheck comments. r=devtools-reviewers,geckoview-reviewers,chutten,ochameau,tcampbell https://github.com/mozilla-firefox/firefox/commit/b125c966ee9a https://hg.mozilla.org/integration/autoland/rev/6b5dac011326 Document the perfdocs files with the extension they actually use. r=firefox-source-docs-reviewers,ahal https://github.com/mozilla-firefox/firefox/commit/62f88e0aefea https://hg.mozilla.org/integration/autoland/rev/8c960b512c39 Update the agent skills for the Markdown-only documentation. r=ai4dev-reviewers,suhaib https://github.com/mozilla-firefox/firefox/commit/0ac7be08f030 https://hg.mozilla.org/integration/autoland/rev/894540a4bf25 Replace the dead MDN links in the Marionette and Remote Agent comments. r=jdescottes
Blocks: 2071162
No longer blocks: 2071162
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: