updates schema generator (#2244)

This commit is contained in:
Guillermo Ruffino 2022-08-30 22:57:35 -03:00 committed by GitHub
parent 300a511bde
commit f498bde89a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python
# reStructuredText (RST) to GitHub-flavored Markdown converter
import re
import sys
from docutils import core, nodes, writers
from urllib import parse
@ -32,8 +31,7 @@ class Translator(nodes.NodeVisitor):
raise nodes.StopTraversal
def visit_title(self, node):
self.version = re.match(r"(\d+\.\d+\.\d+).*", node.children[0]).group(1)
raise nodes.SkipChildren
pass
def visit_title_reference(self, node):
raise Exception(

View File

@ -834,7 +834,14 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
self.app.config.html_baseurl,
self.docname + ".html#" + title.parent["ids"][0],
)
markdown += f"\n\n*See also: [{self.props_section_title}]({url})*"
if (
self.props_section_title is not None
and self.props_section_title.endswith(title.astext())
):
markdown += f"\n\n*See also: [{self.props_section_title}]({url})*"
else:
markdown += f"\n\n*See also: [{self.getMarkdown(title)}]({url})*"
return markdown
def update_prop(self, node, props):