mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fixes #6759: validation of html static paths and extra paths no longer throws an error if the paths are in different directories
This commit is contained in:
parent
f30e2af762
commit
c6bd00dbb9
1
AUTHORS
1
AUTHORS
@ -25,6 +25,7 @@ Other contributors, listed alphabetically, are:
|
||||
* Henrique Bastos -- SVG support for graphviz extension
|
||||
* Daniel Bültmann -- todo extension
|
||||
* Marco Buttu -- doctest extension (pyversion option)
|
||||
* Nathan Damon -- bugfix in validation of static paths in html builders
|
||||
* Etienne Desautels -- apidoc module
|
||||
* Michael Droettboom -- inheritance_diagram extension
|
||||
* Charles Duffy -- original graphviz extension
|
||||
|
1
CHANGES
1
CHANGES
@ -18,6 +18,7 @@ Bugs fixed
|
||||
|
||||
* #6641: LaTeX: Undefined control sequence ``\sphinxmaketitle``
|
||||
* #6710: LaTeX not well configured for Greek language as main language
|
||||
* #6759: validation of html static paths and extra paths no longer throws an error if the paths are in different directories
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -1162,9 +1162,14 @@ def validate_html_extra_path(app: Sphinx, config: Config) -> None:
|
||||
if not path.exists(extra_path):
|
||||
logger.warning(__('html_extra_path entry %r does not exist'), entry)
|
||||
config.html_extra_path.remove(entry)
|
||||
elif path.commonpath([app.outdir, extra_path]) == app.outdir:
|
||||
logger.warning(__('html_extra_path entry %r is placed inside outdir'), entry)
|
||||
config.html_extra_path.remove(entry)
|
||||
else:
|
||||
try:
|
||||
common_path = path.commonpath([app.outdir, extra_path])
|
||||
except ValueError: # different directories, can skip to next
|
||||
continue
|
||||
if common_path == app.outdir:
|
||||
logger.warning(__('html_extra_path entry %r is placed inside outdir'), entry)
|
||||
config.html_extra_path.remove(entry)
|
||||
|
||||
|
||||
def validate_html_static_path(app: Sphinx, config: Config) -> None:
|
||||
@ -1174,9 +1179,14 @@ def validate_html_static_path(app: Sphinx, config: Config) -> None:
|
||||
if not path.exists(static_path):
|
||||
logger.warning(__('html_static_path entry %r does not exist'), entry)
|
||||
config.html_static_path.remove(entry)
|
||||
elif path.commonpath([app.outdir, static_path]) == app.outdir:
|
||||
logger.warning(__('html_static_path entry %r is placed inside outdir'), entry)
|
||||
config.html_static_path.remove(entry)
|
||||
else:
|
||||
try:
|
||||
common_path = path.commonpath([app.outdir, static_path])
|
||||
except ValueError: # different directories, can skip to next
|
||||
continue
|
||||
if common_path == app.outdir:
|
||||
logger.warning(__('html_static_path entry %r is placed inside outdir'), entry)
|
||||
config.html_static_path.remove(entry)
|
||||
|
||||
|
||||
def validate_html_logo(app: Sphinx, config: Config) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user