Merge pull request #6836 from tk0miya/6813_orphan_warning_for_included_document

Fix #6813: An orphan warning is emitted for included document on Windows
This commit is contained in:
Takeshi KOMIYA 2019-11-17 15:05:35 +09:00 committed by GitHub
commit 948ac3a1f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,8 @@ Bugs fixed
* #6809: LaTeX: code-block in a danger type admonition can easily spill over * #6809: LaTeX: code-block in a danger type admonition can easily spill over
bottom of page bottom of page
* #6793: texinfo: Code examples broken following "sidebar" * #6793: texinfo: Code examples broken following "sidebar"
* #6813: An orphan warning is emitted for included document on Windows. Thanks
to @drillan
Testing Testing
-------- --------

View File

@ -13,6 +13,7 @@ import os
from sphinx.locale import __ from sphinx.locale import __
from sphinx.util import get_matching_files from sphinx.util import get_matching_files
from sphinx.util import logging from sphinx.util import logging
from sphinx.util import path_stabilize
from sphinx.util.matching import compile_matchers from sphinx.util.matching import compile_matchers
from sphinx.util.osutil import SEP, relpath from sphinx.util.osutil import SEP, relpath
@ -71,6 +72,7 @@ class Project:
filename = relpath(filename, self.srcdir) filename = relpath(filename, self.srcdir)
for suffix in self.source_suffix: for suffix in self.source_suffix:
if filename.endswith(suffix): if filename.endswith(suffix):
filename = path_stabilize(filename)
return filename[:-len(suffix)] return filename[:-len(suffix)]
# the file does not have docname # the file does not have docname