Skip to content

Commit 04ef844

Browse files
committed
docs: fix generation of HAL component list
Checking of existing items failed because '../docs/html/hal' has not yet been created at this stage. Also added correct dependencies and removed a useless target. Thanks to @jepler for figuring this out.
1 parent 9b9aa6f commit 04ef844

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

docs/src/Submakefile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,17 +353,12 @@ htmldocs: svgs_made_from_dots .htmldoc-stamp checkref_en
353353
.htmldoc-stamp: copy_asciidoc_files gen_complist $(HTML_TARGETS) .images-stamp .include-stamp
354354
touch $@
355355

356-
.PHONY: copy_asciidoc_files gen_complist gen_complist_links
357-
copy_asciidoc_files:
358-
cp -f /etc/asciidoc/stylesheets/*.css $(DOC_DIR)/html
359-
cp -f /etc/asciidoc/javascripts/*.js $(DOC_DIR)/html
356+
copy_asciidoc_files: $(wildcard /etc/asciidoc/stylesheets/*.css) $(wildcard /etc/asciidoc/javascripts/*.js)
357+
cp -f $^ $(DOC_DIR)/html
360358

361-
gen_complist:
359+
gen_complist: $(DOC_SRCDIR)/gen_complist.py $(DOC_SRCDIR)/hal/components.adoc $(MAN_HTML_TARGETS)
360+
mkdir -p $(DOC_DIR)/html/hal
362361
python3 $(DOC_SRCDIR)/gen_complist.py $(DOC_SRCDIR)/hal/components.adoc
363-
touch $(DOC_SRCDIR)/hal/components.adoc
364-
365-
gen_complist_links:
366-
python3 $(DOC_SRCDIR)/gen_complist.py $(DOC_SRCDIR)/hal/components.adoc links
367362

368363
checkref: checkref_en checkref_de checkref_es checkref_fr checkref_hu checkref_nb checkref_vi checkref_zh_CN
369364

docs/src/gen_complist.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def generate_complist(complist_path):
3333
print('gen_complist: Broken link:', link, file=sys.stderr)
3434
miss_in_man.add(comp_man.split(".")[0])
3535
else:
36-
print("gen_complist: Component", splitted[1], "without link")
36+
print("gen_complist: Component \"" + splitted[1].strip() + "\" without link")
3737
miss_in_man.add(splitted[1])
3838
file1.close()
3939
miss_in_list = man_files.difference(complist_doc)
@@ -55,7 +55,7 @@ def generate_complist(complist_path):
5555
file2.close()
5656

5757
generate_links(gen_filename, False, True)
58-
print('gen_complist: Added {} uncategorized and {} obsolete entries to hal component list'.format(len(miss_in_list), len(miss_in_man)))
58+
print('gen_complist: Added {} uncategorized and {} potentially obsolete entrie(s) to hal component list'.format(len(miss_in_list), len(miss_in_man)))
5959

6060

6161
def generate_links(filename, create_backup=True, add_descr=False):
@@ -69,7 +69,7 @@ def generate_links(filename, create_backup=True, add_descr=False):
6969
if 'link:' in splitted[1]:
7070
link = re.search('(?<=link:).*(?=\[)', splitted[1]).group()
7171
if not os.path.isfile(os.path.join('../docs/html/hal',link)):
72-
print('gen_complist_link: Broken link:', link)
72+
print('gen_complist: Broken link:', link)
7373
else:
7474
comp_man = splitted[1].strip(' ')
7575
if comp_man in man_files:
@@ -91,7 +91,7 @@ def generate_links(filename, create_backup=True, add_descr=False):
9191
for line in file_links:
9292
file.write(line)
9393
file.close()
94-
print('gen_complist_links: Added {} link(s) to {}'.format(links_added, filename))
94+
print('gen_complist: Added {} link(s) to {}'.format(links_added, filename))
9595

9696

9797
def extract_descr(filename):

0 commit comments

Comments
 (0)