Lines Matching refs:nodes

38 from docutils import nodes
50 from sphinx.util.nodes import NodeMatcher, make_refnode
77 result = nodes.inline()
83 result += nodes.Text(text[last_end : match.start()])
87 result += nodes.abbreviation(abbr, abbr, explanation=explanation)
92 result += nodes.Text(text[last_end:])
109 class CodeSampleNode(nodes.Element):
113 class RelatedCodeSamplesNode(nodes.Element):
117 class CodeSampleCategoryNode(nodes.Element):
121 class CodeSampleListingNode(nodes.Element):
125 class BoardNode(nodes.Element):
154 new_section = nodes.section(ids=[node["id"]])
155 new_section += nodes.title(text=node["name"])
158 gh_link_button = nodes.raw(
168 new_section += nodes.paragraph("", "", gh_link_button)
182 see_also_section = nodes.section(ids=["see-also"])
183 see_also_section += nodes.title(text="See also")
198 api_xref += nodes.Text(api)
206 meta_description = nodes.meta()
213 json_ld = nodes.raw(
272 new_section = nodes.section(ids=[node["id"]])
273 new_section += nodes.title(text=node["full_name"])
276 sidebar = nodes.sidebar(classes=["board-overview"])
278 sidebar += nodes.title(text="Board Overview")
281 figure = nodes.figure()
283 figure += nodes.image(uri=f"/{node['image']}", scale=100)
284 figure += nodes.caption(text=node["full_name"])
287 field_list = nodes.field_list()
291 ("Name", nodes.literal(text=node["id"])),
298 field = nodes.field()
299 field_name = nodes.field_name(text=property_name)
300 field_body = nodes.field_body()
301 if isinstance(value, nodes.Node):
304 field_body += nodes.paragraph(text=value)
310 gh_link_button = nodes.raw(
338 def output_sample_categories_list_items(self, tree, container: nodes.Node):
339 list_item = nodes.list_item()
345 reference = nodes.reference(
348 *[nodes.Text(tree.category["name"])],
365 bullet_list = nodes.bullet_list()
377 li = nodes.list_item()
378 sample_xref = nodes.reference(
381 *[nodes.Text(code_sample["name"])],
408 bullet_list = nodes.bullet_list()
417 def output_sample_categories_sections(self, tree, container: nodes.Node, show_titles=False):
419 section = nodes.section(ids=[tree.category["id"]])
426 child=nodes.Text(tree.category["name"]),
428 title = nodes.title("", "", link)
459 container = nodes.container()
463 search_input = nodes.raw(
501 ul = nodes.bullet_list(classes=["code-sample-list"])
504 li = nodes.list_item()
513 sample_xref += nodes.Text(code_sample["name"])
514 li += nodes.inline("", "", sample_xref, classes=["code-sample-name"])
516 li += nodes.inline(
542 admonition = nodes.admonition()
543 admonition += nodes.title(text="Related code samples")
584 description_node = nodes.container(ids=[f"{code_sample_id}-description"])
754 return [nodes.raw("", rendered, format="html")]
756 return [nodes.paragraph(text="Board catalog is only available in HTML.")]
783 paragraph = nodes.paragraph()
784 paragraph += nodes.Text("The ")
785 paragraph += nodes.literal(text=board_node["id"])
786 paragraph += nodes.Text(" board supports the hardware features listed below.")
790 note = nodes.admonition()
791 note += nodes.title(text="Note")
793 note += nodes.paragraph(
826 result_nodes.append(nodes.raw("", html_contents, format="html"))
832 target_heading = nodes.section(ids=[f"{board_node['id']}-{target}-hw-features"])
833 heading = nodes.title()
834 heading += nodes.literal(text=target)
835 heading += nodes.Text(" target")
839 table = nodes.table(classes=["colwidths-given", "hardware-features"])
840 tgroup = nodes.tgroup(cols=4)
842 tgroup += nodes.colspec(colwidth=15, classes=["type"])
843 tgroup += nodes.colspec(colwidth=12, classes=["location"])
844 tgroup += nodes.colspec(colwidth=53, classes=["description"])
845 tgroup += nodes.colspec(colwidth=20, classes=["compatible"])
847 thead = nodes.thead()
848 row = nodes.row()
851 entry = nodes.entry(classes=[header.lower()])
852 entry += nodes.paragraph(text=header)
857 tbody = nodes.tbody()
873 row = nodes.row()
877 type_entry = nodes.entry(morerows=num_items - 1, classes=["type"])
878 type_entry += nodes.paragraph(
882 feature, nodes.Text(feature)
888 location_entry = nodes.entry(classes=["location"])
889 location_para = nodes.paragraph()
892 location_chip = nodes.inline(
898 location_chip = nodes.inline(
908 desc_entry = nodes.entry(classes=["description"])
909 desc_para = nodes.paragraph(classes=["status"])
910 desc_para += nodes.Text(value["description"])
927 return nodes.inline(
951 compatible_entry = nodes.entry(classes=["compatible"])
960 xref += nodes.literal(text=key)
961 compatible_entry += nodes.paragraph("", "", xref)
980 "code-sample": XRefRole(innernodeclass=nodes.inline, warn_dangling=True),
981 "code-sample-category": XRefRole(innernodeclass=nodes.inline, warn_dangling=True),
982 "board": XRefRole(innernodeclass=nodes.inline, warn_dangling=True),
1115 contnode = [nodes.Text(elem["name"] if type != "board" else elem["full_name"])]
1177 nodes = super().run()
1180 return [*nodes, RelatedCodeSamplesNode(id=self.arguments[0])]
1182 return nodes
1204 app: Sphinx, pagename: str, templatename: str, context: dict[str, Any], doctree: nodes.Node