Lines Matching full:nodes

37 from docutils import nodes
49 from sphinx.util.nodes import NodeMatcher, make_refnode
71 class CodeSampleNode(nodes.Element):
75 class RelatedCodeSamplesNode(nodes.Element):
79 class CodeSampleCategoryNode(nodes.Element):
83 class CodeSampleListingNode(nodes.Element):
87 class BoardNode(nodes.Element):
101 Transforms a `CodeSampleNode` into a `nodes.section` named after the code sample name.
103 Moves all sibling nodes that are after the `CodeSampleNode` in the document under this new
116 new_section = nodes.section(ids=[node["id"]])
117 new_section += nodes.title(text=node["name"])
120 gh_link_button = nodes.raw(
130 new_section += nodes.paragraph("", "", gh_link_button)
132 # Move the sibling nodes under the new section
144 see_also_section = nodes.section(ids=["see-also"])
145 see_also_section += nodes.title(text="See also")
160 api_xref += nodes.Text(api)
168 meta_description = nodes.meta()
175 json_ld = nodes.raw(
234 new_section = nodes.section(ids=[node["id"]])
235 new_section += nodes.title(text=node["full_name"])
238 sidebar = nodes.sidebar(classes=["board-overview"])
240 sidebar += nodes.title(text="Board Overview")
243 figure = nodes.figure()
245 figure += nodes.image(uri=f"/{node['image']}", scale=100)
246 figure += nodes.caption(text=node["full_name"])
249 field_list = nodes.field_list()
253 ("Name", nodes.literal(text=node["id"])),
260 field = nodes.field()
261 field_name = nodes.field_name(text=property_name)
262 field_body = nodes.field_body()
263 if isinstance(value, nodes.Node):
266 field_body += nodes.paragraph(text=value)
271 # Move the sibling nodes under the new section
285 def output_sample_categories_list_items(self, tree, container: nodes.Node):
286 list_item = nodes.list_item()
292 reference = nodes.reference(
295 *[nodes.Text(tree.category["name"])],
312 bullet_list = nodes.bullet_list()
324 li = nodes.list_item()
325 sample_xref = nodes.reference(
328 *[nodes.Text(code_sample["name"])],
355 bullet_list = nodes.bullet_list()
364 def output_sample_categories_sections(self, tree, container: nodes.Node, show_titles=False):
366 section = nodes.section(ids=[tree.category["id"]])
373 child=nodes.Text(tree.category["name"]),
375 title = nodes.title("", "", link)
406 container = nodes.container()
410 search_input = nodes.raw(
443 Creates a bullet list (`nodes.bullet_list`) of code samples from a list of code samples.
448 ul = nodes.bullet_list(classes=["code-sample-list"])
451 li = nodes.list_item()
460 sample_xref += nodes.Text(code_sample["name"])
461 li += nodes.inline("", "", sample_xref, classes=["code-sample-name"])
463 li += nodes.inline(
489 admonition = nodes.admonition()
490 admonition += nodes.title(text="Related code samples")
531 description_node = nodes.container(ids=[f"{code_sample_id}-description"])
698 return [nodes.raw("", rendered, format="html")]
700 return [nodes.paragraph(text="Board catalog is only available in HTML.")]
710 "code-sample": XRefRole(innernodeclass=nodes.inline, warn_dangling=True),
711 "code-sample-category": XRefRole(innernodeclass=nodes.inline, warn_dangling=True),
712 "board": XRefRole(innernodeclass=nodes.inline, warn_dangling=True),
841 contnode = [nodes.Text(elem["name"] if type != "board" else elem["full_name"])]
888 # Add missing nodes under the last existing node
903 nodes = super().run()
906 return [*nodes, RelatedCodeSamplesNode(id=self.arguments[0])]
908 return nodes
930 app: Sphinx, pagename: str, templatename: str, context: dict[str, Any], doctree: nodes.Node