Skip to content

Commit b61a047

Browse files
authored
Merge pull request #87 from jr3cermak/esmg-test
Doxygen support for 1.8.13 through 1.8.20
2 parents 6e80f9b + a718f79 commit b61a047

11 files changed

Lines changed: 119 additions & 90 deletions

File tree

.github/workflows/documentation-and-style.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
continue-on-error: true
1919

2020
- name: Install packages used when generating documentation
21-
run: >
22-
sudo apt-get install
23-
python3-sphinx python3-lxml perl
24-
texlive-binaries texlive-base bibtool tex-common texlive-bibtex-extra
25-
graphviz
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install python3-sphinx python3-lxml perl
24+
sudo apt-get install texlive-binaries texlive-base bibtool tex-common texlive-bibtex-extra
25+
sudo apt-get install graphviz
2626
2727
- name: Build doxygen HTML
2828
run: |

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ jobs:
2323
- name: Create validation data
2424
run: make run.symmetric -k -s
2525

26-
- name: Regression test
26+
- name: Regression test
2727
run: make test.regressions DO_REGRESSION_TESTS=true -k -s

.readthedocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
version: 2
22

33
# Extra formats
4-
formats:
5-
- pdf
4+
# PDF generation is failing for now; disabled on 2020-12-02
5+
#formats:
6+
# - pdf
67

78
# Build documentation
89
sphinx:

docs/Doxyfile_nortd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ ALIASES += footnote{1}="\latexonly\footnote\{\1\}\endlatexonly\htmlonly<sup titl
279279
# what it does and just passes through the string uninterpreted.
280280
# The image also needs to be added to LATEX_EXTRA_FILES.
281281
# Default 3rd argument: \includegraphics[width=\textwidth\,height=\textheight/2\,keepaspectratio=true]
282-
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\n\3{\1}\n\doxyfigcaption{\2}\n\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
282+
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\3{\1}\doxyfigcaption{\2}\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
283283

284284
# This tag can be used to specify a number of word-keyword mappings (TCL only).
285285
# A mapping has the form "name=value". For example adding "class=itcl::class"

docs/Doxyfile_nortd_latex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ ALIASES += footnote{1}="\latexonly\footnote\{\1\}\endlatexonly\htmlonly<sup titl
279279
# what it does and just passes through the string uninterpreted.
280280
# The image also needs to be added to LATEX_EXTRA_FILES.
281281
# Default 3rd argument: \includegraphics[width=\textwidth\,height=\textheight/2\,keepaspectratio=true]
282-
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\n\3{\1}\n\doxyfigcaption{\2}\n\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
282+
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\3{\1}\doxyfigcaption{\2}\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
283283

284284
# This tag can be used to specify a number of word-keyword mappings (TCL only).
285285
# A mapping has the form "name=value". For example adding "class=itcl::class"

docs/Doxyfile_rtd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ ALIASES += footnote{1}="\latexonly\footnote\{\1\}\endlatexonly\htmlonly<sup titl
256256
# what it does and just passes through the string uninterpreted.
257257
# The image also needs to be added to LATEX_EXTRA_FILES.
258258
# Default 3rd argument: \includegraphics[width=\textwidth\,height=\textheight/2\,keepaspectratio=true]
259-
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\n\3{\1}\n\doxyfigcaption{\2}\n\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
259+
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\3{\1}\doxyfigcaption{\2}\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
260260

261261
# This tag can be used to specify a number of word-keyword mappings (TCL only).
262262
# A mapping has the form "name=value". For example adding "class=itcl::class"

