Skip to content

Commit

Permalink
Merge pull request #36 from pyiron/myst_docs
Browse files Browse the repository at this point in the history
Readthedocs render
  • Loading branch information
liamhuber authored Jan 15, 2024
2 parents 64d7422 + 9f51a6f commit ec497c5
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 6 deletions.
1 change: 0 additions & 1 deletion .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ if [ -d "${HOME}/pyiron_ontology" ]; then
${HOME}/CONTRIBUTING.rst \
${HOME}/LICENSE \
${HOME}/MANIFEST.in \
${HOME}/README.md \
${HOME}/setup.cfg \
${HOME}/setup.py \
${HOME}/versioneer.py
Expand Down
7 changes: 7 additions & 0 deletions .ci_support/environment-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
channels:
- conda-forge
dependencies:
- myst-parser
- sphinxcontrib-mermaid
- sphinx-gallery
- sphinx-rtd-theme
1 change: 1 addition & 0 deletions .github/workflows/push-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ jobs:
uses: pyiron/actions/.github/workflows/push-pull-main.yml@main
secrets: inherit
with:
docs-env-files: .ci_support/environment.yml .ci_support/environment-docs.yml
notebooks-env-files: .ci_support/environment.yml .ci_support/environment-pyiron_atomistics.yml .ci_support/environment-lammps.yml
tests-env-files: .ci_support/environment.yml .ci_support/environment-pyiron_atomistics.yml
10 changes: 10 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ build:
os: ubuntu-20.04
tools:
python: 'mambaforge-4.10'
nodejs: "16"
jobs:
post_install:
- npm install -g @mermaid-js/mermaid-cli

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -24,3 +28,9 @@ formats: all
# Install pyiron from conda
conda:
environment: docs/environment.yml

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
Binary file added docs/_static/pyiron-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 27 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,37 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['nbsphinx', 'sphinx.ext.mathjax', 'sphinx.ext.autodoc', 'sphinx.ext.viewcode',
'sphinx.ext.autosummary', 'sphinx.ext.napoleon']
extensions = [
'sphinxcontrib.mermaid',
'myst_parser',
'nbsphinx',
'sphinx_gallery.load_style',
'sphinx.ext.mathjax',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.imgconverter',
]
myst_fence_as_directive = ["mermaid"]
# optional to use directive options
myst_enable_extensions = ["attrs_block"]
mermaid_params = ['-p' 'puppeteer-config.json']
mermaid_output_format = "png"

nbsphinx_thumbnails = {
'source/notebooks/example': "_static/pyiron-logo-dark.png",
'source/notebooks/pizza': "_static/pyiron-logo-dark.png",
}

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

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown'
}

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand Down Expand Up @@ -279,7 +302,7 @@
u'pyiron Documentation',
u'Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department',
'pyiron_ontology',
'One line description of project.',
'Ontologies for guided workflow design.',
'Miscellaneous'),
]

Expand Down
4 changes: 4 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ dependencies:
- owlready2 =0.45
- pandas =2.1.4
- pint =0.23
- myst-parser
- sphinxcontrib-mermaid
- sphinx-gallery
- sphinx-rtd-theme
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
.. toctree::
:hidden:

source/examples.rst
source/indices.rst
3 changes: 3 additions & 0 deletions docs/puppeteer-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"args": ["--no-sandbox"]
}
11 changes: 11 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _examples:


Example Notebooks
=================

.. nbgallery::
:maxdepth: 2
:glob:

notebooks/*
2 changes: 1 addition & 1 deletion docs/source/indices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ API Documentation


.. toctree::
:maxdepth:2
:maxdepth: 2

0 comments on commit ec497c5

Please sign in to comment.