Skip to content

Cannot build the doc on Sphinx 9.1.0 #200

Description

@xdegaye

Sphinx 9.1.0 is the current version packaged on Archlinux.

The error message

      File "/home/user/src/h11/docs/source/conf.py", line 61, in setup
        app.add_javascript("show-code.js")
        ^^^^^^^^^^^^^^^^^^
    AttributeError: 'Sphinx' object has no attribute 'add_javascript'

The following change fixes the problem

    diff --git a/docs/source/conf.py b/docs/source/conf.py
    index b3627f5..8eb6864 100644
    --- a/docs/source/conf.py
    +++ b/docs/source/conf.py
    @@ -58,9 +58,9 @@ extensions = [
     # Undocumented trick: if we def setup here in conf.py, it gets called just
     # like an extension's setup function.
     def setup(app):
    -    app.add_javascript("show-code.js")
    -    app.add_javascript("facebox.js")
    -    app.add_stylesheet("facebox.css")
    +    app.add_js_file("show-code.js")
    +    app.add_js_file("facebox.js")
    +    app.add_css_file("facebox.css")

     # Add any paths that contain templates here, relative to this directory.
     templates_path = ['_templates']

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