Skip to content

Commit

Permalink
Fix Camel header documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton committed Oct 18, 2024
1 parent e2a38e2 commit fea7ade
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions docs/modules/ROOT/examples/js/camel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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.
*/

module.exports = {
extractConstantDisplayName: (name) => {
return name.split('#').pop().split('@').join('.')
},

extractConstantName: (name) => {
return name.split('#').pop().split('@').shift()
},

extractHeadersClass: (name) => {
return name.split('#').shift()
},

constantLink: (artifactId, name) => {
try {
return `https://javadoc.io/doc/org.apache.camel.quarkus/${artifactId}-component/latest/`
+ module.exports.extractHeadersClass(name).split('.').join('/') + '.html#'
+ module.exports.extractConstantName(name)
+ '[`' + module.exports.extractConstantDisplayName(name) + '`]'
} catch (e) {
console.log('error', e)
return e.msg()
}
},
}
2 changes: 1 addition & 1 deletion docs/modules/ROOT/partials/component-endpoint-headers.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//component headers: START

:tablespec: width="100%",cols="2,5a,^1,2",options="header"
:cellformats: 'util.boldLink(path[2], "endpoint_header", value.group) + "\n\nConstant: " + camel.constantLink("{artifactid}",value.constantName) \
:cellformats: 'util.boldLink(path[2], "endpoint_header", value.group) + "\n\nConstant: " + camel.constantLink("{cq-artifact-id}",value.constantName) \
|util.description(value) \
|util.valueAsString(value.defaultValue) \
|util.javaSimpleName(value.javaType)'
Expand Down

0 comments on commit fea7ade

Please sign in to comment.