-
Notifications
You must be signed in to change notification settings - Fork 17
Sphinx use #467
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
Merged
James Bruten (james-bruten-mo)
merged 6 commits into
MetOffice:github_wps
from
jennyhickson:sphinx_use
Oct 17, 2025
Merged
Sphinx use #467
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
49a580e
reorganise the documentation
jennyhickson 69c4609
Merge remote-tracking branch 'origin/github_wps' into sphinx_use
jennyhickson 8e89421
Apply suggestion from @james-bruten-mo
jennyhickson 15b78ab
Apply suggestion from @james-bruten-mo
jennyhickson 253fe73
update title
jennyhickson d54e983
Merge branch 'sphinx_use' of github.com:jennyhickson/simulation-syste…
jennyhickson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,60 @@ | ||
| .. _docs: | ||
|
|
||
| Documentation | ||
| ------------- | ||
| ============= | ||
|
|
||
| All projects have their own scientific and technical documentation. Most | ||
| notably: | ||
|
|
||
| +----------------------------+-----------------------------+-------------------------------------------------+ | ||
| | UM Documentation Papers |`view UM`_ | `edit UM`_ | | ||
| +----------------------------+-----------------------------+-------------------------------------------------+ | ||
| | JULES User Guide |`view JULES`_ | :doc:`edit JULES <jules_docs>` | | ||
| +----------------------------+-----------------------------+-------------------------------------------------+ | ||
| | LFRic Documentation Papers |`view LFRic`_ | `edit LFRIc`_ | | ||
| +----------------------------+-----------------------------+-------------------------------------------------+ | ||
| +----------------------------+-----------------------------+ | ||
| | UM Documentation Papers |`view UM`_ | | ||
| +----------------------------+-----------------------------+ | ||
| | JULES User Guide |`view JULES`_ | | ||
| +----------------------------+-----------------------------+ | ||
| | LFRic Core |`view LFRic Core`_ | | ||
| +----------------------------+-----------------------------+ | ||
| | LFRic Apps |`view LFRic Apps`_ | | ||
| +----------------------------+-----------------------------+ | ||
|
|
||
| .. _view UM: https://code.metoffice.gov.uk/doc/um/latest/umdp.html | ||
| .. _view JULES: https://jules-lsm.github.io/latest/index.html | ||
| .. _view LFRic Core: https://metoffice.github.io/lfric_core/ | ||
| .. _view LFRic Apps: https://metoffice.github.io/lfric_apps/ | ||
|
|
||
| LFRic Apps and Core also use doxygen to document the code and all changes | ||
| should include appropriate doxygen changes to go with them. Doxygen guidelines | ||
| are available on the `LFRic Technical pages | ||
| <https://code.metoffice.gov.uk/trac/lfric/wiki/LFRicTechnical/Documentation/DoxygenUsage>`__. | ||
| Increasingly this documentation is stored as restructuredText markdown files | ||
| alongside the code. This is then compiled using Sphinx into the webpages above. | ||
|
|
||
| .. toctree:: | ||
| :hidden: | ||
| :maxdepth: 1 | ||
|
|
||
| sphinx_docs | ||
| jules_docs | ||
|
|
||
| .. _view UM: https://code.metoffice.gov.uk/doc/um/latest/umdp.html | ||
| .. _edit UM: https://code.metoffice.gov.uk/trac/um/wiki/WorkingPractices/Documentation/UpdatingUMDPs | ||
| .. _view JULES: https://jules-lsm.github.io/latest/index.html | ||
| .. _edit JULES: https://code.metoffice.gov.uk/trac/jules/wiki/BuildingEditingUserGuide | ||
| .. _view LFRic: https://code.metoffice.gov.uk/trac/lfric/wiki/LFRicDocumentationPapers | ||
| .. _edit LFRIc: https://code.metoffice.gov.uk/trac/lfric/wiki/LFRicTechnical#Documentation | ||
| .. admonition:: | ||
| update with relevant UM details. Add a page to the toctree above? | ||
|
|
||
| The UM documentation papers are written in LaTeX and stored in a separate | ||
| repository. Guidelines for editing the UM documentation papers are available | ||
| here `https://code.metoffice.gov.uk/trac/um/wiki/WorkingPractices/Documentation | ||
| /UpdatingUMDPs`_. | ||
|
|
||
| LFRic Apps and Core also use doxygen to document the code and all changes | ||
| should include appropriate doxygen changes to go with them. Doxygen guidelines | ||
| are available in the `LFRic Core Documentation | ||
| <https://metoffice.github.io/lfric_core/how_to_contribute/style_guides/doxygen_style_guide.html>`_. | ||
|
|
||
| Small changes and bug fixes rarely need documentation to be updated, but when | ||
| new science is added to a project, the documentation must be updated to ensure | ||
| that it remains contemporary with the code. | ||
|
|
||
| Documentation changes that are held within a repository should be documented | ||
| with issues and pull requests, are formally reviewed, and should be included | ||
| on the same branch as the code changes. Apply the `Documentation` label to your | ||
| pull request. | ||
|
|
||
| .. tip:: | ||
|
|
||
| Searching the relevant documentation for words related to your change is | ||
| often useful when deciding whether to update the documentation. | ||
|
|
||
| Documentation changes that are held within a repository are formally reviewed, | ||
| and should be included on the same ticket as the code changes - making sure | ||
| both code and docs branches are clearly listed and the `doc` keyword is | ||
| applied. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| .. _sphinx: | ||
|
|
||
| Sphinx Documentation | ||
| ==================== | ||
| The documentation is written in plain text files using a markup language called | ||
| reStructuredText. The text files have the extension ``.rst``. Sphinx can | ||
| take these text files and generate both HTML and PDF documentation from them | ||
| (complete with cross-referencing links, etc.). Since reStructuredText is a | ||
| plain text format, your favourite text editor is all you need to edit the | ||
| documentation. | ||
|
|
||
| .. tip:: | ||
| The `Sphinx documentation <https://www.sphinx-doc.org/en/master/>`_ is an | ||
| useful resource. | ||
|
|
||
|
|
||
| Building the JULES User Guide | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure this title is relevant now?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
| ----------------------------- | ||
|
|
||
| Please create the production environment to build the | ||
| documentation (first time users only), and then activate it. | ||
|
|
||
| .. tab-set:: | ||
|
|
||
| .. tab-item:: JULES | ||
|
|
||
| From the top level of the repository: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| conda env create -f environment.yml | ||
|
|
||
| Activate the environment: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| conda activate jules-user-guide | ||
|
|
||
| .. tab-item:: LFRic Apps and Core | ||
|
|
||
| On the Met Office Azure Spice machine the main LFRic module environment | ||
| contains all the required packages to build the documentation. Ensure | ||
| this is loaded. | ||
|
|
||
| Note there is a `style guide included in the LFRic Core documentation | ||
| <https://metoffice.github.io/lfric_core/how_to_contribute/style_guides | ||
| /documentation_style_guide.html>`_ that should be followed for both | ||
| these repositories. | ||
|
|
||
| .. tab-item:: Working Practices | ||
|
|
||
| From the top level of the repository: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| conda env create -f env.yml | ||
|
|
||
| Activate the environment: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| conda activate sphinx_doc_env | ||
|
|
||
| Move to the documentation directory and run ``make`` to build the documentation: | ||
|
|
||
| To build and view the HTML documentation: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| make [clean] html | ||
| firefox build/html/index.html | ||
|
jennyhickson marked this conversation as resolved.
Outdated
|
||
|
|
||
| To build and view the PDF documentation: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| make latexpdf | ||
| evince build/latex/JULES_User_Guide.pdf | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.