From 12c81f22a951526416667580c93c438540706822 Mon Sep 17 00:00:00 2001 From: Istvan Kiss Date: Tue, 28 Apr 2026 15:27:12 +0200 Subject: [PATCH 01/10] Add markdown download button --- docs/conf.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 59df1884..73ae5ab6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,8 @@ """Configuration file for the Sphinx documentation builder.""" import os from sphinx import addnodes +from pathlib import Path +import shutil external_projects_remote_repository = "" external_projects_current_project = "dcgpu" @@ -20,10 +22,12 @@ copyright = "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved." # Required settings +html_copy_source = True html_theme = "rocm_docs_theme" html_theme_options = { "flavor": "instinct", "link_main_doc": True, + "use_download_button": True, "nav_secondary_items": { "Community": "https://github.com/ROCm/ROCm/discussions", "Blogs": "https://rocm.blogs.amd.com/", @@ -43,5 +47,56 @@ exclude_patterns = ['.venv'] +EXCLUDED_DIRS = { + "_build", + "_templates", + "_static", + ".git", + ".venv", +} + +def should_skip(path: Path) -> bool: + return any(part in EXCLUDED_DIRS for part in path.parts) + + +def generate_combined_markdown(app, exception): + if exception: + return + + docs_root = Path(app.srcdir) + + output_file = Path(app.outdir) / "llms.txt" + + print(output_file) + + all_files = sorted(docs_root.rglob("*.md")) + + combined = [] + combined.append("# Combined Documentation\n") + + for doc_file in all_files: + + if should_skip(doc_file): + continue + + relative = doc_file.relative_to(docs_root) + + combined.append(f"\n---\n") + combined.append(f"\n# {relative}\n") + + try: + content = doc_file.read_text(encoding="utf-8") + combined.append(content) + combined.append("\n") + + except Exception as e: + combined.append(f"\n[ERROR reading file: {e}]\n") + + output_file.write_text( + "\n".join(combined), + encoding="utf-8", + ) + def setup(app): app.add_css_file("css/index.css") + app.connect("build-finished", generate_combined_markdown) From 46faa26ee5be9e45e27f16ae3ed091db3a3e00fa Mon Sep 17 00:00:00 2001 From: Kiss Date: Fri, 15 May 2026 12:17:21 +0200 Subject: [PATCH 02/10] Add base llms.txt --- docs/conf.py | 16 ++++++---- docs/llms.txt | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 docs/llms.txt diff --git a/docs/conf.py b/docs/conf.py index 73ae5ab6..8f9976db 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -64,21 +64,25 @@ def generate_combined_markdown(app, exception): return docs_root = Path(app.srcdir) - output_file = Path(app.outdir) / "llms.txt" + base_file = docs_root / "llms.txt" - print(output_file) + combined = [] - all_files = sorted(docs_root.rglob("*.md")) + if base_file.exists(): + combined.append(base_file.read_text(encoding="utf-8")) + else: + combined.append("# AMD Instinct Data Center GPU Documentation\n") - combined = [] - combined.append("# Combined Documentation\n") + all_files = sorted(docs_root.rglob("*.md")) for doc_file in all_files: - if should_skip(doc_file): continue + if doc_file == base_file: + continue + relative = doc_file.relative_to(docs_root) combined.append(f"\n---\n") diff --git a/docs/llms.txt b/docs/llms.txt new file mode 100644 index 00000000..1fb7ba33 --- /dev/null +++ b/docs/llms.txt @@ -0,0 +1,83 @@ +# AMD Instinct Data Center GPU Documentation + +> Comprehensive guides and technical documentation for deploying AMD Instinct Data Center GPUs in enterprise environments. Covers system administration, cluster management, monitoring, and operational best practices for HPC and AI workloads. For API documentation and the ROCm software stack, see https://rocm.docs.amd.com. + +## GPU architecture + +- [AMD Instinct GPU architecture overview](https://instinct.docs.amd.com/en/latest/gpu-arch/gpu-arch.html): Microarchitecture overview of AMD Instinct MI350, MI300, MI250, and MI100 GPU accelerators. +- [AMD Instinct MI350](https://instinct.docs.amd.com/en/latest/gpu-arch/mi350.html): Architecture and specifications for the MI350 series. +- [AMD Instinct MI300](https://instinct.docs.amd.com/en/latest/gpu-arch/mi300.html): Architecture and specifications for the MI300 series, including MI300X and MI300A. +- [AMD Instinct MI250](https://instinct.docs.amd.com/en/latest/gpu-arch/mi250.html): Architecture and specifications for the MI250 series. +- [AMD Instinct MI100](https://instinct.docs.amd.com/en/latest/gpu-arch/mi100.html): Architecture and specifications for the MI100 series. + +## System administration + +### Bare metal + +- [Instinct GPU Driver](https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/): Install and configure the AMD GPU driver. Covers logging and error codes. +- [Instinct Customer Acceptance Guide](https://instinct.docs.amd.com/projects/system-acceptance/en/latest/): Configure, validate, benchmark, and baseline AMD Instinct GPUs. +- [AMD SMI](https://rocm.docs.amd.com/projects/amdsmi/en/latest/): System management interface for monitoring and managing AMD GPUs. +- [ROCm Validation Suite](https://rocm.docs.amd.com/projects/ROCmValidationSuite/en/latest/): System validation and diagnostics. +- [Cluster Validation Suite](https://rocm.docs.amd.com/projects/cvs/en/latest/): Test scripts to validate AMD AI clusters. + +### Containers and orchestration + +- [AMD GPU Operator](https://instinct.docs.amd.com/projects/gpu-operator/en/latest/): Deploy and manage AMD Instinct GPUs within Kubernetes clusters. +- [Network Operator](https://instinct.docs.amd.com/projects/network-operator/en/main/): Use AMD AINICs in Kubernetes environments. +- [Kubernetes Device Plugin](https://instinct.docs.amd.com/projects/k8s-device-plugin/en/latest/): Register AMD GPUs to Kubernetes container clusters. +- [Device Metrics Exporter](https://instinct.docs.amd.com/projects/device-metrics-exporter/en/latest/): Prometheus-format GPU metrics collection. +- [AMD Container Toolkit](https://instinct.docs.amd.com/projects/container-toolkit/en/latest/): Integrate AMD Instinct GPUs with Docker. + +### Cluster management + +- [Cluster Networking](https://instinct.docs.amd.com/projects/gpu-cluster-networking/en/latest/): Optimize networking for Instinct GPU applications. + +### Cloud + +- [Instinct on Azure](https://instinct.docs.amd.com/projects/instinct-azure/latest/): Get started with AMD Instinct on Microsoft Azure. + +### Virtualization + +- [Instinct Virtualization Driver](https://instinct.docs.amd.com/projects/virt-drv/en/latest/): Virtualization driver for AMD Instinct GPUs. +- [AMD SMI for Virtualization](https://instinct.docs.amd.com/projects/amd-smi-virt/en/latest/): Manage and monitor AMD virtualization-enabled GPUs. + +## Workloads + +### Computer vision + +- [Models and applications](https://instinct.docs.amd.com/en/latest/vision/ai.html): Design, train, and infer computer vision models on AMD Instinct GPUs. +- [Image and video decoding](https://instinct.docs.amd.com/en/latest/vision/decode.html): Decode image and video formats using AMD Instinct GPUs. +- [Image processing](https://instinct.docs.amd.com/en/latest/vision/preprocess.html): Eliminate image preprocessing bottlenecks with AMD Instinct GPUs. + +### Data science + +- [ROCm Data Science Toolkit (ROCm-DS)](https://instinct.docs.amd.com/en/latest/data-science/index.html): Accelerate data science workloads on AMD Instinct GPUs. +- [hipDF](https://instinct.docs.amd.com/en/latest/data-science/hipDF.html): GPU-accelerated DataFrames for data manipulation and analysis. +- [hipGRAPH](https://instinct.docs.amd.com/en/latest/data-science/hipGRAPH.html): Create and analyze graphs and complex networks on AMD Instinct GPUs. +- [hipVS](https://instinct.docs.amd.com/en/latest/data-science/hipVS.html): Vector search operations on AMD Instinct GPUs. +- [hipMM](https://instinct.docs.amd.com/en/latest/data-science/hipMM.html): Advanced memory management for ROCm-DS libraries. +- [hipRAFT](https://instinct.docs.amd.com/en/latest/data-science/hipRAFT.html): Fundamental algorithms and primitives for ROCm-DS libraries. + +### Life science + +- [ROCm Toolkit for Life Science (ROCm-LS)](https://instinct.docs.amd.com/en/latest/life-science/index.html): Accelerate life science workloads on AMD Instinct GPUs. +- [hipCIM](https://instinct.docs.amd.com/en/latest/life-science/hipCIM.html): N-dimensional image processing for medical imaging on AMD Instinct GPUs. +- [MONAI](https://instinct.docs.amd.com/en/latest/life-science/MONAI.html): Train and deploy AI models for medical imaging on AMD Instinct GPUs. + +## ISV applications + +- [Ansys Fluent](https://instinct.docs.amd.com/en/latest/isv-apps/ansys-fluent.html): Computational fluid dynamics with AMD GPU acceleration. +- [Ansys Mechanical](https://instinct.docs.amd.com/en/latest/isv-apps/ansys-mechanical.html): Structural simulation on AMD Instinct GPUs. +- [Cadence Fidelity LES Solver](https://instinct.docs.amd.com/en/latest/isv-apps/cadence-fidelity.html): Computational fluid dynamics on AMD Instinct GPUs. +- [Devito Codes DevitoPRO](https://instinct.docs.amd.com/en/latest/isv-apps/devito.html): Seismic imaging on AMD Instinct GPUs. +- [Siemens Simcenter STAR-CCM+](https://instinct.docs.amd.com/en/latest/isv-apps/siemens.html): Multiphysics CFD simulation on AMD Instinct GPUs. +- [Stone Ridge Technology ECHELON](https://instinct.docs.amd.com/en/latest/isv-apps/stone-ridge.html): Reservoir simulation on AMD Instinct GPUs. +- [GSplat](https://instinct.docs.amd.com/en/latest/simulation/gsplat.html): Gaussian splatting on AMD Instinct MI300X. + +## Programming reference + +- [HIP C++](https://rocm.docs.amd.com/projects/HIP/en/latest/): HIP programming model and API for AMD GPUs. +- [OpenMP](https://rocm.docs.amd.com/projects/llvm-project/en/latest/conceptual/openmp.html): OpenMP programming model for AMD GPUs. +- [AMD SMI API](https://rocm.docs.amd.com/projects/amdsmi/en/latest/): Full AMD SMI API reference. + +--- From 45ca7f3c58aa948a0d51ffb90fe95b2cb6892534 Mon Sep 17 00:00:00 2001 From: Kiss Date: Fri, 15 May 2026 12:25:20 +0200 Subject: [PATCH 03/10] Add treshold and exclude MyST directives --- docs/conf.py | 92 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 12 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8f9976db..a27961e9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,10 +55,70 @@ ".venv", } +import re + +EXCLUDED_DIRS = { + "_build", + "_templates", + "_static", + ".git", + ".venv", +} + +MARKUP_PREFIXES = ( + ":::", + "```{", + "```", + ":img-top:", + ":class", + ":link:", + ":link-type:", + ":shadow:", + ":columns:", + ":padding:", + ":gutter:", + ":open:", + ":name:", + ":header-rows:", + ":alt:", + "+++", + "<", + "-->", + "{bdg-", +) + +# Matches lines like "align: center", "alt:", "name: foo" (directive options +# not starting with a colon, common in MyST figure/table fences) +_BARE_DIRECTIVE_RE = re.compile(r"^[a-z][a-z_-]*:\s*\S*$") + +# Matches MyST/RST anchor labels like "(gpu-arch-documentation)=" +_ANCHOR_LABEL_RE = re.compile(r"^\(\w[\w-]*\)=$") + +MIN_PROSE_LINES = 10 + + def should_skip(path: Path) -> bool: return any(part in EXCLUDED_DIRS for part in path.parts) +def is_prose_line(line: str) -> bool: + stripped = line.strip() + if not stripped: + return False + if stripped.startswith(MARKUP_PREFIXES): + return False + # Drop bare directive-option lines (e.g. "align: center", "alt:") + if _BARE_DIRECTIVE_RE.match(stripped): + return False + # Drop MyST/RST anchor labels (e.g. "(gpu-arch-documentation)=") + if _ANCHOR_LABEL_RE.match(stripped): + return False + # Drop lines that contain an HTML tag anywhere (e.g. ".

