Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate crd API docs as AsciiDoc (main) (Update) #2963

Merged
merged 1 commit into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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