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

Use furo for docs theme #331

Merged
merged 7 commits into from
May 8, 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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
pip install .[strict,docs]

- name: Build
run: jupyter-book build docs --path-output docs_build
run: sphinx-build docs docs_build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
pip install .[strict,docs]

- name: Build
run: jupyter-book build docs --path-output docs_build
run: sphinx-build docs docs_build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
pip install .[strict,docs]

- name: Build
run: jupyter-book build docs --path-output docs_build
run: sphinx-build docs docs_build

automerge:
needs: [lint, test, docs]
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The basic procedure for making a PR is:

We have a few tips for writing good PRs that are accepted into the main repo:

- Use the Numpy Code style for all of your code. Find an example [here](hhttps://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html#example-numpy).
- Use the Numpy Code style for all of your code. Find an example [here](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html#example-numpy).
- Your code should have (4) spaces instead of tabs.
- If needed, update the documentation.
- **Write tests** for new features! Good tests are 100%, absolutely necessary
Expand Down
110 changes: 55 additions & 55 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
/* Override some aspects of the pydata-sphinx-theme */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap');
/*!* Override some aspects of the pydata-sphinx-theme *!*/
/*@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap');*/

:root {
/* Use softer blue from bootstrap's default info color */
--pst-color-info: 23, 162, 184;
}
/*:root {*/
/* !* Use softer blue from bootstrap's default info color *!*/
/* --pst-color-info: 23, 162, 184;*/
/*}*/

/* Main index page overview cards */
/*!* Main index page overview cards *!*/

.intro-card {
background: #fff;
border-radius: 0;
padding: 30px 10px 20px 10px;
margin: 10px 0px;
}
/*.intro-card {*/
/* background: #fff;*/
/* border-radius: 0;*/
/* padding: 30px 10px 20px 10px;*/
/* margin: 10px 0px;*/
/*}*/

.intro-card p.card-text {
margin: 0px;
}
/*.intro-card p.card-text {*/
/* margin: 0px;*/
/*}*/

.intro-card .card-img-top {
margin: 10px;
height: 52px;
}
/*.intro-card .card-img-top {*/
/* margin: 10px;*/
/* height: 52px;*/
/*}*/

.intro-card .card-header {
border: none;
background-color:white;
color: #150458 !important;
font-size: var(--pst-font-size-h5);
font-weight: bold;
padding: 2.5rem 0rem 0.5rem 0rem;
}
/*.intro-card .card-header {*/
/* border: none;*/
/* background-color:white;*/
/* color: #150458 !important;*/
/* font-size: var(--pst-font-size-h5);*/
/* font-weight: bold;*/
/* padding: 2.5rem 0rem 0.5rem 0rem;*/
/*}*/

.intro-card .card-footer {
border: none;
background-color:white;
}
/*.intro-card .card-footer {*/
/* border: none;*/
/* background-color:white;*/
/*}*/

.intro-card .card-footer p.card-text{
max-width: 220px;
margin-left: auto;
margin-right: auto;
}
/*.intro-card .card-footer p.card-text{*/
/* max-width: 220px;*/
/* margin-left: auto;*/
/* margin-right: auto;*/
/*}*/


body {
font-family: 'Open Sans', sans-serif;
color:#4A4A4A; /* numpy.org body color */
}
/*body {*/
/* font-family: 'Open Sans', sans-serif;*/
/* color:#4A4A4A; !* numpy.org body color *!*/
/*}*/

pre, code {
/*font-size: 100%;*/
/*line-height: 155%;*/
}
/*pre, code {*/
/* !*font-size: 100%;*!*/
/* !*line-height: 155%;*!*/
/*}*/

h1 {
font-family: "Lato", sans-serif;
}
/*h1 {*/
/* font-family: "Lato", sans-serif;*/
/*}*/


h2 {
letter-spacing: -.03em;
}
/*h2 {*/
/* letter-spacing: -.03em;*/
/*}*/

h3 {
/*color: #013243; !* warm black *!*/
letter-spacing: -.03em;
}
/*h3 {*/
/* !*color: #013243; !* warm black *!*!*/
/* letter-spacing: -.03em;*/
/*}*/
179 changes: 179 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# ruff: noqa: E501

"""Sphinx configuration file."""

# -- 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

# import typing
# typing.TYPE_CHECKING = True
from atomate2 import __version__

sys.path.insert(0, os.path.abspath("../../"))

# -- Project information -----------------------------------------------------

project = "atomate2"
copyright = "2023, materialsproject"
author = "Alex Ganose"

# The short X.Y version
version = __version__
# The full version, including alpha/beta/rc tags
release = __version__

# -- 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 = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"myst_parser",
"sphinxcontrib.autodoc_pydantic",
"numpydoc",
"sphinx_design",
]

# 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 = ["Thumbs.db", ".DS_Store", "test*.py"]

myst_heading_anchors = 2 # enable headings as link targets
myst_enable_extensions = [
"amsmath",
"colon_fence",
"dollarmath",
"html_admonition",
"html_image",
]

# use type hints
autodoc_typehints = "description"
# autoclass_content = "both"
# autodoc_member_order = "bysource"

# better napoleon support
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_use_ivar = True

# The suffix(es) of source filenames.
source_suffix = [".rst", ".md"]

mathjax3_config = {
"tex": {
"macros": {
"N": "\\mathbb{N}",
"floor": ["\\lfloor#1\\rfloor", 1],
"bmat": ["\\left[\\begin{array}"],
"emat": ["\\end{array}\\right]"],
}
}
}
latex_elements = {
"preamble": r"""\newcommand\N{\mathbb{N}}
\newcommand\floor[1]{\lfloor#1\rfloor}
\newcommand{\bmat}{\left[\begin{array}}
\newcommand{\emat}{\end{array}\right]}
"""
}
language = "en"
html_extra_path = ["images/ badge.svg"]
html_static_path = ["_static"]
html_css_files = ["custom.css", "github.css"]
suppress_warnings = "etoc.toctree"

# autodoc options
autosummary_imported_members = False
autodoc_preserve_defaults = True
autoclass_content = "class"
autodoc_member_order = "bysource"

python_use_unqualified_type_names = True

# don't overwrite summary but generate them if they don't exist
autosummary_generate = True
autosummary_generate_overwrite = True

# numpydoc options
numpydoc_class_members_toctree = False
numpydoc_show_class_members = False
numpydoc_show_inherited_class_members = False
numpydoc_attributes_as_param_list = False
numpydoc_xref_param_type = True

# sphinx-panels shouldn't add bootstrap css as the pydata-sphinx-theme already loads it
panels_add_bootstrap_css = False

# control pydantic model docs
autodoc_pydantic_model_show_json = False
autodoc_pydantic_model_show_field_summary = False
autodoc_pydantic_model_show_config = False
autodoc_pydantic_model_show_config_summary = False
autodoc_pydantic_model_show_validator_members = False
autodoc_pydantic_model_member_order = "bysource"
autodoc_pydantic_settings_show_json = False
autodoc_pydantic_settings_show_field_summary = False
autodoc_pydantic_settings_show_config = False
autodoc_pydantic_settings_show_config_summary = False
autodoc_pydantic_settings_show_validator_members = False
autodoc_pydantic_settings_member_order = "bysource"
autodoc_pydantic_field_list_validators = False
autodoc_pydantic_field_show_constraints = False


# -- 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 = "furo"
html_theme_options = {
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/materialsproject/atomate2",
"html": """
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg>
""",
"class": "",
},
],
"source_repository": "https://github.com/materialsproject/atomate2/",
"source_branch": "main",
"source_directory": "docs/",
}


