binman: Add rST references for binman entry types
Add references in the documentation for each entry type, so we can refer
to them from other documentation.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index a07a588..e3767ae 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -750,6 +750,11 @@
first_line = lines[0]
rest = [line[4:] for line in lines[1:]]
hdr = 'Entry: %s: %s' % (name.replace('_', '-'), first_line)
+
+ # Create a reference for use by rST docs
+ ref_name = f'etype_{module.__name__[6:]}'.lower()
+ print('.. _%s:' % ref_name)
+ print()
print(hdr)
print('-' * len(hdr))
print('\n'.join(rest))