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

toctree directive not properly rendering #63

Open
adam-grant-hendry opened this issue Dec 9, 2024 · 0 comments
Open

toctree directive not properly rendering #63

adam-grant-hendry opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@adam-grant-hendry
Copy link

Describe the bug

The {toctree} directive renders improperly as tables (cards?) in the previewer, yet sphinx properly builds the page.

NOTE: I blurred the project title.

To Reproduce

index.md # demo

The demo.

:hidden:
:maxdepth: 2
:caption: Introduction

_pages/introduction.md
:hidden:
:maxdepth: 2
:caption: Contributing

_pages/contributing.md
_pages/code_of_conduct.md
:hidden:
:maxdepth: 2
:caption: FAQ

_pages/faq.md
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 files

exclude_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 and

used 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

sphinx-build -b html docs/source docs/build

System Info:

  • OS: Windows 10 Pro, 22H2
  • MyST-Markdown: v0.11.0
  • VSCode: 1.95.3

MyST-Markdown (Previewer)

image

Sphinx Build

image

@adam-grant-hendry adam-grant-hendry added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant