fix: Few links updates

This commit is contained in:
Ilya Kuznetsov 2025-01-13 15:16:47 +01:00
parent 5fb4fa000b
commit ad81e1f0af
3 changed files with 20 additions and 15 deletions

View File

@ -123,7 +123,8 @@ func buildMarkdown(nodes []rootNode, outputFile, header string) error {
m = m.LF() m = m.LF()
if len(node.ObjectKeyAttributes) > 0 { if len(node.ObjectKeyAttributes) > 0 {
n := removePluralForm(node.Title) n := pickLastWord(node.Title)
n = removePluralForm(n)
m = m.CodeBlocks("yaml", fmt.Sprintf("%ss:\n <%s-name>:\n <%s-field-name>: <%s-field-value>", n, n, n, n)) m = m.CodeBlocks("yaml", fmt.Sprintf("%ss:\n <%s-name>:\n <%s-field-name>: <%s-field-value>", n, n, n, n))
m = m.LF() m = m.LF()
m = buildAttributeTable(m, node.ObjectKeyAttributes) m = buildAttributeTable(m, node.ObjectKeyAttributes)
@ -151,6 +152,11 @@ func buildMarkdown(nodes []rootNode, outputFile, header string) error {
return nil return nil
} }
func pickLastWord(s string) string {
words := strings.Split(s, ".")
return words[len(words)-1]
}
// Build a custom table which we use in Databricks website // Build a custom table which we use in Databricks website
func buildCustomAttributeTable(m *md.Markdown, attributes []attributeNode) *md.Markdown { func buildCustomAttributeTable(m *md.Markdown, attributes []attributeNode) *md.Markdown {
m = m.LF() m = m.LF()

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
"sort" "sort"
"strings" "strings"
@ -73,7 +72,7 @@ func getNodes(s jsonschema.Schema, refs map[string]jsonschema.Schema, customFiel
if len(node.Example) == 0 { if len(node.Example) == 0 {
node.Example = getExample(objectKeyType) node.Example = getExample(objectKeyType)
} }
prefix := fmt.Sprintf("%s.<%s-name>", k, removePluralForm(k)) prefix := k + ".<name>"
node.ObjectKeyAttributes = getAttributes(objectKeyType.Properties, refs, customFields, prefix) node.ObjectKeyAttributes = getAttributes(objectKeyType.Properties, refs, customFields, prefix)
rootProps = append(rootProps, extractNodes(prefix, objectKeyType.Properties, refs, customFields)...) rootProps = append(rootProps, extractNodes(prefix, objectKeyType.Properties, refs, customFields)...)
} }

View File

@ -143,57 +143,57 @@ github.com/databricks/cli/bundle/config.Resources:
"description": |- "description": |-
The cluster definitions for the bundle, where each key is the name of a cluster. The cluster definitions for the bundle, where each key is the name of a cluster.
"markdown_description": |- "markdown_description": |-
The cluster definitions for the bundle, where each key is the name of a cluster. See [_](/dev-tools/bundles/resources.md#cluster) The cluster definitions for the bundle, where each key is the name of a cluster. See [_](/dev-tools/bundles/resources.md#clusters)
"dashboards": "dashboards":
"description": |- "description": |-
The dashboard definitions for the bundle, where each key is the name of the dashboard. The dashboard definitions for the bundle, where each key is the name of the dashboard.
"markdown_description": |- "markdown_description": |-
The dashboard definitions for the bundle, where each key is the name of the dashboard. See [_](/dev-tools/bundles/resources.md#dashboard) The dashboard definitions for the bundle, where each key is the name of the dashboard. See [_](/dev-tools/bundles/resources.md#dashboards)
"experiments": "experiments":
"description": |- "description": |-
The experiment definitions for the bundle, where each key is the name of the experiment. The experiment definitions for the bundle, where each key is the name of the experiment.
"markdown_description": |- "markdown_description": |-
The experiment definitions for the bundle, where each key is the name of the experiment. See [_](/dev-tools/bundles/resources.md#experiment) The experiment definitions for the bundle, where each key is the name of the experiment. See [_](/dev-tools/bundles/resources.md#experiments)
"jobs": "jobs":
"description": |- "description": |-
The job definitions for the bundle, where each key is the name of the job. The job definitions for the bundle, where each key is the name of the job.
"markdown_description": |- "markdown_description": |-
The job definitions for the bundle, where each key is the name of the job. See [_](/dev-tools/bundles/resources.md#job) The job definitions for the bundle, where each key is the name of the job. See [_](/dev-tools/bundles/resources.md#jobs)
"model_serving_endpoints": "model_serving_endpoints":
"description": |- "description": |-
The model serving endpoint definitions for the bundle, where each key is the name of the model serving endpoint. The model serving endpoint definitions for the bundle, where each key is the name of the model serving endpoint.
"markdown_description": |- "markdown_description": |-
The model serving endpoint definitions for the bundle, where each key is the name of the model serving endpoint. See [_](/dev-tools/bundles/resources.md#model_serving_endpoint) The model serving endpoint definitions for the bundle, where each key is the name of the model serving endpoint. See [_](/dev-tools/bundles/resources.md#model_serving_endpoints)
"models": "models":
"description": |- "description": |-
The model definitions for the bundle, where each key is the name of the model. The model definitions for the bundle, where each key is the name of the model.
"markdown_description": |- "markdown_description": |-
The model definitions for the bundle, where each key is the name of the model. See [_](/dev-tools/bundles/resources.md#model-legacy) The model definitions for the bundle, where each key is the name of the model. See [_](/dev-tools/bundles/resources.md#models)
"pipelines": "pipelines":
"description": |- "description": |-
The pipeline definitions for the bundle, where each key is the name of the pipeline. The pipeline definitions for the bundle, where each key is the name of the pipeline.
"markdown_description": |- "markdown_description": |-
The pipeline definitions for the bundle, where each key is the name of the pipeline. See [_](/dev-tools/bundles/resources.md#pipeline) The pipeline definitions for the bundle, where each key is the name of the pipeline. See [_](/dev-tools/bundles/resources.md#pipelines)
"quality_monitors": "quality_monitors":
"description": |- "description": |-
The quality monitor definitions for the bundle, where each key is the name of the quality monitor. The quality monitor definitions for the bundle, where each key is the name of the quality monitor.
"markdown_description": |- "markdown_description": |-
The quality monitor definitions for the bundle, where each key is the name of the quality monitor. See [_](/dev-tools/bundles/resources.md#quality-monitor) The quality monitor definitions for the bundle, where each key is the name of the quality monitor. See [_](/dev-tools/bundles/resources.md#quality_monitors)
"registered_models": "registered_models":
"description": |- "description": |-
The registered model definitions for the bundle, where each key is the name of the <UC> registered model. The registered model definitions for the bundle, where each key is the name of the <UC> registered model.
"markdown_description": |- "markdown_description": |-
The registered model definitions for the bundle, where each key is the name of the <UC> registered model. See [_](/dev-tools/bundles/resources.md#registered-model) The registered model definitions for the bundle, where each key is the name of the <UC> registered model. See [_](/dev-tools/bundles/resources.md#registered_models)
"schemas": "schemas":
"description": |- "description": |-
The schema definitions for the bundle, where each key is the name of the schema. The schema definitions for the bundle, where each key is the name of the schema.
"markdown_description": |- "markdown_description": |-
The schema definitions for the bundle, where each key is the name of the schema. See [_](/dev-tools/bundles/resources.md#schema) The schema definitions for the bundle, where each key is the name of the schema. See [_](/dev-tools/bundles/resources.md#schemas)
"volumes": "volumes":
"description": |- "description": |-
The volume definitions for the bundle, where each key is the name of the volume. The volume definitions for the bundle, where each key is the name of the volume.
"markdown_description": |- "markdown_description": |-
The volume definitions for the bundle, where each key is the name of the volume. See [_](/dev-tools/bundles/resources.md#volume) The volume definitions for the bundle, where each key is the name of the volume. See [_](/dev-tools/bundles/resources.md#volumes)
github.com/databricks/cli/bundle/config.Root: github.com/databricks/cli/bundle/config.Root:
"artifacts": "artifacts":
"description": |- "description": |-
@ -253,7 +253,7 @@ github.com/databricks/cli/bundle/config.Root:
```yaml ```yaml
resources: resources:
<resource-type>s: <resource-type>:
<resource-name>: <resource-name>:
<resource-field-name>: <resource-field-value> <resource-field-name>: <resource-field-value>
``` ```