Refactor: Update documentation generation to retain .md extensions and fixed Components header (#6957)
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 25s

- Modified the documentation generation logic to keep .md file extensions, enhancing IDE support and compatibility with Docusaurus.
- Updated various documentation headers to include the correct .md references in auto-generated messages, ensuring consistency across multiple components (component, policy, trait, workflow).

Signed-off-by: jguionnet jguionnet@guidewire.com

Signed-off-by: jguionnet jguionnet@guidewire.com
Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>
This commit is contained in:
jguionnet
2025-10-22 18:17:46 -07:00
committed by GitHub
parent f196d66b5e
commit 05b0ec89a5
6 changed files with 12 additions and 13 deletions
+2 -3
View File
@@ -153,9 +153,8 @@ func main() {
lines[idx] = ""
continue
}
if strings.Contains(line, ".md") && strings.Contains(line, "](") {
lines[idx] = strings.Replace(line, ".md", "", -1)
}
// Don't remove .md extensions - Docusaurus handles them properly
// and keeping them provides better IDE support and compatibility
}
newlines = append(newlines, lines...)
+3 -3
View File
@@ -42,12 +42,12 @@ var ComponentDefDirs = []string{"./vela-templates/definitions/internal/component
// CustomComponentHeaderEN .
var CustomComponentHeaderEN = `---
title: Built-in ParsedComponents Type
title: Built-in Components Type
---
This documentation will walk through all the built-in component types sorted alphabetically.
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc.md), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
// CustomComponentHeaderZH .
var CustomComponentHeaderZH = `---
@@ -56,7 +56,7 @@ title: 内置组件列表
本文档将**按字典序**展示所有内置组件的参数列表。
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc.md)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
// ComponentDef generate component def reference doc
func ComponentDef(ctx context.Context, c common.Args, opt Options) {
+2 -2
View File
@@ -47,7 +47,7 @@ title: Built-in Policy Type
This documentation will walk through all the built-in policy types sorted alphabetically.
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc.md), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
// CustomPolicyHeaderZH .
var CustomPolicyHeaderZH = `---
@@ -56,7 +56,7 @@ title: 内置策略列表
本文档将**按字典序**展示所有内置策略的参数列表
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc.md)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
// PolicyDef generate policy def reference doc
func PolicyDef(ctx context.Context, c common.Args, opt Options) {
+2 -2
View File
@@ -47,7 +47,7 @@ title: Built-in Trait Type
This documentation will walk through all the built-in trait types sorted alphabetically.
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc.md), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
// CustomTraitHeaderZH .
var CustomTraitHeaderZH = `---
@@ -56,7 +56,7 @@ title: 内置运维特征列表
本文档将**按字典序**展示所有内置运维特征的参数列表
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc.md)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
// TraitDef generate trait def reference doc
func TraitDef(ctx context.Context, c common.Args, opt Options) {
+2 -2
View File
@@ -47,7 +47,7 @@ title: Built-in WorkflowStep Type
This documentation will walk through all the built-in workflow step types sorted alphabetically.
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> It was generated automatically by [scripts](../../contributor/cli-ref-doc.md), please don't update manually, last updated at %s.\n\n", time.Now().Format(time.RFC3339))
// CustomWorkflowHeaderZH .
var CustomWorkflowHeaderZH = `---
@@ -56,7 +56,7 @@ title: 内置工作流步骤列表
本文档将**按字典序**展示所有内置工作流步骤的参数列表
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
` + fmt.Sprintf("> 本文档由[脚本](../../contributor/cli-ref-doc.md)自动生成,请勿手动修改,上次更新于 %s。\n\n", time.Now().Format(time.RFC3339))
// WorkflowDef generate workflow def reference doc
func WorkflowDef(ctx context.Context, c common.Args, opt Options) {