# hide sphinx footer
html_show_sphinx = False
html_show_sourcelink = False
html_title = "atomate2"

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3.8", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"networkx": ("https://networkx.org/documentation/stable/", None),
"monty": ("https://materialsvirtuallab.github.io/monty/", None),
"jobflow": ("https://materialsproject.github.io/jobflow", None),
}
32 changes: 32 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
```{toctree}
:caption: User Guide
:hidden:
user/index
user/install
user/running-workflows
user/fireworks
user/codes/index
```

```{toctree}
:caption: Reference
:hidden:
reference/index
```

```{toctree}
:caption: Developer Guide
:hidden:
dev/dev_install
dev/vasp_tests
```

```{toctree}
:caption: About
:hidden:
about/changelog
about/contributors
about/contributing
about/license
```

# atomate2 documentation

**Date**: {sub-ref}`today`
Expand Down
4 changes: 4 additions & 0 deletions docs/user/codes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
# Codes

The section gives the instructions for codes supported by atomate2.

```{toctree}
vasp
```
1 change: 0 additions & 1 deletion docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ differences are:

- Use of the PBEsol exchange–correlation functional instead of PBE.
- Use of up-to-date pseudopotentials (PBE_54 instead of PBE_52).
- Use of KSPACING for most calculations.

```{warning}
The different input sets used in atomate2 mean total energies cannot be compared
Expand Down
Loading