mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-24 17:08:15 +01:00
updates schema generator (#2244)
This commit is contained in:
parent
300a511bde
commit
f498bde89a
@ -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(
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user