This is an automated email from the ASF dual-hosted git repository.

yzheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 02215602c (feat) doc: Update Makefile to fix admonitions in helm doc 
and remove redundant sections (#3232)
02215602c is described below

commit 02215602c006bb2c78f23a9704467958767ab62f
Author: Yong Zheng <[email protected]>
AuthorDate: Mon Dec 8 19:45:44 2025 -0600

    (feat) doc: Update Makefile to fix admonitions in helm doc and remove 
redundant sections (#3232)
---
 Makefile                                  |  2 +-
 helm/polaris/tools/prepare_helm_readme.py | 77 +++++++++++++++++++++++++++++++
 site/content/in-dev/unreleased/helm.md    | 19 --------
 3 files changed, 78 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index 15ee5bf7b..20908284f 100644
--- a/Makefile
+++ b/Makefile
@@ -207,7 +207,7 @@ helm-doc-generate: DEPENDENCIES := helm-docs
 helm-doc-generate: check-dependencies ## Generate Helm chart documentation
        @echo "--- Generating Helm documentation ---"
        @helm-docs --chart-search-root=helm
-       @cp helm/polaris/README.md site/content/in-dev/unreleased/helm.md
+       @python3 helm/polaris/tools/prepare_helm_readme.py 
helm/polaris/README.md site/content/in-dev/unreleased/helm.md
        @echo "--- Helm documentation generated and copied ---"
 
 helm-unittest: DEPENDENCIES := helm
diff --git a/helm/polaris/tools/prepare_helm_readme.py 
b/helm/polaris/tools/prepare_helm_readme.py
new file mode 100644
index 000000000..c6d7a9bf4
--- /dev/null
+++ b/helm/polaris/tools/prepare_helm_readme.py
@@ -0,0 +1,77 @@
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+
+import re
+import sys
+
+ADMONITION_RE = 
re.compile(r'>\s*\[!(NOTE|WARNING|IMPORTANT|TIP|CAUTION|ALERT)\](.*)')
+
+
+def main(input_file, output_file):
+    with open(input_file, "r") as f:
+        content = f.read()
+    # Extract frontmatter if present
+    frontmatter = ""
+    body = content
+    if content.startswith("---"):
+        parts = content.split("---", 2)
+        if len(parts) == 3:
+            frontmatter = f"---{parts[1]}---"
+            body = parts[2]
+    # Keep only content starting from "Installation" section
+    idx = body.find("## Installation")
+    if idx != -1:
+        body = body[idx:]
+    # Convert Markdown admonitions to Hugo alerts
+    lines = f"{frontmatter}\n{body}".splitlines()
+    output_lines = []
+    in_admonition = False
+    for line in lines:
+        match = ADMONITION_RE.match(line)
+        # End admonition if we hit a non-admonition, non-quoted line
+        if in_admonition and not (match or line.startswith(">")):
+            output_lines.append("{{< /alert >}}")
+            in_admonition = False
+        if match:
+            # Begin a new admonition
+            admon_type = match.group(1).lower()
+            remaining_text = match.group(2).strip()
+            output_lines.append(f"{{{{< alert {admon_type} >}}}}")
+            if remaining_text:
+                output_lines.append(remaining_text)
+            in_admonition = True
+        elif in_admonition and line.startswith(">"):
+            # Admonition body line
+            output_lines.append(line[2:] if line.startswith("> ") else 
line[1:])
+        else:
+            # Regular line
+            output_lines.append(line)
+    # Close if file ends mid-admonition
+    if in_admonition:
+        output_lines.append("{{< /alert >}}")
+    # Write
+    with open(output_file, "w") as f:
+        f.write("\n".join(output_lines) + "\n")
+
+
+if __name__ == "__main__":
+    if len(sys.argv) != 3:
+        print(f"Usage: python {sys.argv[0]} <input_file> <output_file>")
+        sys.exit(1)
+    main(sys.argv[1], sys.argv[2])
diff --git a/site/content/in-dev/unreleased/helm.md 
b/site/content/in-dev/unreleased/helm.md
index 640eb4b9f..a6b82448e 100644
--- a/site/content/in-dev/unreleased/helm.md
+++ b/site/content/in-dev/unreleased/helm.md
@@ -21,25 +21,6 @@ Title: Polaris Helm Chart
 type: docs
 weight: 675
 ---
-
-<!---
-  This README.md file was generated with:
-  https://github.com/norwoodj/helm-docs
-  Do not modify the README.md file directly, please modify README.md.gotmpl 
instead.
-  To re-generate the README.md file, install helm-docs then run from the repo 
root:
-  helm-docs --chart-search-root=helm
--->
-
-![Version: 
1.2.0-incubating-SNAPSHOT](https://img.shields.io/badge/Version-1.2.0--incubating--SNAPSHOT-informational?style=flat-square)
 ![Type: 
application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
 ![AppVersion: 
1.2.0-incubating-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.2.0--incubating--SNAPSHOT-informational?style=flat-square)
-
-A Helm chart for Apache Polaris (incubating).
-
-**Homepage:** <https://polaris.apache.org/>
-
-## Source Code
-
-* <https://github.com/apache/polaris>
-
 ## Installation
 
 The instructions below are for the local Minikube cluster. They assume 
Minikube and Helm are installed.

Reply via email to