CadQuery / sphinxcadquery

An extension to visualize CadQuery 3D files in your Sphinx documentation
BSD 3-Clause "New" or "Revised" License
13 stars 4 forks source link

extension doesn't work if html_context["css_files"] is modified. #19

Closed rowanG077 closed 3 years ago

rowanG077 commented 3 years ago

After a few hours of hair pulling debugging I found that this extension does not work if html_context["css_files"] in conf.py is set at all. The 3d view is not visible and it seems some click event on the page get swallowed.

So in conf.py the following works:

html_context = {
    # 'css_files': [ ]
}

But the following does not work:

html_context = {
    'css_files': [ ]
}

For some reason the <link rel="stylesheet" href="_static/sphinxcadquerystatic/main.css" type="text/css"> is not included in the header in the broken version.

rowanG077 commented 3 years ago

If I use html_css_files to add my own css it works.

Peque commented 3 years ago

@rowanG077 Thanks for reporting!

Should it work with html_context["css_files"] too? What is the preferred way with the latest Sphinx version?

If this should be supported with the latest version of Sphinx and is preferred over html_css_files, leave this open and/or feel free to contribute a fix! :stuck_out_tongue_winking_eye:

rowanG077 commented 3 years ago

Using the html_context like that is undefined behaviour. I didn't know this. See https://github.com/sphinx-doc/sphinx/issues/2442