-
Notifications
You must be signed in to change notification settings - Fork 353
Update documentation documentation #3908
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
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
16c688f
Docs docs: Move "One-time setup" section.
samsrabin b226df9
Update doc-builder: Add fallback for container build on Casper.
samsrabin 3bf635b
docs-intro-and-recommended.md: Add Casper instructions (preferred).
samsrabin 4409511
Reorder working-with-documentation index page.
samsrabin bd7801d
Testing whether ESMCI/doc-builder#27 is resolved by commenting out code.
samsrabin db8c10e
Update doc-builder to v2.2.8: Podman multi-version build on Casper wo…
samsrabin 23a62b4
Fallback instructions: Download html/ dir and open locally.
samsrabin 84da9d1
Reorganize docs docs.
samsrabin 88724c2
Add instructions for previewing docs on Casper via OnDemand.
samsrabin 40faddf
Link docs contrib guidelines in issue and PR templates.
samsrabin a70a6e4
Improve "Common docs errors" page.
samsrabin a834769
Add documentation style guide.
samsrabin 4d4f17c
Docs now use MyST Markdown parser.
samsrabin 825c0aa
Fix some docs tests.
samsrabin 025d55b
Update doc-builder to v3.0.1: Fix CTSM tests broken by MyST parser.
samsrabin 3d0b96e
Docs docs: Add instructions for admonitions.
samsrabin baab89f
Previewing docs on Casper with OnDemand: Need to be in home dir.
samsrabin 2d6cffc
Note that git-fleximod checkout of doc-builder shouldn't be necessary
samsrabin 2c79335
Explain how to find doc source files.
samsrabin 721d56d
Mention VS Code extension for MyST Markdown.
samsrabin bba586d
Fix a code snippet.
samsrabin decd2ab
Add workaround for "Error: could not find a working conmon binary".
samsrabin 672a347
Clarify how custom titles for MyST admonitions work.
samsrabin 16842da
Casper preview doesn't NEED checkout in home dir.
samsrabin 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
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
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
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
Submodule doc-builder
updated
7 files
| +2 −10 | build_docs_to_publish | |
| +10 −1 | conf.py | |
| +1 −1 | doc_builder/build_commands.py | |
| +30 −1 | doc_builder/build_docs.py | |
| +10 −1 | test/conf.py | |
| +161 −0 | test/test_unit_fix_command_for_missing_subids.py | |
| +9 −4 | test/test_unit_get_build_command.py |
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
77 changes: 77 additions & 0 deletions
77
doc/source/users_guide/working-with-documentation/bld-prev-docs-casper.md
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,77 @@ | ||
| (bld-prev-docs-casper)= | ||
|
|
||
| # Building and previewing the documentation on Casper (RECOMMENDED) | ||
|
|
||
| ```{contents} | ||
| :depth: 1 | ||
| :local: | ||
| ``` | ||
|
|
||
| ## Initial Casper setup | ||
|
|
||
| You don't need to install any software! This is why Casper is the recommended method for building and previewing the docs. | ||
|
|
||
| ## Building docs on Casper | ||
| Casper uses the Podman software for running containers like the one we recommend for building the CTSM documentation. Make sure it's enabled before building: `module load podman`. Then do: | ||
|
|
||
| ```{include} embed-build-cmd.md | ||
| ``` | ||
|
|
||
| See the "Container software or Conda environment" sections for {ref}`Mac <container-or-conda-mac>` or {ref}`Windows <container-or-conda-windows>` for more information on these two methods. | ||
|
|
||
| ```{tip} | ||
| [2026-04-07] If you get an error saying something like `Error: could not find a working conmon binary`, do this and retry: | ||
| ~~~ | ||
| module load ncarenv/24.12 | ||
| module load podman | ||
| ~~~ | ||
| The bug making this necessary should hopefully be resolved soon. It has to do with the installation of podman in the module `ncarenv/25.10`; see [this Slack thread](https://ncarhpcusergroup.slack.com/archives/C044MS8N3UP/p1775511217126589) for more information. | ||
| ``` | ||
|
|
||
| ## Previewing docs on Casper | ||
|
|
||
| There are a few different ways to do this. | ||
|
|
||
| ### Previewing docs on Casper with OnDemand | ||
|
|
||
| ```{tip} | ||
| This will be somewhat easier if your CTSM checkout is in (or symlinked to) your home directory (`$HOME`). | ||
| ``` | ||
|
|
||
| The simplest way to preview your built documentation on Casper is to use [NCAR's OnDemand service](https://ondemand.hpc.ucar.edu/pun/sys/dashboard). After you [open a new Casper Login VNC Desktop session](https://ondemand.hpc.ucar.edu/pun/sys/dashboard/batch_connect/sys/login_desktop_ncar/session_contexts/new), wait for it to start, then click the "Launch Casper Login VNC Desktop" button. This will open a Linux desktop in your browser. Click on the "Home" icon and navigate to your CTSM checkout, then the `doc/_build/html` directory, then open the `index.html` file. (If your checkout isn't in your home directory, you'll need to click on `Devices > /` in the sidebar of the window that opens, then navigate all the way to your checkout.) That should open it in the Linux desktop's Firefox, at which point you can browse around as usual. | ||
|
|
||
| If you rebuild the documentation but don't see your changes updated in the webpage, and the reload button doesn't work, you may need to navigate to a different page and then come back. | ||
|
|
||
| ### Previewing docs on Casper via SSH tunnel | ||
|
|
||
| If the OnDemand method doesn't work for whatever reason, open a terminal on your local machine and do this: | ||
| ```shell | ||
| ssh YOUR_USERNAME@casper.hpc.ucar.edu echo $((10000 + $(id -u) % 50000)) | ||
| ``` | ||
|
|
||
| This will print an integer that we will call `YOUR_PORT`. | ||
|
|
||
| Then open a new SSH connection to the server like so, replacing `YOUR_PORT` with the integer you got above: | ||
| ```shell | ||
| ssh -L YOUR_PORT:localhost:YOUR_PORT YOUR_USERNAME@casper.hpc.ucar.edu | ||
| ``` | ||
|
|
||
| Once that's connected, we're going to spin up a web server. It's best to do this on a compute node rather than a login node. Use the `qinteractive` command to open an interactive session on a Casper compute node. (Find more info about `qinteractive` [here](https://ncar-hpc-docs.readthedocs.io/en/latest/pbs/#qinteractive).) | ||
|
|
||
| Once your interactive compute session is open, start the web server in it like so (again replacing `YOUR_PORT`): | ||
| ```shell | ||
| cd /path/to/your/ctsm/repo | ||
| cd doc/_build/html | ||
| python3 -m http.server YOUR_PORT | ||
| ``` | ||
|
|
||
| Now you're ready to view your documentation! Just open a web browser on your computer and navigate to `http://localhost:YOUR_PORT`. You should see a rendered version of the documentation that you can browse as usual. | ||
|
|
||
| ### Fallback preview method | ||
|
|
||
| If neither of the above work, you can download the `doc/_build/html` directory to your computer (e.g., with `scp` or `rsync`) and open `html/index.html` in a web browser. | ||
|
|
||
| ### A note about previewing the docs | ||
|
|
||
| ```{include} embed-preview-menu.md | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
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.