[docmaker] Fix missing `Defined in (...)' under Windows/Cygwin.

This platform uses backslashes for paths, which docmaker didn't
understand correctly.

* src/tools/docmaker/tohtml.py (HtmlFormatter::blockEnter): Use
`os.path.normpath' to normalize the path for the platform being
used.
This commit is contained in:
Nikhil Ramakrishnan 2018-05-25 22:16:11 +02:00 committed by Werner Lemberg
parent 7b73cb0707
commit 51fee65583
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,14 @@
2018-05-25 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>
[docmaker] Fix missing `Defined in (...)' under Windows/Cygwin.
This platform uses backslashes for paths, which docmaker didn't
understand correctly.
* src/tools/docmaker/tohtml.py (HtmlFormatter::blockEnter): Use
`os.path.normpath' to normalize the path for the platform being
used.
2018-05-24 Alexei Podtelezhnikov <apodtele@gmail.com>
[smooth] Formalize Harmony LCD rendering.

View File

@ -676,7 +676,8 @@ class HtmlFormatter( Formatter ):
if block.code:
header = ''
for f in self.headers.keys():
if block.source.filename.find( f ) >= 0:
header_filename = os.path.normpath(block.source.filename)
if header_filename.find( os.path.normpath( f ) ) >= 0:
header = self.headers[f] + ' (' + f + ')'
break