FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abacus-develop/docs/conf.py at develop · deepmodeling/abacus-develop · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
deepmodeling
/
abacus-develop
Public
forked from
abacusmodeling/abacus-develop
Notifications
You must be signed in to change notification settings
Fork
243
Star
286
Code
Issues
258
Pull requests
18
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
abacus-develop
/
docs
/
conf.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
130 lines (102 loc) · 3.93 KB
Breadcrumbs
abacus-develop
/
docs
/
conf.py
Copy path
File metadata and controls
130 lines (102 loc) · 3.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project
=
'ABACUS'
copyright
=
'2024, ABACUS'
author
=
'ABACUS'
# The full version, including alpha/beta/rc tags
# release = '2.3.5'
# -- 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
=
[
'myst_parser'
,
'deepmodeling_sphinx'
,
]
myst_enable_extensions
=
[
"amsmath"
,
"colon_fence"
,
"deflist"
,
"dollarmath"
,
"fieldlist"
,
"html_admonition"
,
"html_image"
,
"linkify"
,
"replacements"
,
"smartquotes"
,
"strikethrough"
,
"substitution"
,
"tasklist"
,
]
myst_heading_anchors
=
4
# 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
=
[]
# -- 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
=
'sphinx_book_theme'
html_logo
=
'abacus-logo.svg'
# Theme options for sphinx-book-theme
html_theme_options
=
{
"show_toc_level"
:
2
,
# Only show h2 (categories) in right sidebar, not h3 (parameters)
"toc_title"
:
"On this page"
,
}
# Changes for compatibility with Read the Docs
import
os
# Define the canonical URL if you are using a custom domain on Read the Docs
html_baseurl
=
os
.
environ
.
get
(
"READTHEDOCS_CANONICAL_URL"
,
""
)
# Tell Jinja2 templates the build is running on Read the Docs
if
os
.
environ
.
get
(
"READTHEDOCS"
,
""
)
==
"True"
:
if
"html_context"
not
in
globals
():
html_context
=
{}
html_context
[
"READTHEDOCS"
]
=
True
# 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'
]
latex_engine
=
'xelatex'
mathjax_path
=
'https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.0/es5/tex-mml-chtml.min.js'
# deepmodeling_current_site = 'Tutorials'
latex_elements
=
{
'extraclassoptions'
:
'openany,oneside'
}
# -- Auto-generate INPUT keyword documentation from YAML parameter dump ------
from
pathlib
import
Path
def
generate_input_docs
(
app
):
"""Auto-generate input-main.md from parameters.yaml before building.
Workflow:
abacus --generate-parameters-yaml > docs/parameters.yaml
# Then Sphinx calls this hook, which runs generate_input_main.py
"""
docs_dir
=
Path
(
__file__
).
resolve
().
parent
yaml_path
=
docs_dir
/
'parameters.yaml'
if
not
yaml_path
.
exists
():
print
(
f"Warning:
{
yaml_path
}
not found. "
"Run: abacus --generate-parameters-yaml > docs/parameters.yaml"
)
return
import
sys
sys
.
path
.
insert
(
0
,
str
(
docs_dir
))
from
generate_input_main
import
generate
generate
(
yaml_path
=
yaml_path
,
output
=
docs_dir
/
'advanced'
/
'input_files'
/
'input-main.md'
,
)
def
setup
(
app
):
app
.
connect
(
'builder-inited'
,
generate_input_docs
)
Back
|
FazBrowse Home
|
New Git URL