Skip to content

Stylesheet togglebutton.css not rendered #18

@hroemer

Description

@hroemer

Describe the bug

The extension is not working out-of-the box as the according CSS file does not get added to the HTML header.

To Reproduce

Follow the instructions in README.md

Environment

  • Python Version 3.8.5
  • Package versions: 0.2.2
  • Operating System: Linux

Additional context

The reason is that the config.html_context is not filled accordingly , probably due to a premature call to app.add_css_file("togglebutton.css").

Adding these lines:

def add_to_context(app, config):
    # Update the global context
    config.html_context.update({"togglebutton_hint": config.togglebutton_hint})

    if not config.html_context["css_files"]:
        config.html_context["css_files"] = []
    config.html_context["css_files"].append('_static/togglebutton.css')

and renaming the file togglebutton.css_t (!?) in the _static folder to the expected file named togglebutton.css fixes the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions