Skip to content

Commit

Permalink
Fix globaltoc settings
Browse files Browse the repository at this point in the history
and moved custom.css stuff downstream.

Customize copy button to not copy code
prompt or output.

Misc v2 fixes.
  • Loading branch information
pllim committed May 25, 2023
1 parent 9e2873d commit f78da2e
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions sphinx_astropy/conf/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def check_sphinx_version(expected_version):
]

try:
import matplotlib.sphinxext.plot_directive
extensions += [matplotlib.sphinxext.plot_directive.__name__]
import matplotlib.sphinxext.plot_directive # noqa: F401
extensions += ['matplotlib.sphinxext.plot_directive']
# AttributeError is checked here in case matplotlib is installed but
# Sphinx isn't. Note that this module is imported by the config file
# generator, even if we're not building the docs.
Expand Down Expand Up @@ -245,27 +245,19 @@ def check_sphinx_version(expected_version):
'-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif',
]

# For sphinx-copybutton
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True

# -- 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 = 'pydata_sphinx_theme'

# FIXME: Have to figure this out if we want left nav on main page only.
# Custom sidebar templates, maps document names to template names.
#
# Also need this _static/custom.css to remove bullet points:
# .sidebar-primary-item > ul > li.toctree-l1 {
# display: inline;
# font-size: larger;
# }
#
#html_static_path = ["_static"]
#html_css_files = ["custom.css"]
html_sidebars = {
"index": ["globaltoc.html"]
}
#globaltoc_maxdepth = -1 # FIXME: this isn't working, not sure why

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand All @@ -282,7 +274,9 @@ def check_sphinx_version(expected_version):
"collapse_navigation": True,
"icon_links": [],
"navigation_depth": 2,
"show_nav_level": 1, # FIXME: Need separate RST pages with toctree within.
"show_nav_level": 2,
"globaltoc_collapse": False,
"globaltoc_maxdepth": 2,
"use_edit_page_button": False
}

Expand Down

0 comments on commit f78da2e

Please sign in to comment.