diff --git a/docs/script/make_doc.py b/docs/script/make_doc.py index dc56e23..d3cc302 100644 --- a/docs/script/make_doc.py +++ b/docs/script/make_doc.py @@ -82,6 +82,8 @@ def process_section(section, output_file, pth): output_file_name = sys.argv[1] output_file = open(output_file_name, "w") output_file.writelines(document_header) +see_also_lines = [] + for in_f in doc_file_path: print(f"Processing: {in_f}") output_file.write(f".. Generated from {in_f}\n\n") @@ -90,12 +92,18 @@ def process_section(section, output_file, pth): lines = input_file.readlines() is_seo = False is_section = False + is_in_see_also = False section = [] l_counter = 0 for line in lines: l_counter += 1 if line == "See Also\n": - break + is_in_see_also = True + continue + if is_in_see_also: + if line.startswith('- '): + see_also_lines.append(process_esphome_refs(line.rstrip(), l_counter)) + continue if is_section: if (line in ['\n', '\r\n']) or line.startswith(" "): section.append(line) @@ -116,4 +124,6 @@ def process_section(section, output_file, pth): continue l = process_esphome_refs(line, l_counter) output_file.write(l) - print(f"\tProcessed {l_counter} line(s)") \ No newline at end of file + print(f"\tProcessed {l_counter} line(s)") +print("Processing See Also section") +print(see_also_lines) \ No newline at end of file