lepture / shibuya

A responsive, good looking with modern design documentation theme for Sphinx, with great supports for many sphinx extensions.
https://shibuya.lepture.com
BSD 3-Clause "New" or "Revised" License
175 stars 5 forks source link

Error on Windows Paths #8

Closed vivekjoshy closed 1 year ago

vivekjoshy commented 1 year ago

Shibuya is failing to build using the HTML builder of sphinx due to a path problem.

(3.11) PS C:\Users\taven\PycharmProjects\OpenGrammar\docs> sphinx-build -M html source build -v
Running Sphinx v7.1.0
Adding copy buttons to code blocks...
making output directory... done
checking bibtex cache... out of date
parsing bibtex file C:\Users\taven\PycharmProjects\OpenGrammar\docs\source\references.bib... parsed 0 entries
locale_dir C:\Users\taven\PycharmProjects\OpenGrammar\docs\source\locales\en\LC_MESSAGES does not exists
[autosummary] generating autosummary for: contributing.rst, contributors.rst, index.rst, installation.rst, internals.rst, license.rst, references.rst
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://www.sphinx-doc.org/en/master/objects.inv...
C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\autoapi\mappers\python\mapper.py:294: RemovedInSphinx80Warning: The alias 'sphinx.util.status_iterator' is deprecated, use 'sphinx.util.display.status_iterator' instead. Check CHANGES for Sphinx API modifications.
  for dir_root, path in sphinx.util.status_iterator(
[AutoAPI] Reading files... [100%] C:\Users\taven\PycharmProjects\OpenGrammar\opengrammar\__init__.py
C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\autoapi\mappers\base.py:294: RemovedInSphinx80Warning: The alias 'sphinx.util.status_iterator' is deprecated, use 'sphinx.util.display.status_iterator' instead. Check CHANGES for Sphinx API modifications.
  for _, data in sphinx.util.status_iterator(
[AutoAPI] Mapping Data... [100%] C:\Users\taven\PycharmProjects\OpenGrammar\opengrammar\__init__.py
C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\autoapi\mappers\base.py:312: RemovedInSphinx80Warning: The alias 'sphinx.util.status_iterator' is deprecated, use 'sphinx.util.display.status_iterator' instead. Check CHANGES for Sphinx API modifications.
  for _, obj in sphinx.util.status_iterator(
[AutoAPI] Rendering Data... [100%] opengrammar
Rendering opengrammar

myst v2.0.0: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=set(), disable_syntax=[], all_links_external=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_d
omains=None, fence_as_directive=set(), number_code_blocks=[], title_to_header=False, heading_anchors=0, heading_slug_func=None, html_meta={}, footnote_transition=True, words_per_minute=200, 
substitutions={}, linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', enable_checkboxes=False, suppress_warnings=[], highlight_code_blocks=True)
locale_dir C:\Users\taven\PycharmProjects\OpenGrammar\docs\source\locales\en\LC_MESSAGES does not exists
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 7 source files that are out of date
updating environment: locale_dir C:\Users\taven\PycharmProjects\OpenGrammar\docs\source\locales\en\LC_MESSAGES does not exists
[new config] 8 added, 0 changed, 0 removed
reading sources... [ 12%] api/opengrammar/index
reading sources... [ 25%] contributing
reading sources... [ 38%] contributors
reading sources... [ 50%] index
reading sources... [ 62%] installation
reading sources... [ 75%] internals
reading sources... [ 88%] license
reading sources... [100%] references

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... copying static files... done
copying extra files... done
done
writing output... [ 12%] api/opengrammar/index

Traceback (most recent call last):
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\html\__init__.py", line 1098, in handle_page
    output = self.templates.render(templatename, ctx)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\jinja2glue.py", line 196, in render
    return self.environment.get_template(template).render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\jinja2\environment.py", line 1301, in render
    self.environment.handle_exception()
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\jinja2\environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\shibuya\theme\shibuya\page.html", line 19, in top-level template code
    {% set dark_code = False %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\shibuya\theme\shibuya\base.html", line 59, in top-level template code
    {%- block styles -%}
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\shibuya\theme\shibuya\base.html", line 62, in block 'styles'
    {{ css_tag(css) }}
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\jinja2\sandbox.py", line 393, in call
    return __context.call(__obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\html\__init__.py", line 1202, in css_tag
    if checksum := _file_checksum(app.outdir, css.filename):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\html\__init__.py", line 1254, in _file_checksum
    with open(path.join(outdir, filename), encoding='utf-8') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'C:\\Users\\taven\\PycharmProjects\\OpenGrammar\\docs\\build\\html\\_static/print.css?v=2023.7.16'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\cmd\build.py", line 290, in build_main
    app.build(args.force_all, args.filenames)
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\application.py", line 351, in build
    self.builder.build_update()
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\__init__.py", line 290, in build_update
    self.build(to_build,
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\__init__.py", line 360, in build
    self.write(docnames, list(updated_docnames), method)
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\__init__.py", line 567, in write
    self._write_serial(sorted(docnames))
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\__init__.py", line 577, in _write_serial
    self.write_doc(docname, doctree)
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\html\__init__.py", line 675, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "C:\Users\taven\PycharmProjects\OpenGrammar\venv\3.11\Lib\site-packages\sphinx\builders\html\__init__.py", line 1105, in handle_page
    raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
sphinx.errors.ThemeError: An error happened in rendering the page api/opengrammar/index.
Reason: OSError(22, 'Invalid argument')

Relevant Sphinx Issue: https://github.com/sphinx-doc/sphinx/issues/11518

lepture commented 1 year ago

Is the latest release working on Windows now?

vivekjoshy commented 1 year ago

Yes, looks like it's fixed in the latest release. Thank you!