mirror of
https://github.com/kubevela/kubevela.git
synced 2026-02-14 18:10:21 +00:00
Feat: add base resource section for component ref (#4635)
* Feat: add base resource section for component ref Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> * read from local Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> * fix Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> * beautify Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> * format imports Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com> Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
This commit is contained in:
@@ -61,7 +61,7 @@ func PrintCLIByTag(cmd *cobra.Command, all []*cobra.Command, tag string) string
|
||||
return result
|
||||
}
|
||||
|
||||
// GenMarkdownTreeForIndex will generate the markdown doc for vela index
|
||||
// GenMarkdownTreeForIndex will generate the Markdown doc for vela index
|
||||
func GenMarkdownTreeForIndex(cmd *cobra.Command, dir string) error {
|
||||
basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".md"
|
||||
filename := filepath.Join(dir, basename)
|
||||
|
||||
@@ -24,6 +24,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/types"
|
||||
"github.com/oam-dev/kubevela/pkg/utils/common"
|
||||
"github.com/oam-dev/kubevela/references/docgen"
|
||||
@@ -86,8 +88,14 @@ func ComponentDef(ctx context.Context, c common.Args, path, location *string, de
|
||||
},
|
||||
CustomDocHeader: CustomComponentHeaderEN,
|
||||
}
|
||||
ref.Remote = &docgen.FromCluster{Namespace: types.DefaultKubeVelaNS}
|
||||
ref.Local = &docgen.FromLocal{Path: ComponentDefDir}
|
||||
|
||||
dm, err := c.GetDiscoveryMapper()
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "failed to get discovery mapper")
|
||||
return
|
||||
}
|
||||
ref.DiscoveryMapper = dm
|
||||
if *path != "" {
|
||||
ref.I18N = &docgen.En
|
||||
if strings.Contains(*location, "zh") || strings.Contains(*location, "chinese") {
|
||||
|
||||
Reference in New Issue
Block a user