Skip to content

Commit 405d187

Browse files
kartbencfriedt
authored andcommitted
ci: doc-build.yml: do not tweak manifest.project-filter unnecessarily
The documentation build shouldn't need to pull in anything beyond what's active by default in the west.yml manifest. In fact, due to the way the manifest_projects_table.py script currently works, it is important that have a local west config that's "vanilla" so that the table of active/inactive projects is correct. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent a1c54f5 commit 405d187

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

doc/_scripts/gen_devicetree_rest.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,17 @@ def write_orphans(bindings, base_binding, vnd_lookup, driver_sources, out_dir):
499499
logging.info('done writing :orphan: files; %d files needed updates',
500500
num_written)
501501

502+
def make_sidebar(compatible, vendor_name, vendor_ref_target, driver_path=None):
503+
lines = [
504+
".. sidebar:: Overview",
505+
"",
506+
f" :Name: ``{compatible}``",
507+
f" :Vendor: :ref:`{vendor_name} <{vendor_ref_target}>`",
508+
]
509+
if driver_path:
510+
lines.append(f" :Driver: :zephyr_file:`{driver_path}`")
511+
return "\n".join(lines) + "\n"
512+
502513
def print_binding_page(binding, base_names, vnd_lookup, driver_sources,dup_compats,
503514
string_io):
504515
# Print the rst content for 'binding' to 'string_io'. The
@@ -550,24 +561,18 @@ def print_binding_page(binding, base_names, vnd_lookup, driver_sources,dup_compa
550561
{underline}
551562
''', string_io)
552563

553-
# Vendor: <link-to-vendor-section>
554564
vnd = compatible_vnd(compatible)
555-
print('Vendor: '
556-
f':ref:`{vnd_lookup.vendor(vnd)} <{vnd_lookup.target(vnd)}>`\n',
557-
file=string_io)
558-
559-
# Link to driver implementation (if it exists).
560-
compatible = re.sub("[-,.@/+]", "_", compatible.lower())
561-
if compatible in driver_sources:
562-
print_block(
563-
f"""\
564-
.. note::
565-
566-
An implementation of a driver matching this compatible is available in
567-
:zephyr_file:`{driver_sources[compatible]}`.
568-
""",
569-
string_io,
570-
)
565+
vendor_name = vnd_lookup.vendor(vnd)
566+
vendor_target = vnd_lookup.target(vnd)
567+
driver_path = driver_sources.get(re.sub("[-,.@/+]", "_", compatible.lower()))
568+
569+
sidebar_content = make_sidebar(
570+
compatible=compatible,
571+
vendor_name=vendor_name,
572+
vendor_ref_target=vendor_target,
573+
driver_path=driver_path,
574+
)
575+
print_block(sidebar_content, string_io)
571576

572577
# Binding description.
573578
if binding.bus:

0 commit comments

Comments
 (0)