docs/Doxyfile_rtd_dox

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ ALIASES += footnote{1}="\latexonly\footnote\{\1\}\endlatexonly\htmlonly<sup titl
256256
# what it does and just passes through the string uninterpreted.
257257
# The image also needs to be added to LATEX_EXTRA_FILES.
258258
# Default 3rd argument: \includegraphics[width=\textwidth\,height=\textheight/2\,keepaspectratio=true]
259-
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\n\3{\1}\n\doxyfigcaption{\2}\n\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
259+
ALIASES += imagelatex{3}="\latexonly\begin{DoxyImage}\3{\1}\doxyfigcaption{\2}\end{DoxyImage}\endlatexonly\xmlonly<image type=\"latex\" name=\"\1\">\2</image>\endxmlonly"
260260

261261
# This tag can be used to specify a number of word-keyword mappings (TCL only).
262262
# A mapping has the form "name=value". For example adding "class=itcl::class"
@@ -814,12 +814,24 @@ INPUT = ../src \
814814
../config_src/dynamic_symmetric \
815815
../config_src/external \
816816
../config_src/coupled_driver \
817-
../src/core/MOM.F90 \
818817
../src/ALE/MOM_ALE.F90 \
818+
../src/ALE/PCM_functions.F90 \
819+
../src/core/MOM.F90 \
820+
../src/core/MOM_density_integrals.F90 \
821+
../src/diagnostics/MOM_wave_structure.F90 \
819822
../src/equation_of_state/MOM_EOS.F90 \
823+
../src/framework/MOM_diag_mediator.F90 \
824+
../src/framework/MOM_domains.F90 \
825+
../src/framework/MOM_dyn_horgrid.F90 \
826+
../src/framework/MOM_file_parser.F90 \
820827
../src/framework/MOM_unit_scaling.F90 \
821828
../src/ice_shelf/MOM_ice_shelf.F90 \
822-
../src/parameterizations/lateral/MOM_MEKE.F90
829+
../src/parameterizations/lateral/MOM_MEKE.F90 \
830+
../src/parameterizations/vertical/MOM_bkgnd_mixing.F90 \
831+
../src/parameterizations/vertical/MOM_energetic_PBL.F90 \
832+
../src/parameterizations/vertical/MOM_set_viscosity.F90 \
833+
../src/tracer/oil_tracer.F90 \
834+
../src/user/user_initialization.F90
823835

824836
# Basic testing units below
825837

docs/README.md

Lines changed: 22 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Doxygen in run in two modes. For the API manual, it is instructed to generate o
4242

4343
If the software is installed, local copies of html and pdf instead of those found at RTD. The html and pdf versions produced by doxygen will not have any of the additional documentation from the sphinx portion of the pipeline.
4444

45+
RTD by default runs html(sphinx) pipeline and adds a bit of styling. The RTD can be instructed to also produce a PDF. However, the current pipeline exceeds 900 seconds
46+
execution time and fails if RTD is instructed to generate the html and PDF in one session. By default, the PDF generation is currently turned off.
47+
4548
## Starting structure
4649

