From f73c27ce8a3136f4221e0035df344d57afea284c Mon Sep 17 00:00:00 2001 From: "promptless[bot]" <179508745+promptless[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 01:28:44 +0000 Subject: [PATCH 1/2] Documentation updates from Promptless --- copy-upstream-docs.sh | 50 ++---- transform-docs.awk | 407 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 405 insertions(+), 52 deletions(-) mode change 100755 => 100644 copy-upstream-docs.sh mode change 100755 => 100644 transform-docs.awk diff --git a/copy-upstream-docs.sh b/copy-upstream-docs.sh old mode 100755 new mode 100644 index e45aa66..c2c48b5 --- a/copy-upstream-docs.sh +++ b/copy-upstream-docs.sh @@ -23,45 +23,17 @@ LOCAL_FILES=" # Files that are not valid MDX syntax # This output pasted from a CI job - we should burn it down to zero BROKEN_FILES=" -community/roadmaps-configurability.mdx -community/users.mdx -concepts/build-files.mdx -concepts/dependencies.mdx -concepts/labels.mdx -configure/integrate-cpp.mdx -configure/windows.mdx -contribute/search.mdx -docs/cc-toolchain-config-reference.mdx -docs/mobile-install.mdx -docs/user-manual.mdx -extending/config.mdx -extending/legacy-macros.mdx -extending/macros.mdx -external/extension.mdx -external/faq.mdx -external/migration.mdx -external/mod-command.mdx -external/overview.mdx -external/registry.mdx -external/vendor.mdx -install/windows.mdx -query/guide.mdx -query/language.mdx -query/quickstart.mdx -reference/flag-cheatsheet.mdx -reference/test-encyclopedia.mdx -reference/command-line-reference.mdx -reference/be/be-nav.mdx -reference/be/functions.mdx -reference/be/platforms-and-toolchains.mdx -release/rolling.mdx -remote/ci.mdx -remote/dynamic.mdx -rules/language.mdx -rules/windows.mdx -run/build.mdx -start/go.mdx -tutorials/ccp-toolchain-config.mdx + concepts/build-files.md + concepts/dependencies.md + concepts/labels.md + configure/windows.md + contribute/search.md + docs/cc-toolchain-config-reference.md + docs/user-manual.md + query/quickstart.md + reference/flag-cheatsheet.md + reference/test-encyclopedia.md + run/build.md " # Verify that at least one source exists diff --git a/transform-docs.awk b/transform-docs.awk old mode 100755 new mode 100644 index a1e3744..c716414 --- a/transform-docs.awk +++ b/transform-docs.awk @@ -8,50 +8,243 @@ BEGIN { first_h1_found = 0 frontmatter_printed = 0 before_first_h1 = 1 + in_html_table = 0 + in_pre_in_table = 0 + buffer = "" + in_multiline_tag = 0 + tag_buffer = "" + tag_name = "" } # Skip Jekyll front-matter lines /^Project: \/_project\.yaml$/ { next } /^Book: \/_book\.yaml$/ { next } +# Remove HTML document structure tags +/^]*>$/ { next } +/^
$/ { next } +/^<\/head>$/ { next } +/^$/ { next } +/^<\/body>$/ { next } +/^<\/html>$/ { next } +/$/ { - gsub(/^$/, "", $0) - # Skip TOC comments - if ($0 == "// [TOC]") { +# Skip