You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for pkg in packages:
# In Python 3.6 and later it is recommended to use os.fspath() instead of str() if
# you need to do an explicit conversion. This is a little safer as it will raise an
# error if you accidentally try to convert an object that is not pathlike.
sys.path.insert(0, os.fspath(pkg.resolve()))
Describe the bug
The
{toctree}
directive renders improperly as tables (cards?) in the previewer, yetsphinx
properly builds the page.NOTE: I blurred the project title.
To Reproduce
index.md
# demoThe
demo
.conf.py
"""Documentation configuration file.This file is read by the
sphinx
documentation builder to generate our documentation."""
from future import annotations
import importlib.resources as rsrc
import os
import sys
from datetime import datetime, timezone
import demo
-- Project information ----------------------------------------------------------------
project = 'demo'
copyright = f'2024-{datetime.now(tz=timezone.utc).year}, Adam Hendry' # noqa: A001
author = 'Adam Hendry'
root_package = 'demo'
version = demo.version
release = version
-- Path setup -------------------------------------------------------------------------
with rsrc.path(root_package, 'init.py') as file_:
root = file_.parent.parent
packages = [
root / root_package,
root / r'docs',
root / r'tests',
]
for pkg in packages:
# In Python 3.6 and later it is recommended to use os.fspath() instead of str() if
# you need to do an explicit conversion. This is a little safer as it will raise an
# error if you accidentally try to convert an object that is not pathlike.
sys.path.insert(0, os.fspath(pkg.resolve()))
-- Extensions -------------------------------------------------------------------------
extensions: list[str] = [
'myst_parser',
'numpydoc',
'sphinx_book_theme',
'sphinx.ext.intersphinx',
'sphinx_copybutton',
]
myst_heading_anchors = 6
-- General configuration --------------------------------------------------------------
Paths are relative to
source
html_static_path = ['_static']
master_doc = 'index'
List of files relative to
source
to ignore when looking for source filesexclude_patterns: list[str] = [
'_build',
'build',
]
-- HTML Output ------------------------------------------------------------------------
html_theme = 'sphinx_book_theme'
html_css_files = [
'css/custom.css',
]
String appended to project name with hyphen in
<title>
tag of individual pages andused in the navigation bar as the “topmost” element. It defaults to '
v documentation'. Remove so only project name appears in title.
html_title = 'demo'
html_short_title = project
html_theme_options = {
'repository_url': 'https://github.com/adam-grant-hendry/demo',
'use_repository_button': True,
'home_page_in_toc': True,
}
Removes the "View Source" hyperlink
html_show_sourcelink = False
Enable figure numbering. If true, figures, tables and code-blocks are automatically
numbered if they have a caption. The numref role is enabled. Obeyed so far only by
HTML and LaTeX builders. Default is False.
num_fig = True
Build Command
System Info:
MyST-Markdown (Previewer)
Sphinx Build
The text was updated successfully, but these errors were encountered: