|
19 | 19 | # -- Imports |
20 | 20 |
|
21 | 21 | import sphinx_rtd_theme |
| 22 | +import sphinx |
22 | 23 |
|
23 | 24 | # -- Project information ----------------------------------------------------- |
24 | 25 |
|
|
51 | 52 | 'releases' |
52 | 53 | ] |
53 | 54 |
|
| 55 | + |
| 56 | +def monkeypatch(cls): |
| 57 | + """ decorator to monkey-patch methods """ |
| 58 | + def decorator(f): |
| 59 | + method = f.__name__ |
| 60 | + old_method = getattr(cls, method) |
| 61 | + setattr(cls, method, lambda self, *args, **kwargs: f(old_method, self, *args, **kwargs)) |
| 62 | + return decorator |
| 63 | + |
| 64 | +# workaround until https://github.com/miyakogi/m2r/pull/55 is merged |
| 65 | +@monkeypatch(sphinx.registry.SphinxComponentRegistry) |
| 66 | +def add_source_parser(_old_add_source_parser, self, *args, **kwargs): |
| 67 | + # signature is (parser: Type[Parser], **kwargs), but m2r expects |
| 68 | + # the removed (str, parser: Type[Parser], **kwargs). |
| 69 | + if isinstance(args[0], str): |
| 70 | + args = args[1:] |
| 71 | + return _old_add_source_parser(self, *args, **kwargs) |
| 72 | + |
54 | 73 | # -- nbsphinx configuration --------------------------------------------------- |
55 | 74 |
|
56 | 75 | import galgebra |
|
66 | 85 | napoleon_include_init_with_doc= False |
67 | 86 |
|
68 | 87 | autoclass_content = "both" # include both class docstring and __init__ |
69 | | -autodoc_default_flags = [ |
| 88 | +autodoc_default_options = { |
70 | 89 | # Make sure that any autodoc declarations show the right members |
71 | | - "members", |
72 | | - "inherited-members", |
73 | | - # "undoc-members", |
74 | | - # "special-members", |
75 | | - # "private-members", |
76 | | - # "show-inheritance", |
77 | | -] |
| 90 | + "members": True, |
| 91 | + "inherited-members": True, |
| 92 | + # "undoc-members": True, |
| 93 | + # "special-members": True, |
| 94 | + # "private-members": True, |
| 95 | + # "show-inheritance": True, |
| 96 | +} |
78 | 97 |
|
79 | 98 | #autodoc_default_flags='members' |
80 | 99 | # you have to list all files with automodule here due to bug in sphinx and nbsphinx |
|
95 | 114 | # You can specify multiple suffix as a list of string: |
96 | 115 | # |
97 | 116 | # source_suffix = ['.rst', '.md'] |
98 | | -source_suffix = ['.rst', '.md'] |
| 117 | +source_suffix = ['.rst'] |
99 | 118 |
|
100 | 119 | # The master toctree document. |
101 | 120 | master_doc = 'index' |
|
110 | 129 | # List of patterns, relative to source directory, that match files and |
111 | 130 | # directories to ignore when looking for source files. |
112 | 131 | # This pattern also affects html_static_path and html_extra_path. |
113 | | -exclude_patterns = ['_build', '**.ipynb_checkpoints', 'Thumbs.db', '.DS_Store'] |
| 132 | +exclude_patterns = [ |
| 133 | + '_build', '**.ipynb_checkpoints', 'Thumbs.db', '.DS_Store', |
| 134 | + # these are here for users, not for Sphinx |
| 135 | + 'books', 'old_installation.md', 'old_introduction.md', |
| 136 | + # this is converted into ipynb elsewhere |
| 137 | + 'galgebra.md', |
| 138 | +] |
114 | 139 |
|
115 | 140 | # The name of the Pygments (syntax highlighting) style to use. |
116 | 141 | pygments_style = 'sphinx' |
|
0 commit comments