|
4 | 4 | # list see the documentation: |
5 | 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
6 | 6 |
|
| 7 | +import os |
| 8 | +import sys |
| 9 | +from os import path |
| 10 | + |
| 11 | +import matplotlib |
| 12 | + |
| 13 | +import okama # isort:skip |
| 14 | + |
7 | 15 | # -- Path setup -------------------------------------------------------------- |
8 | 16 |
|
9 | 17 | # If extensions (or modules to document with autodoc) are in another directory, |
10 | 18 | # add these directories to sys.path here. If the directory is relative to the |
11 | 19 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
12 | 20 | # |
13 | | -import os |
14 | | -import sys |
15 | | -from os import path |
16 | | - |
17 | | -import okama # isort:skip |
18 | 21 |
|
19 | 22 | root = path.realpath(path.join(path.dirname(__file__), "..", "..")) |
20 | 23 | sys.path.insert(1, root) |
| 24 | +sys.path.append(os.path.abspath('matplotlib_ext')) |
21 | 25 | # sys.path.insert(0, os.path.abspath(".")) |
22 | 26 |
|
23 | 27 |
|
|
54 | 58 | # ones. |
55 | 59 | extensions = [ |
56 | 60 | # "sphinx.ext.napoleon", |
| 61 | + 'matplotlib.sphinxext.plot_directive', |
57 | 62 | "numpydoc", # handle NumPy documentation formatted docstrings instead of napoleon |
58 | 63 | "sphinx.ext.autodoc", |
59 | 64 | "sphinx.ext.autosummary", |
|
103 | 108 | # so a file named "default.css" will overwrite the builtin "default.css". |
104 | 109 | html_static_path = ["_static"] |
105 | 110 |
|
106 | | -# -- Options for typehints ------------------------------------------------ |
| 111 | +# -- Options for autodoc ------------------------------------------------ |
107 | 112 |
|
108 | 113 | # This value controls how to represents typehints. |
109 | 114 | autodoc_typehints = "none" |
|
114 | 119 | # -- Options for numpydoc ------------------------------------------------ |
115 | 120 | numpydoc_attributes_as_param_list = False |
116 | 121 | numpydoc_show_class_members = False |
| 122 | +numpydoc_use_plots = True |
| 123 | +numpydoc_class_members_toctree = True |
117 | 124 |
|
118 | 125 | # -- Options for nbsphinx ------------------------------------------------ |
119 | 126 |
|
120 | 127 | # nbsphinx do not use requirejs (breaks bootstrap) |
121 | 128 | nbsphinx_requirejs_path = "" |
122 | 129 |
|
| 130 | +# matplotlib plot directive settings |
| 131 | +plot_html_show_formats = False |
| 132 | +plot_include_source = True |
| 133 | +plot_html_show_source_link = False |
| 134 | +plot_pre_code = """ |
| 135 | +import numpy as np |
| 136 | +from matplotlib import pyplot as plt |
| 137 | +import okama as ok |
| 138 | +""" |
| 139 | + |
123 | 140 | # # Napoleon settings |
124 | 141 | # napoleon_google_docstring = False |
125 | 142 | # napoleon_numpy_docstring = True |
|
0 commit comments