This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 7ceb58d9774620d1cf0dead4dfa62f70f553f736 Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Wed May 12 18:29:19 2021 +0200 fix(doc): api script * Included an header that will be converted as title * Provided some workaround to fix HTML validation --- docs/modules/ROOT/pages/apis/camel.adoc | 2 ++ script/gen_crd/gen_crd_api.sh | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/apis/camel.adoc b/docs/modules/ROOT/pages/apis/camel.adoc index 4fbbb9e..5c50e62 100644 --- a/docs/modules/ROOT/pages/apis/camel.adoc +++ b/docs/modules/ROOT/pages/apis/camel.adoc @@ -1,3 +1,5 @@ += Camel K API + ++++ include::crds-html.adoc[] ++++ \ No newline at end of file diff --git a/script/gen_crd/gen_crd_api.sh b/script/gen_crd/gen_crd_api.sh index 2f1e219..73aeadb 100755 --- a/script/gen_crd/gen_crd_api.sh +++ b/script/gen_crd/gen_crd_api.sh @@ -17,6 +17,7 @@ location=$(dirname $0) rootdir=$location/../.. +crd_file=$rootdir/docs/modules/ROOT/pages/apis/crds-html.adoc echo "Downloading gen-crd-api-reference-docs binary..." TMPFILE=`mktemp` @@ -30,10 +31,16 @@ $TMPDIR/gen-crd-api-reference-docs \ -config $location/gen-crd-api-config.json \ -template-dir $location/template \ -api-dir "github.com/apache/camel-k/pkg/apis/camel" \ - -out-file $rootdir/docs/modules/ROOT/pages/apis/crds-html.adoc + -out-file $crd_file # Workaround: https://github.com/ahmetb/gen-crd-api-reference-docs/issues/33 -sed -i -E "s/%2f/\//" $rootdir/docs/modules/ROOT/pages/apis/crds-html.adoc +sed -i -E "s/%2f/\//" $crd_file + +# Valid HTML: https://github.com/ahmetb/gen-crd-api-reference-docs/issues/34 +sed -i -E "s/<\/code><\/br>/<\/code><br>/" $crd_file +sed -i -E "s/<\/p><\/h3>/<\/h3>/" $crd_file +sed -i ':a;N;$!ba;s/<p>\n<p>/<p>/g' $crd_file +sed -i ':a;N;$!ba;s/<\/p>\n<\/p>/<\/p>/g' $crd_file echo "Cleaning the gen-crd-api-reference-docs binary..." rm $TMPFILE