From 51fee655837ef99084767873266aaddfa3a31da5 Mon Sep 17 00:00:00 2001 From: Nikhil Ramakrishnan Date: Fri, 25 May 2018 22:16:11 +0200 Subject: [PATCH] [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. --- ChangeLog | 11 +++++++++++ src/tools/docmaker/tohtml.py | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7c19448c0..1d4602946 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2018-05-25 Nikhil Ramakrishnan + + [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 [smooth] Formalize Harmony LCD rendering. diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py index 9f318a2a4..97a5459bc 100644 --- a/src/tools/docmaker/tohtml.py +++ b/src/tools/docmaker/tohtml.py @@ -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