") + if re.search(r" Date: Tue, 19 May 2026 19:57:40 +0200 Subject: [PATCH 04/10] Clean up --- docs/conf.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index a27961e9..393b7527 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,8 +1,7 @@ """Configuration file for the Sphinx documentation builder.""" import os -from sphinx import addnodes +import re from pathlib import Path -import shutil external_projects_remote_repository = "" external_projects_current_project = "dcgpu" @@ -55,16 +54,6 @@ ".venv", } -import re - -EXCLUDED_DIRS = { - "_build", - "_templates", - "_static", - ".git", - ".venv", -} - MARKUP_PREFIXES = ( ":::", "```{", From a596911bd88084bcdb06e810022e0de5bbb48b7b Mon Sep 17 00:00:00 2001 From: Kiss Date: Thu, 21 May 2026 10:44:22 +0200 Subject: [PATCH 05/10] Add llms-full.txt and keep the llms.txt as base --- docs/conf.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 393b7527..84031cd1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,6 +46,8 @@ exclude_patterns = ['.venv'] +html_extra_path = ["llms.txt"] + EXCLUDED_DIRS = { "_build", "_templates", @@ -83,6 +85,9 @@ # Matches MyST/RST anchor labels like "(gpu-arch-documentation)=" _ANCHOR_LABEL_RE = re.compile(r"^\(\w[\w-]*\)=$") +# Matches RST section underlines (e.g. "====", "----", "~~~~") +_RST_UNDERLINE_RE = re.compile(r"^[=\-~^\"\'#*+]{3,}$") + MIN_PROSE_LINES = 10 @@ -105,6 +110,15 @@ def is_prose_line(line: str) -> bool: # Drop lines that contain an HTML tag anywhere (e.g. ".

") if re.search(r" Date: Thu, 28 May 2026 11:02:51 +0200 Subject: [PATCH 06/10] PR feedbacks: Fix llms.txt titles and avoid code block strip --- docs/conf.py | 15 +++++++++++---- docs/llms.txt | 8 ++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 84031cd1..160882a7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -161,10 +161,17 @@ def generate_combined_markdown(app, exception): continue relative = doc_file.relative_to(docs_root) - cleaned = "\n".join( - line for line in lines - if line.strip() == "" or is_prose_line(line) - ) + in_code_block = False + kept = [] + for line in lines: + if line.strip().startswith("```"): + in_code_block = not in_code_block + kept.append(line) + elif in_code_block: + kept.append(line) + elif line.strip() == "" or is_prose_line(line): + kept.append(line) + cleaned = "\n".join(kept) combined.append(f"\n\n---\n\n# {relative}\n") combined.append(cleaned.strip()) diff --git a/docs/llms.txt b/docs/llms.txt index 1fb7ba33..5a1ab7c2 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -14,8 +14,8 @@ ### Bare metal -- [Instinct GPU Driver](https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/): Install and configure the AMD GPU driver. Covers logging and error codes. -- [Instinct Customer Acceptance Guide](https://instinct.docs.amd.com/projects/system-acceptance/en/latest/): Configure, validate, benchmark, and baseline AMD Instinct GPUs. +- [AMD GPU Driver (amdgpu)](https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/): Install and configure the AMD GPU driver. Covers logging and error codes. +- [AMD Instinct Customer Acceptance Guide](https://instinct.docs.amd.com/projects/system-acceptance/en/latest/): Configure, validate, benchmark, and baseline AMD Instinct GPUs. - [AMD SMI](https://rocm.docs.amd.com/projects/amdsmi/en/latest/): System management interface for monitoring and managing AMD GPUs. - [ROCm Validation Suite](https://rocm.docs.amd.com/projects/ROCmValidationSuite/en/latest/): System validation and diagnostics. - [Cluster Validation Suite](https://rocm.docs.amd.com/projects/cvs/en/latest/): Test scripts to validate AMD AI clusters. @@ -34,11 +34,11 @@ ### Cloud -- [Instinct on Azure](https://instinct.docs.amd.com/projects/instinct-azure/latest/): Get started with AMD Instinct on Microsoft Azure. +- [AMD Instinct GPUs on Azure](https://instinct.docs.amd.com/projects/instinct-azure/latest/): Get started with AMD Instinct on Microsoft Azure. ### Virtualization -- [Instinct Virtualization Driver](https://instinct.docs.amd.com/projects/virt-drv/en/latest/): Virtualization driver for AMD Instinct GPUs. +- [AMD Instinct Virtualization Driver](https://instinct.docs.amd.com/projects/virt-drv/en/latest/): Virtualization driver for AMD Instinct GPUs. - [AMD SMI for Virtualization](https://instinct.docs.amd.com/projects/amd-smi-virt/en/latest/): Manage and monitor AMD virtualization-enabled GPUs. ## Workloads From 3471836eec528a9e760091a4ede67d521f7f8f02 Mon Sep 17 00:00:00 2001 From: Kiss Date: Thu, 28 May 2026 13:22:03 +0200 Subject: [PATCH 07/10] PR feedbacks: Avoid code block strip from rst files --- docs/conf.py | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 160882a7..761ed5e1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -88,6 +88,9 @@ # Matches RST section underlines (e.g. "====", "----", "~~~~") _RST_UNDERLINE_RE = re.compile(r"^[=\-~^\"\'#*+]{3,}$") +# Matches RST code block directives (e.g. ".. code-block:: cpp", ".. code:: sh") +_RST_CODE_BLOCK_RE = re.compile(r"^\.\.\s+(code-block|code|sourcecode)::") + MIN_PROSE_LINES = 10 @@ -107,14 +110,13 @@ def is_prose_line(line: str) -> bool: # Drop MyST/RST anchor labels (e.g. "(gpu-arch-documentation)=") if _ANCHOR_LABEL_RE.match(stripped): return False - # Drop lines that contain an HTML tag anywhere (e.g. ".

") - if re.search(r"` describes..."). + if re.match(r"^:[A-Za-z][A-Za-z0-9_-]*:(\s|$)", stripped): return False # Drop RST section underlines (e.g. "====", "----", "~~~~") if _RST_UNDERLINE_RE.match(stripped): @@ -161,15 +163,30 @@ def generate_combined_markdown(app, exception): continue relative = doc_file.relative_to(docs_root) - in_code_block = False + in_backtick_fence = False + in_rst_code_block = False kept = [] for line in lines: - if line.strip().startswith("```"): - in_code_block = not in_code_block + stripped = line.strip() + # Backtick fences (MyST/Markdown) + if stripped.startswith("```"): + in_backtick_fence = not in_backtick_fence kept.append(line) - elif in_code_block: + continue + if in_backtick_fence: kept.append(line) - elif line.strip() == "" or is_prose_line(line): + continue + # RST code block: exit when a non-blank, non-indented line appears + if in_rst_code_block: + if not stripped or line[0] in (" ", "\t"): + kept.append(line) + continue + in_rst_code_block = False + # RST code block: enter on directive line (directive itself is dropped) + if _RST_CODE_BLOCK_RE.match(stripped): + in_rst_code_block = True + continue + if not stripped or is_prose_line(line): kept.append(line) cleaned = "\n".join(kept) From 0f13297a1b0b769c3e9d6dde7208fec7a483ada4 Mon Sep 17 00:00:00 2001 From: Kiss Date: Fri, 29 May 2026 13:04:46 +0200 Subject: [PATCH 08/10] sync llms filter fixes from rocm-docs-core --- docs/conf.py | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 761ed5e1..f64a9772 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -73,7 +73,6 @@ ":header-rows:", ":alt:", "+++", - "<", "-->", "{bdg-", ) @@ -91,6 +90,17 @@ # Matches RST code block directives (e.g. ".. code-block:: cpp", ".. code:: sh") _RST_CODE_BLOCK_RE = re.compile(r"^\.\.\s+(code-block|code|sourcecode)::") +# Matches markdown table separator rows (e.g. "|---|---|", "| :--- | ---: |"). +_MD_TABLE_SEP_RE = re.compile(r"^\|[\s|:\-]+\|$") + +# Matches RST directives whose indented body should be discarded (e.g. raw HTML). +_RST_SKIP_BLOCK_RE = re.compile(r"^\.\.\s+raw::") + +# Matches HTML tags (e.g. "
", "

", ") - Add in_html_open_tag state to discard multi-line HTML opening tag continuations --- docs/conf.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index f64a9772..6775fd71 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,6 +101,10 @@ # URL schemes so that multi-line RST inline hyperlinks are preserved. _HTML_TAG_RE = re.compile(r"^<(?!https?://|ftp://|mailto:)[a-zA-Z/!]") +# Matches trailing HTML close tags at the end of a prose line +# (e.g. "Browse blogs.

", "See the guide."). +_TRAILING_HTML_CLOSE_RE = re.compile(r"()+\s*$") + MIN_PROSE_LINES = 10 @@ -187,6 +191,8 @@ def generate_combined_markdown(app, exception): in_backtick_fence = False in_rst_code_block = False in_rst_skip_block = False + in_html_comment = False # inside block + in_html_open_tag = False # inside a multi-line HTML opening tag kept = [] for line in lines: stripped = line.strip() @@ -198,6 +204,11 @@ def generate_combined_markdown(app, exception): if in_backtick_fence: kept.append(line) continue + # HTML comment block (): discard all content until --> + if in_html_comment: + if "-->" in stripped: + in_html_comment = False + continue # RST skip block (e.g. .. raw::): discard all indented content if in_rst_skip_block: if not stripped or line[0] in (" ", "\t"): @@ -217,8 +228,26 @@ def generate_combined_markdown(app, exception): if _RST_CODE_BLOCK_RE.match(stripped): in_rst_code_block = True continue - if not stripped or is_prose_line(line): + # HTML comment open (): discard opener and enter state + if stripped.startswith("" not in stripped: + in_html_comment = True + continue + # Multi-line HTML opening tag: skip continuation lines until > + if in_html_open_tag: + if ">" in stripped: + in_html_open_tag = False + continue + # Detect HTML opening tags that wrap across lines (no > on this line) + if _HTML_TAG_RE.match(stripped) and ">" not in stripped: + in_html_open_tag = True + continue + if not stripped: kept.append(line) + elif is_prose_line(line): + # Strip trailing HTML close tags (e.g. "See the guide.

") + cleaned = _TRAILING_HTML_CLOSE_RE.sub("", line).rstrip() + kept.append(cleaned if cleaned.strip() else line) cleaned = "\n".join(kept) combined.append(f"\n\n---\n\n# {relative}\n") From d99a64f02a8edae76e3af5a01f0e02fe13d5ab4f Mon Sep 17 00:00:00 2001 From: Kiss Date: Fri, 29 May 2026 14:13:27 +0200 Subject: [PATCH 10/10] Fix the html flavor removal --- docs/conf.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 6775fd71..fe33b56c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -247,7 +247,15 @@ def generate_combined_markdown(app, exception): elif is_prose_line(line): # Strip trailing HTML close tags (e.g. "See the guide.

") cleaned = _TRAILING_HTML_CLOSE_RE.sub("", line).rstrip() - kept.append(cleaned if cleaned.strip() else line) + cleaned_stripped = cleaned.strip() + if not cleaned_stripped: + # Entire line was HTML close tags — keep original (shouldn't + # normally reach here since _is_prose_line filters HTML). + kept.append(line) + elif re.search(r"\w", cleaned_stripped): + # Line has real word content after stripping close tags. + kept.append(cleaned) + # else: only punctuation remains (e.g. bare ".") — discard. cleaned = "\n".join(kept) combined.append(f"\n\n---\n\n# {relative}\n")