Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reference doc issues #1534

Merged
merged 3 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion brian2/sphinxext/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _strip(self, doc):
stop = i
break

return doc[start:-stop]
return doc[start : len(doc) - stop]

def _read_to_next_section(self):
section = self._doc.read_to_next_empty_line()
Expand Down
8 changes: 6 additions & 2 deletions brian2/sphinxext/examplefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ def auto_find_examples(obj, headersymbol="="):
make mistakes but is usually going to be correct).
"""
name = obj.__name__
examples = sorted(the_examples_map[name])
tutorials = sorted(the_tutorials_map[name])
# These will only go through the examples/tutorials once. The dictionaries are cached in the
# module variables `the_examples_map` and `the_tutorials_map`.
examples_map = get_examples_map()
examples = sorted(examples_map[name])
tutorials_map = get_tutorials_map()
tutorials = sorted(tutorials_map[name])
if len(examples + tutorials) == 0:
return ""
txt = "Tutorials and examples using this"
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/docs/build_html_brian2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sphinx.cmd.build import main as sphinx_main
import sys

os.chdir('../../../docs_sphinx')
os.chdir(os.path.join(os.path.dirname(__file__), '../../../docs_sphinx'))
if os.path.exists('../docs'):
shutil.rmtree('../docs')
# Some code (e.g. the definition of preferences) might need to know that Brian
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/docs/quick_rebuild_html_brian2.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# a documentation build
os.environ['READTHEDOCS'] = 'True'

os.chdir('../../../docs_sphinx')
os.chdir(os.path.join(os.path.dirname(__file__), '../../../docs_sphinx'))
if os.path.exists('../docs'):
shutil.rmtree('../docs')
sys.exit(sphinx_main(['-b', 'html', '.', '../docs']))
Loading