Skip to content

Commit f498bde

Browse files
authored
updates schema generator (esphome#2244)
1 parent 300a511 commit f498bde

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

markdown.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
# reStructuredText (RST) to GitHub-flavored Markdown converter
33

4-
import re
54
import sys
65
from docutils import core, nodes, writers
76
from urllib import parse
@@ -32,8 +31,7 @@ def depart_section(self, node):
3231
raise nodes.StopTraversal
3332

3433
def visit_title(self, node):
35-
self.version = re.match(r"(\d+\.\d+\.\d+).*", node.children[0]).group(1)
36-
raise nodes.SkipChildren
34+
pass
3735

3836
def visit_title_reference(self, node):
3937
raise Exception(

schema_doc.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,14 @@ def getMarkdownParagraph(self, node):
834834
self.app.config.html_baseurl,
835835
self.docname + ".html#" + title.parent["ids"][0],
836836
)
837-
markdown += f"\n\n*See also: [{self.props_section_title}]({url})*"
837+
if (
838+
self.props_section_title is not None
839+
and self.props_section_title.endswith(title.astext())
840+
):
841+
markdown += f"\n\n*See also: [{self.props_section_title}]({url})*"
842+
else:
843+
markdown += f"\n\n*See also: [{self.getMarkdown(title)}]({url})*"
844+
838845
return markdown
839846

840847
def update_prop(self, node, props):

0 commit comments

Comments
 (0)