Skip to content

Commit

Permalink
[Doc] Flatten output directory structure
Browse files Browse the repository at this point in the history
Copy Doxygen output into a subdirectory of Sphinx so the Sphinx
index can be the full site index.

Partially addresses Cantera/cantera-website#229
  • Loading branch information
speth committed Sep 29, 2023
1 parent 1b7c72b commit f29a502
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
20 changes: 12 additions & 8 deletions doc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,29 @@ def get_function_name(function_string):
else:
return sig

if localenv['doxygen_docs']:
docs = build(localenv.Command('#build/doc/doxygen/html/index.html',
'doxygen/Doxyfile', 'doxygen $SOURCE'))
if localenv['doxygen_docs'] or localenv['sphinx_docs']:
docs = build(localenv.Command(
'#build/doc/html/cxx/index.html', 'doxygen/Doxyfile',
[
Delete("build/doc/html/cxx"),
'doxygen $SOURCE',
Copy("build/doc/html/cxx", "build/doc/doxygen/html")
]
))
env.Depends(docs, env.Glob('#doc/doxygen/*') +
multi_glob(env, '#include/cantera', 'h') +
multi_glob(env, '#include/cantera/*', 'h') +
multi_glob(env, '#src/cantera/*', 'h', 'cpp'))

env.Alias('doxygen', docs)
install(localenv.RecursiveInstall, '$inst_docdir/doxygen/html',
'#/build/doc/doxygen/html', exclude=['\\.map', '\\.md5'])

if localenv['sphinx_docs']:
def build_sphinx(target, source, env):
cmd = [env['sphinx_cmd']] + env['sphinx_options'].split()
if env['logging'] == 'debug':
cmd.append('-v')
cmd += ('-b', 'html', '-d', 'build/doc/sphinx/doctrees', 'build/doc/sphinx',
'build/doc/sphinx/html')
'build/doc/html')
code = subprocess.call(cmd, env=env['ENV'])
if code:
raise Errors.BuildError(target, action=env['sphinx_cmd'])
Expand Down Expand Up @@ -251,5 +255,5 @@ if localenv['sphinx_docs']:
localenv.AlwaysBuild(sphinxdocs)
if localenv['doxygen_docs']:
localenv.Depends(sphinxdocs, docs)
install(localenv.RecursiveInstall, '$inst_docdir/sphinx/html',
'#build/doc/sphinx/html')
install(localenv.RecursiveInstall, '$inst_docdir/html',
'#build/doc/html', exclude=['\\.map', '\\.md5'])
4 changes: 2 additions & 2 deletions doc/doxygen/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
</div>
<div>
<ul class="sm sm-dox" style="display: block;">
<li><a id="selected" href="$relpath^../../sphinx/html/reference.html">Reference</a></li>
<li><a href="$relpath^../../sphinx/html/examples.html">Examples</a></li>
<li><a id="selected" href="$relpath^../reference.html">Reference</a></li>
<li><a href="$relpath^../examples.html">Examples</a></li>
</ul>
</div>
<!--END TITLEAREA-->
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ def escape_splats(app, what, name, obj, options, lines):
autoclass_content = 'both'

doxylink = {
'ct': (os.path.abspath('../../doc/Cantera.tag'),
'../../doxygen/html/')
'ct': (os.path.abspath('../Cantera.tag'),
'cxx/')
}

intersphinx_mapping = {
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mechanism files.
```
```{grid-item-card} C++ API Reference
:link: ../../doxygen/html/index.html
:link: cxx/index.html
:text-align: center
```
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/LatticePhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Cantera
//! A simple thermodynamic model for a bulk phase, assuming a lattice of solid
//! atoms
/*!
* See [`lattice` Phase Model](../../sphinx/html/reference/science/phasethermo/lattice.html)
* See [`lattice` Phase Model](../reference/science/phasethermo/lattice.html)
* for scientific model documentation.
*
* @ingroup thermoprops
Expand Down

0 comments on commit f29a502

Please sign in to comment.