You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/05/07 14:51:36 UTC

[GitHub] [camel-k] squakez opened a new pull request #2274: Doc: generated API

squakez opened a new pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274


   <!-- Description -->
   With this PR we introduce a new script which is in charge to generate an html single page with the definition of the API. We use the project https://github.com/ahmetb/gen-crd-api-reference-docs by temporary downloading the binary needed to run the generation.
   
   I've changed the `generate-doc` procedure to include the execution of this script that will update the API definition file as expected by the documentation
   
   We include that file in a document that will be exposed in the documentation. 
   
   Close #1137 
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **Release Note**
   ```release-note
   Doc: generated API
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
squakez commented on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-836877446


   > A good followup would be to convert the templates to asciidoc instead of using HTML here, not sure if/how it'll render on the website.
   
   Yeah, right now it's just a quick way to start it. I'd include follow up issues in order to go ahead and refine iteratively once we merge this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on a change in pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
squakez commented on a change in pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#discussion_r628332574



##########
File path: script/gen_crd/gen_crd_api.sh
##########
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+location=$(dirname $0)
+rootdir=$location/../..
+
+echo "Downloading gen-crd-api-reference-docs binary..."
+TMPFILE=`mktemp`
+TMPDIR=`mktemp -d`
+PWD=`pwd`
+wget -q --show-progress https://github.com/ahmetb/gen-crd-api-reference-docs/releases/download/v0.1.5/gen-crd-api-reference-docs_linux_amd64.tar.gz -O $TMPFILE
+tar -C $TMPDIR -xf $TMPFILE
+
+echo "Generating CRD API documentation..."
+$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

Review comment:
       Yeah I tried that already. The problem is that it's not indexed by Antora and not recognized in the `include` directory. This is the only workaround I managed to find.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti merged pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
astefanutti merged pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
squakez commented on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-834563940


   > Woot, looking forward to see how it looks!
   
   We'll have to be more disciplined and comment properly throughout the code. We have many bold spots... in any case it's a good start I guess :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
astefanutti commented on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-836707033


   @zregvart just a heads-up in case you want to chime in?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] zregvart commented on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
zregvart commented on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-836720327


   A good followup would be to convert the templates to asciidoc instead of using HTML here, not sure if/how it'll render on the website.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on a change in pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#discussion_r628333998



##########
File path: script/gen_crd/gen_crd_api.sh
##########
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+location=$(dirname $0)
+rootdir=$location/../..
+
+echo "Downloading gen-crd-api-reference-docs binary..."
+TMPFILE=`mktemp`
+TMPDIR=`mktemp -d`
+PWD=`pwd`
+wget -q --show-progress https://github.com/ahmetb/gen-crd-api-reference-docs/releases/download/v0.1.5/gen-crd-api-reference-docs_linux_amd64.tar.gz -O $TMPFILE
+tar -C $TMPDIR -xf $TMPFILE
+
+echo "Generating CRD API documentation..."
+$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

Review comment:
       I imagined you had already tried it, was more just in case, definitely not a big deal.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
astefanutti commented on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-834568192


   > We'll have to be more disciplined and comment properly throughout the code. We have many bold spots... in any case it's a good start I guess :)
   
   Right. This what makes me excited about finally having the documentation generated out of the CRDs. It'll help raising awareness that the CRDs are APIs, that deserve proper documentation! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] zregvart commented on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
zregvart commented on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-837103224


   There are a few broken links, list can be seen in [this website build](https://builds.apache.org/job/Camel/job/Camel.website/job/main/78/console).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti edited a comment on pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
astefanutti edited a comment on pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#issuecomment-834568192


   > We'll have to be more disciplined and comment properly throughout the code. We have many bold spots... in any case it's a good start I guess :)
   
   Right. This what makes me excited about finally having the documentation generated out of the CRDs. It help raising awareness that the CRDs are APIs, that deserve proper documentation! 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on a change in pull request #2274: Doc: generated API

Posted by GitBox <gi...@apache.org>.
astefanutti commented on a change in pull request #2274:
URL: https://github.com/apache/camel-k/pull/2274#discussion_r628315909



##########
File path: script/gen_crd/gen_crd_api.sh
##########
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+location=$(dirname $0)
+rootdir=$location/../..
+
+echo "Downloading gen-crd-api-reference-docs binary..."
+TMPFILE=`mktemp`
+TMPDIR=`mktemp -d`
+PWD=`pwd`
+wget -q --show-progress https://github.com/ahmetb/gen-crd-api-reference-docs/releases/download/v0.1.5/gen-crd-api-reference-docs_linux_amd64.tar.gz -O $TMPFILE
+tar -C $TMPDIR -xf $TMPFILE
+
+echo "Generating CRD API documentation..."
+$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

Review comment:
       I'd suggest to use `html` as extension.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org