Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Just like you compile and test your Fortran before committing it, you should “compile” and view your documentation before committing and pushing the branch. Unlike compiling and running the model, the documentation can be easily built and displayed on your laptop. Here is one way to do thatBut first you need to install the python programs needed to build the documentation.

Set up documentation development environment.

You only have to do this once and on each machine you wish to use for writing documentation.

...

Info

An alternative to mkdocs serve is to access to the docs directly without serving them through a URL. To achieve this, one could you load file:///E3SM_ROOT/site/index.html in a modern browser like Chrome (in place of a URL). In this case, E3SM_ROOT is the full path to the clone E3SM repository on your local machine where you built the docs. One could directly go to other pages as needed using the same method (e.g., file:///E3SM_ROOT/site/EAM/index.html). Note NOTE that as you click on links that are in subdirectories, you’ll see the list of files instead of the rendered content. Click on “index.html” when that happens. Use the mkdocs built-in server to avoid this.

As you edit the documentation, mkdocs will rerun the “mkdocs build” command build and refresh the website in your browserbrowser will update as soon as you hit “save” on a markdown file. The output of “mkdocs build” will tell you if you have a syntax error in your markdown files. The website in your browser will let you know if it looks as you intended.

...

  • tunnel a port to chrysalis from your local machine (e.g., ssh -L 12345:localhost:12345 username@chrysalis.lcrc.anl.gov)

  • use e3sm-unified (e.g., source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh)

  • develop the docs in your preferred editor

  • (optionally, starting in e3sm_unified 1.10.0, use the linter, e.g., markdownlint-cli2 <my_md_files>)

  • starting in 1.9.3, use mkdocs serve with that port (e.g., mkdocs serve -a localhost:12345)

  • then, open the link it prints in your local browser (e.g., localhost:12345)

  • (note that you can continue editing and your edits should appear live in the browser window very shortly after making the edits)

...