Skip to content

Commit

Permalink
docs changes, mostly generated
Browse files Browse the repository at this point in the history
  • Loading branch information
djencks committed Apr 30, 2020
1 parent d21735f commit c4593a6
Show file tree
Hide file tree
Showing 35 changed files with 139 additions and 343 deletions.
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/*
public/*
build
18 changes: 11 additions & 7 deletions docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ yarn install

== Local development

To build the local copy of the website and preview it, execute:
To build the partial website from the local worktree, execute:

```
yarn dev
yarn build
```

== Build the Documentation Website
== Build and preview

To generate the documentation website from the remote repository branch, execute:
To build the partial website from the local worktree and preview the results, execute:

```
yarn build
yarn preview
```

To preview it in the local browser, execute:
== xref check

To check the xrefs in the partial site, execute:

```
yarn preview
yarn checks
```

Valid xrefs to parts of the site in other sources will appear as (spurious) errors.
15 changes: 0 additions & 15 deletions docs/antora-playbook-dev.yml

This file was deleted.

7 changes: 4 additions & 3 deletions docs/antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ site:
content:
sources:
- url: ../
branches: master
branches: HEAD
start_path: docs
asciidoc:
extensions:
- "@djencks/asciidoctor-antora-indexer"
ui:
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
output:
dir: ./public
52 changes: 25 additions & 27 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,30 @@
** xref:configuration/logging.adoc[Logging]
** xref:configuration/dependencies.adoc[Dependencies]
** xref:configuration/configmap-secret.adoc[ConfigMap/Secret]
* xref:traits/traits.adoc[Traits]
* xref:traits:traits.adoc[Traits]
// Start of autogenerated code - DO NOT EDIT! (trait-nav)
** xref:traits/3scale.adoc[3scale]
** xref:traits/affinity.adoc[Affinity]
** xref:traits/builder.adoc[Builder]
** xref:traits/camel.adoc[Camel]
** xref:traits/container.adoc[Container]
** xref:traits/cron.adoc[Cron]
** xref:traits/dependencies.adoc[Dependencies]
** xref:traits/deployer.adoc[Deployer]
** xref:traits/deployment.adoc[Deployment]
** xref:traits/environment.adoc[Environment]
** xref:traits/gc.adoc[Gc]
** xref:traits/ingress.adoc[Ingress]
** xref:traits/istio.adoc[Istio]
** xref:traits/jolokia.adoc[Jolokia]
** xref:traits/jvm.adoc[Jvm]
** xref:traits/knative-service.adoc[Knative Service]
** xref:traits/knative.adoc[Knative]
** xref:traits/master.adoc[Master]
** xref:traits/openapi.adoc[Openapi]
** xref:traits/owner.adoc[Owner]
** xref:traits/platform.adoc[Platform]
** xref:traits/prometheus.adoc[Prometheus]
** xref:traits/pull-secret.adoc[Pull Secret]
** xref:traits/quarkus.adoc[Quarkus]
** xref:traits/route.adoc[Route]
** xref:traits/service.adoc[Service]
** xref:traits:affinity.adoc[Affinity]
** xref:traits:builder.adoc[Builder]
** xref:traits:camel.adoc[Camel]
** xref:traits:container.adoc[Container]
** xref:traits:cron.adoc[Cron]
** xref:traits:dependencies.adoc[Dependencies]
** xref:traits:deployer.adoc[Deployer]
** xref:traits:deployment.adoc[Deployment]
** xref:traits:environment.adoc[Environment]
** xref:traits:gc.adoc[Gc]
** xref:traits:ingress.adoc[Ingress]
** xref:traits:istio.adoc[Istio]
** xref:traits:jolokia.adoc[Jolokia]
** xref:traits:jvm.adoc[Jvm]
** xref:traits:knative-service.adoc[Knative Service]
** xref:traits:knative.adoc[Knative]
** xref:traits:openapi.adoc[Openapi]
** xref:traits:owner.adoc[Owner]
** xref:traits:platform.adoc[Platform]
** xref:traits:prometheus.adoc[Prometheus]
** xref:traits:pull-secret.adoc[Pull Secret]
** xref:traits:quarkus.adoc[Quarkus]
** xref:traits:route.adoc[Route]
** xref:traits:service.adoc[Service]
// End of autogenerated code - DO NOT EDIT! (trait-nav)
52 changes: 0 additions & 52 deletions docs/modules/ROOT/pages/traits/3scale.adoc

This file was deleted.

30 changes: 0 additions & 30 deletions docs/modules/ROOT/pages/traits/debug.adoc

This file was deleted.

57 changes: 0 additions & 57 deletions docs/modules/ROOT/pages/traits/master.adoc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,3 @@ integration pod(s) should not be co-located with.
|===

// End of autogenerated code - DO NOT EDIT! (configuration)

This comment has been minimized.

Copy link
@oscerd

oscerd May 1, 2020

Contributor

This must stay

== Examples

* To schedule the integration pod(s) on a specific node using the https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels[built-in node label] `kubernetes.io/hostname`:
[source,shell]
$ kamel run -t affinity.node-affinity-labels="kubernetes.io/hostname in(node-66-50.hosted.k8s.tld)" ...

* To schedule a single integration pod per node (using the `Exists` operator):
[source,shell]
$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" ...

* To co-locate the integration pod(s) with other integration pod(s):
[source,shell]
$ kamel run -t affinity.pod-affinity-labels="camel.apache.org/integration in(it1, it2)" ...

The labels options follow the requirements from https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors[Label selectors]. They can be multi-valuated, then the requirements list is ANDed, e.g., to schedule a single integration pod per node AND not co-located with the Camel K operator pod(s):
[source,shell]
$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" -t affinity.pod-anti-affinity-labels="camel.apache.org/component=operator" ...

More information can be found in the official Kubernetes documentation about https://kubernetes.io/docs/concepts/configuration/assign-pod-node/[Assigning Pods to Nodes].
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ The rules for using a Kubernetes CronJob are the following:
This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.

// End of autogenerated code - DO NOT EDIT! (description)

This comment has been minimized.

Copy link
@oscerd

oscerd May 1, 2020

Contributor

This must stay

== Examples

The following route is materialized into a Kubernetes CronJob by the `cron` trait:

.cron.groovy
[source,groovy]
----
from('timer:groovy?period=60000') // Setting the period e.g. to '1000' restores the default behavior
.setBody()
.simple('Hello World from Camel K in a CronJob')
.to('log:info?showAll=false')
----

// Start of autogenerated code - DO NOT EDIT! (configuration)
== Configuration

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The following configuration options are available:
| Can be used to enable or disable a trait. All traits share this common property.

| gc.discovery-cache
| github.com/apache/camel-k/pkg/trait.discoveryCacheType
| ./pkg/trait.discoveryCacheType
| Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`)

|===
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= OpenAPI
= Openapi Trait

// Start of autogenerated code - DO NOT EDIT! (description)
The OpenAPI DSL trait is internally used to allow creating integrations from a OpenAPI specs.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,6 @@ A trait may have additional properties that can be configured by the end user.

See the trait description pages for more information on a specific trait:

// Start of autogenerated code - DO NOT EDIT! (trait-list)
* xref:traits/3scale.adoc[3scale Trait]
* xref:traits/affinity.adoc[Affinity Trait]
* xref:traits/builder.adoc[Builder Trait]
* xref:traits/camel.adoc[Camel Trait]
* xref:traits/container.adoc[Container Trait]
* xref:traits/cron.adoc[Cron Trait]
* xref:traits/dependencies.adoc[Dependencies Trait]
* xref:traits/deployer.adoc[Deployer Trait]
* xref:traits/deployment.adoc[Deployment Trait]
* xref:traits/environment.adoc[Environment Trait]
* xref:traits/gc.adoc[Gc Trait]
* xref:traits/ingress.adoc[Ingress Trait]
* xref:traits/istio.adoc[Istio Trait]
* xref:traits/jolokia.adoc[Jolokia Trait]
* xref:traits/jvm.adoc[Jvm Trait]
* xref:traits/knative-service.adoc[Knative Service Trait]
* xref:traits/knative.adoc[Knative Trait]
* xref:traits/master.adoc[Master Trait]
* xref:traits/openapi.adoc[Openapi Trait]
* xref:traits/owner.adoc[Owner Trait]
* xref:traits/platform.adoc[Platform Trait]
* xref:traits/prometheus.adoc[Prometheus Trait]
* xref:traits/pull-secret.adoc[Pull Secret Trait]
* xref:traits/quarkus.adoc[Quarkus Trait]
* xref:traits/route.adoc[Route Trait]
* xref:traits/service.adoc[Service Trait]
// End of autogenerated code - DO NOT EDIT! (trait-list)
There are indexCount:[] traits.

indexList::[]
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"description": "Camel K Documentation",
"license": "Apache-2.0",
"devDependencies": {
"@antora/cli": "~2.3.0",
"@antora/site-generator-default": "~2.3.0",
"@antora/cli": "~2.3.1",
"@antora/site-generator-default": "~2.3.1",
"@antora/xref-validator": "gitlab:antora/xref-validator",
"@djencks/asciidoctor-antora-indexer": "^0.0.2",
"lite-server": "^2.4.0"
},
"scripts": {
"preview": "cd public && lite-server",
"preview": "yarn build && cd build/site && lite-server",
"build": "yarn antora --stacktrace antora-playbook.yml",
"dev": "yarn antora --stacktrace antora-playbook-dev.yml && yarn preview",
"checks": "yarn antora --generator @antora/xref-validator antora-playbook.yml"
}
}
Loading

7 comments on commit c4593a6

@oscerd
Copy link
Contributor

@oscerd oscerd commented on c4593a6 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to revert to avoid losing the original documentation and maybe rework with a new PR

@djencks
Copy link
Contributor Author

@djencks djencks commented on c4593a6 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. The "lost" documentation is (theoretically) completely generated, and something changed so it is not generated any more. This change occurred before my PR, I just discovered the problem. Reverting my PR will mean bringing back incorrect, non-generated documentation, that claims to be generated. The solution is to figure out why the 3 pages weren't being generated and fix that so they are.

@oscerd
Copy link
Contributor

@oscerd oscerd commented on c4593a6 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need @nicolaferraro to understand a bit better the camel-k documentation

@djencks
Copy link
Contributor Author

@djencks djencks commented on c4593a6 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. It's also possible that for some reason the 3 pages are not supposed to be generated any more, in which case a solution would be to bring static copies back, into the new location, removing the claims that they are generated and adding a comment to the effect that they are not supposed to be generated.

@nicolaferraro
Copy link
Member

@nicolaferraro nicolaferraro commented on c4593a6 May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. It's also possible that for some reason the 3 pages are not supposed to be generated any more, in which case a solution would be to bring static copies back, into the new location, removing the claims that they are generated and adding a comment to the effect that they are not supposed to be generated.

I think the debug trait has been removed in the past but we forgot to remove the doc page.

For the other traits, they should be generated, their code is only present in another "addon" package. The command to generate the doc take into account the addons package:

go run ./cmd/util/doc-gen --input-dirs ./pkg/trait --input-dirs ./addons/...

Doc pages are not supposed to be completely auto-generated, in fact there are boundaries in the page to signal where an auto-generated part begins and where it ends. Some traits (e.g. affinity) contained examples that are not auto-generated (they were outside the auto-generated parts).
Those should not be removed.

@djencks
Copy link
Contributor Author

@djencks djencks commented on c4593a6 May 4, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djencks
Copy link
Contributor Author

@djencks djencks commented on c4593a6 May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently there's even less connection between jira and GitHub than I thought. Before merging this commit I opened https://github.com/djencks/camel-k/pull/new/CAMEL-14995 about these disappearing doc files but somehow missed that these comments probably indicated that no one had seen that issue.

After several hours of investigation and experimentation I found a way to generate the 2 actually missing files, see #1441. Note that this is not really satisfactory for the reasons listed there, but brings us to a better state than before these changes, as all the allegedly generated files will now be generated, at least until another undetected change leaving historical versions around.

Please sign in to comment.