Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Deploy Docs

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx matplotlib h5py pandas sphinxcontrib-bibtex

- name: Build docs using sphinx-build
run: |
cd doc/user
sphinx-build -b html . _build/html

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GH_PAGES_TOKEN }} # You can use the default GITHUB_TOKEN or your PAT.
BRANCH: gh-pages
FOLDER: doc/user/_build/html
103 changes: 103 additions & 0 deletions doc/user/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.append(os.path.abspath("C:/code/HydroChrono/doc/user/_ext"))

# -- Project information -----------------------------------------------------
project = 'HydroChrono'
copyright = ''
author = ''

# The full version, including alpha/beta/rc tags
release = '0.1'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
#'hydrochrono_h5',
#'matplotlib.sphinxext.mathmpl.math_directive',
'matplotlib.sphinxext.mathmpl',
'matplotlib.sphinxext.plot_directive',
#'matplotlib.sphinxext.only_directives',
'sphinxcontrib.bibtex',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx.ext.intersphinx',
'sphinx.ext.inheritance_diagram'
]

# Include TODO comments
todo_include_todos = True

# Bibtex file location
bibtex_bibfiles = ['C:/code/HydroChrono/doc/user/references.bib']

# matplotlib.sphinxext.plot_directive Configuration
# plot_basedir = 'C:/code/HydroChrono/doc/user'
# plot_working_directory = 'C:/code/HydroChrono_build/doc/user'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

ProjectName = f'HydroChrono'

# Breathe Configuration
#if 1 and 0:
# extensions.append('breathe')
# breathe_default_project = ProjectName
# breathe_projects = { ProjectName : "..\\..\\..\\..\\HydroChrono\\xml" }


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'bizstyle'
#html_theme = 'haiku'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
#html_logo = 'xxx.png'
#html_favicon = 'favicon.ico'

# html_theme_options = {
# 'full_logo': True
# }


rst_prolog = r"""
.. |UNIT_NONE| replace:: :math:`\rm -`

.. |UNIT_TIME| replace:: :math:`\rm s`

.. |UNIT_LENGTH| replace:: :math:`\rm m`

.. |UNIT_TEMP| replace:: K

.. |PROP_TEMP| replace:: :math:`T`

"""