Skip to content
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

Development website structure #258

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ jobs:
run: |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
--filter='P /doc-versions.json' --filter='P /dev' --filter='P /stable'
--filter='P /robots.txt' --filter='P .htaccess' \
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
- name: Upload the docs
if: env.DEPLOY == 'true' && endsWith(github.ref, 'testing')
Expand All @@ -115,4 +117,6 @@ jobs:
run: |
rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \
--delete --delete-excluded --filter='P /mw_headers.git' --filter='P /documentation/dev/*' \
--filter='P /doc-versions.json' --filter='P /dev' --filter='P /stable'
--filter='P /robots.txt' --filter='P .htaccess' \
"${WEBSITE_CLONE_DIR}/${NIKOLA_OUTPUT_DIR}/" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST}
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,32 @@ site is built using the [Nikola](https://getnikola.com) static site generator.
* `IC engine example </examples/python/reactors/ic_engine.py.html>`__
* To link to a label in the YAML API docs:
* :ref:`three-body <sec-yaml-three-body>`

## Apache configuration
To allow the version switcher to work smoothly between Cantera =< 3.0 and Cantera >= 3.1
(where the directory structure changed significantly), we rely on several `mod_rewrite`
rules, implemented in `.htaccess` files:

* `/dev/.htaccess`:
```conf
RewriteBase "/dev/"

RewriteRule "^cython/(.+)" "python/$1" [R]
```

* `/documentation/.htaccess`:
```conf
RewriteBase "/documentation/"

RewriteRule "^dev/sphinx/html/cython/(.*)" "../dev/python/$1" [R]
RewriteRule "^docs-3.0/sphinx/html/python/(.*)" "docs-3.0/sphinx/html/cython/$1" [R]
RewriteRule "^dev/sphinx/html/(.+)" "../dev/$1" [R]
```

* `/stable/.htaccess`:
```conf
RewriteBase "/stable/"

RewriteRule "^cxx(.*)" "../documentation/docs-3.0/doxygen/html/$1"
RewriteRule "^(.*)" "../documentation/docs-3.0/sphinx/html/$1"
```
40 changes: 20 additions & 20 deletions pages/documentation/dev-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 class="display-4">Development Version Documentation</h1>
<div id="searchbox" style="display: inline-block" role="search">
<h3>Search the documentation</h3>
<div class="searchformwrapper">
<form class="search" action="{{% ct_dev_docs sphinx/html/search.html %}}" method="get">
<form class="search" action="{{% ct_dev_docs search.html %}}" method="get">
<input type="text" name="q" size="50" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
Expand All @@ -34,25 +34,25 @@ <h3>Search the documentation</h3>
Python
</div>
<div class="list-group list-group-flush">
<a href="{{% ct_dev_docs sphinx/html/cython/importing.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/importing.html %}}" class="list-group-item dev-docs">
Objects Representing Phases (<code>Solution</code>s, <code>PureFluid</code>s, <code>Interface</code>s, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/cython/thermo.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/thermo.html %}}" class="list-group-item dev-docs">
Thermodynamic Properties (Temperature, pressure, energy, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/cython/kinetics.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/kinetics.html %}}" class="list-group-item dev-docs">
Chemical Kinetics (Reactions, rates of progress, reaction path analysis, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/cython/transport.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/transport.html %}}" class="list-group-item dev-docs">
Transport Properties (Diffusion, viscosity, thermal conductivity, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/cython/zerodim.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/zerodim.html %}}" class="list-group-item dev-docs">
Zero-Dimensional Reactor Networks (<code>Reactor</code>s, <code>IdealGasReactor</code>s, <code>Wall</code>s, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/cython/onedim.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/onedim.html %}}" class="list-group-item dev-docs">
One-dimensional Reacting Flows (<code>FreeFlame</code>s, <code>BurnerFlame</code>s, Flow Domains, Boundaries, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/cython/constants.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs python/constants.html %}}" class="list-group-item dev-docs">
Physical Constants (Universal constants, built into Cantera for convenience)
</a>
</div>
Expand All @@ -64,28 +64,28 @@ <h3>Search the documentation</h3>
Matlab
</div>
<div class="list-group list-group-flush">
<a href="{{% ct_dev_docs sphinx/html/matlab/importing.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/importing.html %}}" class="list-group-item dev-docs">
Objects Representing Phases (<code>Solution</code>s, <code>PureFluid</code>s, <code>Interface</code>s, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/thermodynamics.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/thermodynamics.html %}}" class="list-group-item dev-docs">
Thermodynamic Properties (Temperature, pressure, energy, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/kinetics.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/kinetics.html %}}" class="list-group-item dev-docs">
Chemical Kinetics (Reactions, rates of progress, reaction path analysis, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/transport.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/transport.html %}}" class="list-group-item dev-docs">
Transport Properties (Diffusion, viscosity, thermal conductivity, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/zero %}}-dim.html" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/zero %}}-dim.html" class="list-group-item dev-docs">
Zero-Dimensional Reactor Networks (<code>Reactor</code>s, <code>IdealGasReactor</code>s, <code>Wall</code>s, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/one %}}-dim.html" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/one %}}-dim.html" class="list-group-item dev-docs">
One-dimensional Reacting Flows (<code>FreeFlame</code>s, <code>BurnerFlame</code>s, Flow Domains, Boundaries, etc.)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/data.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/data.html %}}" class="list-group-item dev-docs">
Physical Constants (Universal constants, built into Cantera for convenience)
</a>
<a href="{{% ct_dev_docs sphinx/html/matlab/utilities.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs matlab/utilities.html %}}" class="list-group-item dev-docs">
Utility functions (data directory manipulation, version information, etc.)
</a>
</div>
Expand All @@ -100,9 +100,9 @@ <h3>Search the documentation</h3>
C++
</div>
<div class="list-group list-group-flush">
<a href="{{% ct_dev_docs doxygen/html/modules.html %}}" class="list-group-item dev-docs">List of Cantera Modules</a>
<a href="{{% ct_dev_docs doxygen/html/classes.html %}}" class="list-group-item dev-docs">List of Cantera Classes</a>
<a href="{{% ct_dev_docs doxygen/html/da/d58/deprecated.html %}}" class="list-group-item dev-docs">List of Deprecated Functions and Classes</a>
<a href="{{% ct_dev_docs cxx/modules.html %}}" class="list-group-item dev-docs">List of Cantera Modules</a>
<a href="{{% ct_dev_docs cxx/classes.html %}}" class="list-group-item dev-docs">List of Cantera Classes</a>
<a href="{{% ct_dev_docs cxx/da/d58/deprecated.html %}}" class="list-group-item dev-docs">List of Deprecated Functions and Classes</a>
</div>
</div>
</div>
Expand All @@ -117,7 +117,7 @@ <h3>Search the documentation</h3>
</a>
</div>
<div class="list-group list-group-flush">
<a href="{{% ct_dev_docs sphinx/html/yaml/index.html %}}" class="list-group-item dev-docs">
<a href="{{% ct_dev_docs yaml/index.html %}}" class="list-group-item dev-docs">
YAML Input File API Reference
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion shortcodes/ct_dev_docs.tmpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ '/' if site.config['BASE_URL'] == site.config['SITE_URL'] else site.config['BASE_URL'] }}documentation/dev/{{ _args[0] if _args else link }}
{{ '/' if site.config['BASE_URL'] == site.config['SITE_URL'] else site.config['BASE_URL'] }}dev/{{ _args[0] if _args else link }}
Loading