From 09404e63f5819e7d7b2b17a564202fee3e8a513f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 3 Oct 2019 14:52:40 -0700 Subject: [PATCH] Simplify postprocessing, remove changes no longer needed, or edit them for Sphinx 2.2.0. --- .gitignore | 2 +- docs/sphinx/_static/css/phoenix.css | 13 ++++++++++++ etgtools/sphinx_generator.py | 8 +++----- sphinxtools/postprocess.py | 31 +++++++++++------------------ 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index c7b0a6d3..294df548 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ mydbstub.py* /bin/waf3-* /bin/doxygen-* -/docs/html +/docs/* /docs/sphinx/*.txt /docs/sphinx/*.rst /docs/sphinx/*.pkl diff --git a/docs/sphinx/_static/css/phoenix.css b/docs/sphinx/_static/css/phoenix.css index c94f5072..a0b3402f 100644 --- a/docs/sphinx/_static/css/phoenix.css +++ b/docs/sphinx/_static/css/phoenix.css @@ -29,6 +29,11 @@ td.field-body > blockquote { margin-bottom: 0.5em; } +table.docutils.align-default tbody tr td p { + margin: 0; + padding: 5px 0 05px; +} + /* spacing around example code */ div.highlight > pre { padding: 2px 5px 2px 5px; @@ -744,3 +749,11 @@ table.contentstable p.mybiglink { line-height: 150%; } +hr.overloadsep { + color: #0000FF; + background-color: #0000FF; + height: 1px; + border: none; + width: 50%; + float: left; +} \ No newline at end of file diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index 61b9c581..8e4cdfc7 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1985,7 +1985,7 @@ class XMLDocString(object): if hasattr(xml_item, 'deprecated') and xml_item.deprecated and isinstance(xml_item.deprecated, string_base): element = et.Element('deprecated', kind='deprecated') element.text = xml_item.deprecated - + deprecated_section = Section(element, None, self.kind, self.is_overload, self.share_docstrings) self.root.AddSection(deprecated_section) @@ -2869,15 +2869,13 @@ class XMLDocString(object): pickleItem(desc, self.current_module, self.class_name, 'class') if self.overloads: - docstrings += '\n\n%s|overload| Overloaded Implementations:\n\n'%spacer - docstrings += '%s**~~~**\n\n'%spacer + docstrings += '%s:html:`

`\n\n'%spacer for index, over in enumerate(self.overloads): for line in over.splitlines(): docstrings += spacer + line + '\n' - - docstrings += '%s**~~~**\n\n'%spacer + docstrings += '%s:html:`

`\n\n'%spacer if '**Perl Note:**' in docstrings: index = docstrings.index('**Perl Note:**') diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py index de92f1ec..142ae5a8 100644 --- a/sphinxtools/postprocess.py +++ b/sphinxtools/postprocess.py @@ -56,6 +56,9 @@ def makeHeadings(): rel_path = os.path.normpath(rel_path).replace('\\', '/') text += templates.TEMPLATE_HEADINGS % (name, rel_path, width) + # Add custom roles + text += "\n.. role:: html(raw)\n :format: html\n\n" + writeIfChanged(heading_file, text) # ----------------------------------------------------------------------- # @@ -68,7 +71,7 @@ def genIndexes(sphinxDir): main class index and some clean-up/maintenance of the generated ReST files. """ - + print("Generating indexes...") pklfiles = glob.glob(sphinxDir + '/*.pkl') for file in pklfiles: @@ -519,6 +522,7 @@ def makeModuleIndex(sphinxDir, file): # ----------------------------------------------------------------------- # def genGallery(): + print("Generating gallery...") link = '