Skip to content

Commit

Permalink
update templates to use exposed sanitizeId function
Browse files Browse the repository at this point in the history
  • Loading branch information
djencks committed Jan 31, 2022
1 parent 34bc81d commit 0c815fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions script/gen_crd/gen_crd_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ echo "Generating CRD API documentation..."
# to run a local copy use something like
#go run /Users/david/projects/camel/gen-crd-api-reference-docs/main.go \
#you will probably need to comment out use of blackfriday.
go run github.com/djencks/gen-crd-api-reference-docs@7400a10b36d7cfa7563ea48ce0df15a9d4c2de87 \
go run github.com/djencks/gen-crd-api-reference-docs@e63530f10b55be5f2d82e223d83f86c13e5158e5 \
-config $location/gen-crd-api-config.json \
-template-dir $location/template \
-api-dir "github.com/apache/camel-k/pkg/apis/camel/v1" \
-out-file $crd_file_camel

go run github.com/djencks/gen-crd-api-reference-docs@7400a10b36d7cfa7563ea48ce0df15a9d4c2de87 \
#go run /Users/david/projects/camel/gen-crd-api-reference-docs/main.go \
go run github.com/djencks/gen-crd-api-reference-docs@e63530f10b55be5f2d82e223d83f86c13e5158e5 \
-config $location/gen-kamelets-crd-api-config.json \
-template-dir $location/template \
-api-dir "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" \
Expand Down
2 changes: 1 addition & 1 deletion script/gen_crd/template/members.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
|`{{ fieldName . }}` +
{{ if linkForType .Type -}}
{{- if isLocalType .Type -}}
*xref:{{ linkForType .Type}}[{{ asciiDocAttributeEscape (typeDisplayName .Type) }}]*
*xref:#{{ sanitizeId (anchorIDForType .Type) }}[{{ asciiDocAttributeEscape (typeDisplayName .Type) }}]*
{{- else -}}
*{{ linkForType .Type}}[{{ asciiDocAttributeEscape (typeDisplayName .Type) }}]*
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion script/gen_crd/template/pkg.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "packages" -}}
{{ range .packages -}}

[#{{ packageAnchorID . }}]
[#{{ sanitizeId (packageAnchorID .) }}]
== {{ packageDisplayName . }}

{{- with (index .GoPackages 0 ) -}}
Expand Down
4 changes: 2 additions & 2 deletions script/gen_crd/template/type.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{ define "type" }}

[#{{ anchorIDForType . }}]
[#{{ sanitizeId (anchorIDForType .) }}]
=== {{ .Name.Name }}{{ if eq .Kind "Alias" }}(`{{.Underlying}}` alias){{ end }}
{{- with (typeReferences .) }}

*Appears on:*
{{ range . }}
* <<{{ linkForType . }}, {{ typeDisplayName . }}>>
* <<#{{ sanitizeId (anchorIDForType .) }}, {{ typeDisplayName . }}>>
{{- end -}}
{{- end }}

Expand Down

0 comments on commit 0c815fd

Please sign in to comment.