Skip to content

Update nbsphinx to Recognize text/x-rst Mimetype for Raw Cells #833

@MacHu-GWU

Description

@MacHu-GWU

With the release of [nbconvert version 7.16.5](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md#7165 according to nbconvert) on 2025-01-02, the mimetype for reStructuredText raw cells has been updated from text/restructuredtext to text/x-rst . This change affects nbsphinx’s ability to detect titles in notebooks where the first cell is a raw reStructuredText cell. 

Current Behavior:

When the first cell of a notebook is a raw reStructuredText cell with the mimetype text/x-rst, nbsphinx does not recognize the document’s title, leading to warnings such as:

WARNING: toctree contains reference to document 'path/to/notebook' that doesn't have a title: no link will be generated

Proposed Solution:

Modify nbsphinx to recognize both text/restructuredtext and text/x-rst mimetypes when processing raw cells. Specifically, update the condition in the nbsphinx source code to:

{%- elif raw_mimetype in ['text/restructuredtext', 'text/x-rst'] %}

This change will ensure compatibility with notebooks using either mimetype.

This issue will be fixed by PR #834

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions