useblocks / sphinx-simplepdf

A simple PDF builder for Sphinx documentations
https://sphinx-simplepdf.readthedocs.io
MIT License
36 stars 15 forks source link

Failed to load stylesheet main.css #22

Closed 1kastner closed 1 year ago

1kastner commented 1 year ago

In the logs, the following statement is shown:

ERROR: Failed to load stylesheet at file:///C:/.../docs/_build/simplepdf/_static/styles/main.css: URLError: <urlopen error [WinError 2] Das System kan
n die angegebene Datei nicht finden: 'C:\\...\\docs\\_build\\simplepdf\\_static\\styles\\main.css'>

Is that stylesheet optional? I guess simplepdf fails to copy it from somewhere to that target directory?

danwos commented 1 year ago

Mhh, no it's not optional. main.css is stored under _static directly. And must be available, as it contains all our styles. Without it, the PDF would look really ugly.

I don't have such a message in my logs. Are you working with the latest main branch?

1kastner commented 1 year ago

I am working with the main branch. This error message has always shown up, I also remember seeing it in my very first build. Maybe it is the cause why my SVG images are still poorly aligned?

EDIT: I just manually deinstalled and re-installed simplepdf to be on the save side. pip tells me I was using the latest version before. The folder structure below docs/_build/simplepdf/_static is, however, different from what you described.

$ pip uninstall sphinx-simplepdf
Found existing installation: sphinx-simplepdf 1.4.0
Uninstalling sphinx-simplepdf-1.4.0:
  Would remove:
    c:\...\.venv\lib\site-packages\sphinx_simplepdf-1.4.0-py3.9.egg-info
    c:\...\.venv\lib\site-packages\sphinx_simplepdf\*
  Would not remove (might be manually added):
    c:\...\.venv\lib\site-packages\sphinx_simplepdf\themes\simplepdf_theme\static\main.css
Proceed (Y/n)? y
  Successfully uninstalled sphinx-simplepdf-1.4.0

grafik

...and in styles there is only the folder called sources with scss files.

danwos commented 1 year ago

That look good to me. main.css is in _static. styles is not really needed. It's only used to generate main.css which should contain everything and is the only CSS file we need.

We generated main.css in styles some commits ago. But this was changed.

So I think the problem is, that styles/main.css still gets registered somewhere.