Skip to content

Commit 3df6f01

Browse files
author
Release Manager
committed
gh-40681: Add subsection Documentation Previews to developer guide <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> as promised in #40586 (comment) The added text highlights features of the documentation previews broken as of 10.8.beta2: - PDF icons should not appear in the HTML documentation previews for PRs. - TESTS blocks should appear in the HTML documentation previews for PRs. - "Sage" "Python" "Sage Live" tabs should appear in the full live documentation for releases (perhaps side effects of the "missing sagemath kernel" issue #40586 (comment)). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40681 Reported by: Kwankyu Lee Reviewer(s):
2 parents 4758b85 + 1129d51 commit 3df6f01

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

src/doc/en/developer/github.rst

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,18 +469,64 @@ Actions.
469469
<https://github.com/orgs/sagemath/packages?tab=packages&q=with-targets-optional>`_
470470
exists.
471471

472-
* The `build documentation workflow
472+
* The `documentation build workflow
473473
<https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-build.yml>`_
474474
on GitHub Actions builds the HTML documentation for the current branch.
475475

476-
A link to the built doc is added in a comment, and so you can easily inspect changes
477-
to the documentation without the need to locally rebuild the docs yourself.
476+
A link to the built doc is added in a comment, and so you can easily inspect
477+
changes to the documentation of the current branch without the need to
478+
locally rebuild the docs yourself.
478479

479-
If the doc build fails, you can go to Actions tab and examine `documentation
480-
build workflow
480+
If the doc build fails, you can go to Actions tab and examine `runs of the
481+
documentation build workflow
481482
<https://github.com/sagemath/sage/actions/workflows/doc-build.yml>`_ and
482483
choose the particular branch to see what went wrong.
483484

485+
Documentation Previews
486+
======================
487+
488+
We value documentation as much as the code. Hence the Sage GitHub repo provides
489+
documentation previews before a stable release is published to the official
490+
site `<https://doc.sagemath.org>`_. Developers are expected to check the
491+
previews. Several GitHub workflows work together to create the previews.
492+
493+
As mentioned above, for a check on a PR (say #12345), an HTML documentation
494+
preview is published to `<https://doc-pr-12345--sagemath.netlify.app>`_ by the
495+
`documentation publish workflow
496+
<https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-publish.yml>`_
497+
which uses the ``doc`` artifact built by the `documentation build workflow
498+
<https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-build.yml>`_.
499+
The run of the build workflow provides the ``doc`` artifact containing the html
500+
files.
501+
502+
The documentation preview for a PR is accompanied by a "changes" log, which is
503+
generated from diffs of the htmls in the ``doc`` artifact and the htmls for the
504+
latest release in the ``doc-develop`` artifact. To facilitate this, on every
505+
release, the build workflow creates the ``doc-develop`` artifact and the
506+
publish workflow publishes the html documentation to
507+
`<https://doc-develop--sagemath.netlify.app>`_.
508+
509+
PDF docs are also built for a PR by the `PDF build workflow
510+
<https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-build-pdf.yml>`_.
511+
The PR author should check the success of the PDF build workflow before
512+
requesting review. If the workflow failed, check the run of the workflow.
513+
514+
The HTML documentation preview for a PR does not include PDF docs, which take
515+
much longer time to build than the HTML docs. On the other hand, the
516+
HTML documentation preview and PDF docs contain TESTS blocks to enable the
517+
PR author to check newly added TESTS blocks. The official documentation for end
518+
users do not contain TESTS blocks.
519+
520+
Finally, on every release, the full documentation including PDF docs and
521+
featured with live (runnable) Examples (but no TESTS blocks) is built and
522+
published to `<https://doc-release--sagemath.netlify.app>`_, a link to which is
523+
in the `Documentation section of the GitHub Wiki
524+
<https://github.com/sagemath/sage/wiki#documentation-for-last-release>`_. The
525+
`livedoc build workflow
526+
<https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-build-livedoc.yml>`_
527+
creates the ``livedoc`` artifact used by the `livedoc publish workflow
528+
<https://github.com/sagemath/sage/blob/develop/.github/workflows/doc-publish-livedoc.yml>`_
529+
to publish the full documentation.
484530

485531
Final notes
486532
===========

0 commit comments

Comments
 (0)