|
13 | 13 |
|
14 | 14 | import os |
15 | 15 | import sys |
| 16 | +import datetime |
16 | 17 |
|
17 | | -sys.path.insert(0, os.path.abspath('../')) |
| 18 | +sys.path.insert(0, os.path.abspath("../")) |
18 | 19 |
|
19 | 20 | from elastica.version import VERSION |
20 | 21 |
|
21 | 22 |
|
22 | 23 | # -- Project information ----------------------------------------------------- |
23 | 24 |
|
24 | | -project = 'PyElastica' |
25 | | -copyright = '2025, Gazzola Lab' |
26 | | -author = 'Gazzola Lab' |
| 25 | +YEAR = datetime.datetime.now().year |
27 | 26 |
|
28 | | -# The full version, including alpha/beta/rc tags |
| 27 | +project = "PyElastica" |
| 28 | +copyright = f"{YEAR}, Gazzola Lab" |
| 29 | +author = "Gazzola Lab" |
29 | 30 | release = VERSION |
30 | 31 |
|
31 | 32 |
|
|
35 | 36 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
36 | 37 | # ones. |
37 | 38 | extensions = [ |
38 | | - 'sphinx.ext.autodoc', |
39 | | - 'sphinx.ext.autosectionlabel', |
40 | | - 'sphinx_autodoc_typehints', |
| 39 | + "sphinx.ext.autodoc", |
| 40 | + "sphinx.ext.autosectionlabel", |
| 41 | + "sphinx_autodoc_typehints", |
41 | 42 | #'sphinx.ext.napoleon', |
42 | | - 'sphinx.ext.viewcode', |
43 | | - 'sphinx.ext.mathjax', |
| 43 | + "sphinx.ext.viewcode", |
| 44 | + "sphinx.ext.mathjax", |
| 45 | + "sphinxcontrib.video", |
44 | 46 | "sphinxcontrib.mermaid", |
45 | | - 'numpydoc', |
46 | | - 'myst_parser', |
| 47 | + "numpydoc", |
| 48 | + "myst_parser", |
| 49 | + "sphinx_gallery.gen_gallery", |
47 | 50 | ] |
48 | 51 |
|
| 52 | +# To add example in gallery, |
| 53 | +# 1. run script should start with GALLERY_KEY |
| 54 | +# 2. Some README(.rst/.md/.txt) file should be in the directory |
| 55 | +GALLERY_KEY = "run" |
| 56 | +sphinx_gallery_conf = { |
| 57 | + "examples_dirs": "../examples", |
| 58 | + "subsection_order": [ |
| 59 | + "../examples/TimoshenkoBeamCase", |
| 60 | + "*", |
| 61 | + "../examples/ContinuumSnakeCase", |
| 62 | + ], |
| 63 | + "gallery_dirs": "_gallery", |
| 64 | + "backreferences_dir": "gen_modules/backreferences", |
| 65 | + "example_extensions": ".py", |
| 66 | + "ignore_pattern": rf"^(?!.*{GALLERY_KEY})[^/\\]+\.py$", |
| 67 | + "filename_pattern": f"/{GALLERY_KEY}_.*", |
| 68 | + # 'nested_sections': True, |
| 69 | + "first_notebook_cell": ("# PyElastica installation\n" "# !pip install pyelastica"), |
| 70 | + # "parallel": 2, |
| 71 | +} |
| 72 | + |
49 | 73 | myst_enable_extensions = [ |
50 | 74 | "amsmath", |
51 | 75 | "colon_fence", |
|
57 | 81 | ] |
58 | 82 |
|
59 | 83 | # Add any paths that contain templates here, relative to this directory. |
60 | | -templates_path = ['_templates'] |
| 84 | +templates_path = ["_templates"] |
61 | 85 |
|
62 | 86 | # List of patterns, relative to source directory, that match files and |
63 | 87 | # directories to ignore when looking for source files. |
64 | 88 | # This pattern also affects html_static_path and html_extra_path. |
65 | 89 | exclude_patterns = [ |
66 | | - "README.md", # File reserved to explain how documentationing works. |
67 | | - ] |
| 90 | + "README.md", # File reserved to explain how documentationing works. |
| 91 | +] |
68 | 92 |
|
69 | | -autodoc_default_flags = ['members', 'private-members', 'special-members', 'show-inheritance'] |
| 93 | +autodoc_default_flags = [ |
| 94 | + "members", |
| 95 | + "private-members", |
| 96 | + "special-members", |
| 97 | + "show-inheritance", |
| 98 | +] |
70 | 99 | autosectionlabel_prefix_document = True |
71 | 100 |
|
72 | | -source_parsers = { |
73 | | -} |
74 | | -source_suffix = ['.rst', '.md'] |
| 101 | +source_parsers = {} |
| 102 | +source_suffix = [".rst", ".md"] |
75 | 103 |
|
76 | | -master_doc = 'index' |
| 104 | +master_doc = "index" |
77 | 105 | # -- Options for HTML output ------------------------------------------------- |
78 | 106 |
|
79 | 107 | # The theme to use for HTML and HTML Help pages. See the documentation for |
80 | 108 | # a list of builtin themes. |
81 | 109 |
|
82 | | -html_theme = 'sphinx_book_theme' |
| 110 | +html_theme = "sphinx_book_theme" |
83 | 111 | html_theme_options = { |
84 | 112 | "repository_url": "https://github.com/GazzolaLab/PyElastica", |
85 | 113 | "use_repository_button": True, |
86 | 114 | } |
87 | 115 | html_title = "PyElastica" |
88 | 116 | html_logo = "_static/assets/Logo.png" |
89 | | -#pygments_style = "sphinx" |
| 117 | +# pygments_style = "sphinx" |
90 | 118 |
|
91 | 119 | # Add any paths that contain custom static files (such as style sheets) here, |
92 | 120 | # relative to this directory. They are copied after the builtin static files, |
93 | 121 | # so a file named "default.css" will overwrite the builtin "default.css". |
94 | | -html_static_path = ['_static'] |
95 | | -html_css_files = ['css/*', 'css/logo.css'] |
| 122 | +html_static_path = ["_static"] |
| 123 | +html_css_files = ["css/*", "css/logo.css"] |
96 | 124 |
|
97 | 125 | # -- Options for autodoc --------------------------------------------------- |
98 | | -autodoc_member_order = 'bysource' |
| 126 | +autodoc_member_order = "bysource" |
99 | 127 |
|
100 | 128 | # -- Options for numpydoc --------------------------------------------------- |
101 | 129 | numpydoc_show_class_members = False |
102 | 130 |
|
103 | 131 | # -- Mermaid configuration --------------------------------------------------- |
104 | | -mermaid_params = ['--theme', 'neutral'] |
| 132 | +mermaid_params = ["--theme", "neutral"] |
0 commit comments