Skip to content

Commit

Permalink
Fix docs building
Browse files Browse the repository at this point in the history
Use the new Python handler for mkdocstrings - updating the configuration
in all_models.md to include all submodules for optimade.models.
  • Loading branch information
CasperWA committed Oct 13, 2023
1 parent a7da4be commit b3d7a87
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
3 changes: 3 additions & 0 deletions docs/all_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ For example, the three OPTIMADE entry types, `structures`, `references` and `lin
As well as validating data types when creating instances of these models, this package defines several OPTIMADE-specific validators that ensure consistency between fields (e.g., the value of `nsites` matches the number of positions provided in `cartesian_site_positions`).

::: optimade.models
options:
show_submodules: true
show_if_no_docstring: true
25 changes: 17 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,38 @@ plugins:
lang: en
- mkdocstrings:
default_handler: python
enable_inventory: true
handlers:
python:
options:
# General options
show_source: true
show_bases: true

# Heading options
heading_level: 2
show_root_heading: false
show_root_toc_entry: true
show_root_full_path: true
show_object_full_path: false
show_category_heading: false
show_if_no_docstring: false
show_source: true
show_bases: true
group_by_category: true
heading_level: 2

# Members options
inherited_members: true
members: true
filters:
- "!^_[^_]"
- "!__json_encoder__$"
- "!__all__$"
- "!__config__$"
- "!ValidatorResults$"
members: true
inherited_members: true
group_by_category: true

# Docstring options
docstring_style: google
enable_inventory: true
docstring_options:
replace_admonitions: true
show_if_no_docstring: false
- awesome-pages
- autorefs

Expand Down
2 changes: 1 addition & 1 deletion optimade/server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,6 @@ def settings_customise_sources(

CONFIG: ServerConfig = ServerConfig()
"""This singleton loads the config from a hierarchy of sources (see
[`customise_sources`][optimade.server.config.ServerConfig.Config.customise_sources])
[`customise_sources`][optimade.server.config.ServerConfig.settings_customise_sources])
and makes it importable in the server code.
"""
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ docs = [
"mkdocs~=1.4",
"mkdocs-awesome-pages-plugin~=2.8",
"mkdocs-material~=9.0",
"mkdocstrings[python-legacy]~=0.20",
"mkdocstrings[python]~=0.20",
]

testing = [
Expand Down

0 comments on commit b3d7a87

Please sign in to comment.