4750
We define `SRC` as the root of the source directory assuming the `$(SRC)` directory was created from downloading the tree from github using `git clone`.
@@ -96,7 +99,7 @@ on the [MOM6 developer's wiki](https://github.com/NOAA-GFDL/MOM6/wiki/Doxygen).
9699

97100
NOTE: Not all doxygen commands are supported through the sphinx documentation processor. Support can be added by adding an [issue](https://github.com/NOAA-GFDL/MOM6/issues) to the github repository.
98101

99-
For the API documentation, the tree will look like this:
102+
For the API documentation, the resultant tree will look like this:
100103
```
101104
SRC/
102105
docs/
@@ -107,7 +110,7 @@ SRC/
107110
MOM6.tags
108111
```
109112

110-
The main driver for doxygen is a configuration file. The content linked to [MOM6 developer's wiki](https://github.com/NOAA-GFDL/MOM6/wiki/Doxygen) uses the `Doxyfile_nortd` configuration file.
113+
The main driver for doxygen is a configuration file. The content on [MOM6 developer's wiki](https://github.com/NOAA-GFDL/MOM6/wiki/Doxygen) uses the `Doxyfile_nortd` configuration file.
111114

112115
By default, the html directory is only available after processing the documentation. Please see [software operation](software-operation) on how to generate the pdf companion of the documentation.
113116

@@ -121,7 +124,7 @@ SRC/
121124
MOM6.tags
122125
```
123126

124-
The documentation generated by Sphinx and RTD uses the `Doxyfile_rtd`. These options can be overridden at the command line. See software operation for more details.
127+
The documentation generated by Sphinx and RTD uses the `Doxyfile_rtd`. These options can be overridden at the command line. See [software operation](software-operation) for more details.
125128

126129
The `_build/doxygen_warn_rtd_log.txt` should be reviewed for warnings and errors.
127130

@@ -145,7 +148,7 @@ The `html_log.txt` should be reviewed for warnings and errors.
145148

146149
## Read the Docs
147150

148-
The RTD site can be configured to watch for updates on a github repository. A documentation update may be triggered when an update is pushed to the repository. The entire documentation process is run twice. The first run produces html. The second run produces a pdf.
151+
The RTD site can be configured to watch for updates on a github repository. A documentation update may be triggered when an update is pushed to the repository. The entire documentation process is run twice. The first run produces html. The second run produces a pdf (if so instructed).
149152

150153
NOTE: There is a rough execution time limit of about 900 seconds. Trying to do more than that will cause a "timeout" error.
151154

@@ -249,6 +252,7 @@ as RTD runs sphinx processing directly using `sphinx-build` and not the Makefile
249252
##### PAPER
250253

251254
The default value is empty (`PAPER=`). There are two options currently available in the Makefile (a4 or letter).
255+
The `PAPER` argument has no impact on html rendered content.
252256

253257
#### conf.py
254258

@@ -274,19 +278,6 @@ NOTE: This command does not have any impact if an existing binary is found.
274278

275279
This option activates the NCAR configuration file: `ncar/Doxyfile_ncar_rtd`
276280

277-
### Local web server
278-
279-
Python provides a way to quickly stand up a private web server for checking documentation. It requires knowledge of
280-
the IP address if you are using a remote server, otherwise `localhost` should work.
281-
282-
You can start the server on any port. Port 8080 is shown here as an example.
283-
```bash
284-
python3 -m http.server 8080
285-
```
286-
287-
After starting the server, you can browse to the known IP using `http://IP/` or if you are on the same
288-
machine use `http://localhost/`.
289-
290281
# Software installation
291282

292283
On a relatively bare system, you can install a fairly stable documentation pipeline.
@@ -346,7 +337,9 @@ PDF generation requires the following packages
346337

347338
### doxygen
348339

349-
Download latest [source](https://www.doxygen.nl/download.html). Latest is `doxygen-1.8.20.src.tar.gz`.
340+
You may choose to download the [source](https://www.doxygen.nl/download.html).
341+
342+
Latest is `doxygen-1.8.20.src.tar.gz`.
350343

351344
```bash
352345
tar xzf doxygen-1.8.20.src.tar.gz
@@ -358,15 +351,20 @@ make
358351
sudo make install
359352
```
360353

361-
Make install attempts to place the compiled version into /usr/local/bin. You can link to a
362-
specific executable within the virtual environment. At this point we also recommend
363-
renaming `doxygen` to `doxygen-1.8.20` within `/usr/local/bin`.
354+
The makefile for doxygen attempts to install the compiled version into /usr/local/bin.
355+
You can link to a specific executable within the virtual environment. At this point we
356+
also recommend renaming `doxygen` to `doxygen-1.8.20` within `/usr/local/bin`.
357+
358+
NOTE: The makefile for the documentation framework will attempt to compile a local doxygen
359+
binary of version 1.8.13 if a binary cannot be found in the `$PATH`.
364360

365361
#### Testing
366362

367-
Currently, the majority of testing has been done with the following versions:
363+
A lot of manual testing has been completed using the following versions:
368364
* 1.8.13
365+
* 1.8.14
369366
* 1.8.19
367+
* 1.8.20
370368

371369
### Read the Docs
372370

@@ -383,56 +381,6 @@ See Sphinx run options below. We capture up to three logfiles for RTD. The mai
383381
Logfiles were renamed to `*.txt` to allow easier access and viewing from most websites.
384382
Most websites force download of `*.log` files.
385383

386-
### python3 virtual enviroment
387-
388-
Setup a virtual environment for processing:
389-
390-
```bash
391-
python3 -m venv venv/mom6Doc
392-
source venv/mom6Doc/bin/activate
393-
# cd to the docs directory within the MOM6 repo
394-
pip3 install -r requirements.txt
395-
```
396-
397-
The `deactivate` command allows you to exit from the virtual environment.
398-
399-
NOTE: RTD will not upgrade the sphinx module if `#egg=` is specified in the `requirements.txt` file.
400-
401-
### debugging
402-
403-
A useful commnad line tool for debugging sphinx and extensions is the python debugger.
404-
Add the following line to stop to any portion of the python code to create a break
405-
point.
406-
407-
```python
408-
import pdb; pdb.set_trace()
409-
```
410-
411-
Run `make html` without redirection to a log file.
412-
413-
For only processing .dox files, run
414-
`make clean; make html DOXYGEN_CONF=Doxyfile_rtd_dox UPDATEHTMLEQS=Y`
415-
416-
## Example execution
417-
418-
The following example assumes a virtual environment as setup above using `mom6Doc`.
419-
The same environment is possible using anaconda.
420-
421-
```
422-
$ source venv/mom6Doc/bin/activate
423-
(mom6Doc) $ cd docs
424-
(mom6Doc) $ make clean
425-
(mom6Doc) $ make html >& _build/html_log.txt
426-
(mom6Doc) $ make latexpdf >& _build/latex_log.txt
427-
```
428-
429-
The last command may appear to hang. On error, latex will request input from the keyboard.
430-
Press `R` and enter. This will keep latex running to completion or stop after 100 errors
431-
are reached.
432-
433-
Once the documentation is built, you can use a web browser to look around in the `_build`
434-
directory.
435-
436384
# Credits
437385

438386
## 2020
@@ -442,10 +390,10 @@ to process the MOM6 documentation. The versions are tagged and placed into the
442390
| Source | Modified | Version | Development |
443391
| ------ | -------- | ------- | ----------- |
444392
| [sphinx](https://github.com/sphinx-doc/sphinx) | [sphinx-3.2.1mom6.4](https://github.com/jr3cermak/sphinx) | B:3.2.1mom6.4 | B:dev |
445-
| [sphinxcontrib-autodoc-doxygen](https://github.com/rmcgibbo/sphinxcontrib-autodoc_doxygen) | [sphinxcontrib-autodoc-doxygen](https://github.com/jr3cermak/sphinxcontrib-autodoc_doxygen) | T:0.7.12 | B:dev |
393+
| [sphinxcontrib-autodoc-doxygen](https://github.com/rmcgibbo/sphinxcontrib-autodoc_doxygen) | [sphinxcontrib-autodoc-doxygen](https://github.com/jr3cermak/sphinxcontrib-autodoc_doxygen) | T:0.7.13 | B:dev |
446394
| [sphinx-fortran](https://github.com/VACUMM/sphinx-fortran) | [sphinx-fortran](https://github.com/jr3cermak/sphinx-fortran) | T:1.2.2 | B:dev |
447395
| [flint](https://github.com/marshallward/flint) | [flint](https://github.com/jr3cermak/flint) | T:0.0.1 | B:dev |
448-
| [MOM6](https://github.com/NOAA-GFDL/MOM6) | [esmg-docs](https://github.com/ESMG/MOM6/tree/esmg-docs) | [esmg-docs](https://github.com/jr3cermak/MOM6/tree/esmg-docs) | B:[dev/rob](https://github.com/jr3cermak/MOM6/tree/dev-rob) |
396+
| [MOM6](https://github.com/NOAA-GFDL/MOM6) | [esmg-docs](https://github.com/ESMG/MOM6/tree/esmg-docs) | [esmg-docs](https://github.com/ESMG/MOM6/tree/esmg-docs) | B:[esmg-test](https://github.com/jr3cermak/MOM6/tree/esmg-test) |
449397

450398
T: tag B: branch
451399

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def latexPassthru(name, rawtext, text, lineno, inliner, options={}, content=[]):
181181

182182
# List of patterns, relative to source directory, that match files and
183183
# directories to ignore when looking for source files.
184-
exclude_patterns = ['_build', 'src', 'Thumbs.db', '.DS_Store']
184+
exclude_patterns = ['_build', 'details', 'src', 'Thumbs.db', '.DS_Store']
185185

186186
# The reST default role (used for this markup: `text`) to use for all
187187
# documents.

docs/details/general.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,71 @@ latex escaped math in equations. If a latex string for `\theta` is read in as
3939
tab (`\t`) and cause mahem with the processing.
4040

4141
Reference: [string literals](https://docs.python.org/3/reference/lexical_analysis.html?#literals)
42+
43+
# Debugging
44+
45+
## python3 virtual enviroment
46+
47+
Setup a virtual environment for processing:
48+
49+
```bash
50+
python3 -m venv venv/mom6Doc
51+
source venv/mom6Doc/bin/activate
52+
# cd to the docs directory within the MOM6 repo
53+
pip3 install -r requirements.txt
54+
```
55+
56+
The `deactivate` command allows you to exit from the virtual environment.
57+
58+
NOTE: RTD will not upgrade the sphinx module if `#egg=` is specified in the `requirements.txt` file.
59+
60+
### debugging
61+
62+
A useful commnad line tool for debugging sphinx and extensions is the python debugger.
63+
Add the following line to stop to any portion of the python code to create a break
64+
point.
65+
66+
```python
67+
import pdb; pdb.set_trace()
68+
```
69+
70+
Run `make html` without redirection to a log file.
71+
72+
For only processing .dox files and some specific F90 files, edit and use the
73+
`Doxyfile_rtd_dox` file. This limits the document processing to fewer files and
74+
allows for rapid testing.
75+
76+
`make clean; make html DOXYGEN_CONF=Doxyfile_rtd_dox UPDATEHTMLEQS=Y`
77+
78+
## Example execution
79+
80+
The following example assumes a virtual environment as setup above using `mom6Doc`.
81+
A similar environment is possible using anaconda.
82+
83+
```
84+
$ source venv/mom6Doc/bin/activate
85+
(mom6Doc) $ cd docs
86+
(mom6Doc) $ make clean
87+
(mom6Doc) $ make html >& _build/html_log.txt
88+
(mom6Doc) $ make latexpdf >& _build/latex_log.txt
89+
```
90+
91+
The last command may appear to hang. On error, latex will request input from the keyboard.
92+
Press `R` and enter. This will keep latex running to completion or stop after 100 errors
93+
are reached.
94+
95+
Once the documentation is built, you can use a web browser to look around in the `_build`
96+
directory.
97+
98+
## Local web server
99+
100+
Python provides a way to quickly stand up a private web server for checking documentation. It requires knowledge of
101+
the IP address if you are using a remote server, otherwise `localhost` should work.
102+
103+
You can start the server on any port. Port 8080 is shown here as an example.
104+
```bash
105+
python3 -m http.server 8080
106+
```
107+
108+
After starting the server, you can browse to the known IP using `http://IP:8080/` or if you are on the same
109+
machine use `http://localhost:8080/`.

0 commit comments

Comments
 (0)