Skip to content

Commit

Permalink
Add requires attribute to playbook
Browse files Browse the repository at this point in the history
Update dependencies

Update util script used by requires

Correct typo in groovy script
  • Loading branch information
djencks committed Oct 14, 2021
1 parent b140ca2 commit 35ad834
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
10 changes: 5 additions & 5 deletions docs/.pnp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ content:
start_path: docs/components

asciidoc:
attributes:
requires@: "'util=util/jsonpath-util.js'"
extensions:
- "@djencks/asciidoctor-antora-indexer"
attributes:
eip-vc: latest@components

ui:
bundle:
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@antora/cli": "^3.0.0-alpha.9",
"@antora/site-generator-default": "^3.0.0-alpha.9",
"@djencks/asciidoctor-antora-indexer": "^0.0.6",
"@djencks/asciidoctor-antora-indexer": "^0.0.7",
"@djencks/asciidoctor-jsonpath": "^0.0.4",
"lite-server": "^2.4.0",
"pino-pretty": "^5.0.0"
Expand Down
24 changes: 17 additions & 7 deletions docs/util/jsonpath-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,28 @@ module.exports = {
return ''
},

boldLink: (text, idPrefix, suffix = '') => {
const idText = `_${idPrefix}_${text.split('.').join('_')}`
text = suffix ? `*${text}* (${suffix})` : `*${text}*`
return `[#${idText}]\nxref:#${idText}['',role=anchor]${text}`
},

description: (value) => {
try {
return module.exports.strong(value, "Autowired")
+ module.exports.strong(value, "Required")
+ module.exports.strong(value, "Deprecated")
+ module.exports.escapeAttributes(value.description) + (value.description.endsWith(".") ? "" : ".")
+ (value.deprecatedNote ? `\n\nNOTE: ${value.deprecatedNote}` : "")
+ (value.enum ? `${["\n\nEnum values:\n"].concat(value.enum).join("\n* ")}` : "")
return module.exports.strong(value, 'Autowired')
+ module.exports.strong(value, 'Required')
+ module.exports.strong(value, 'Deprecated')
+ (value.description ? module.exports.escapeAttributes(value.description) + (value.description.endsWith('.') ? '' : '.') : '')
+ (value.deprecatedNote ? `\n\nNOTE: ${value.deprecatedNote}` : '')
+ (value.enum ? `${['\n\nEnum values:\n'].concat(value.enum).join('\n* ')}` : '')
} catch (e) {
console.log('error', e)
return e.msg()
}
},

escapeAttributes: (text) => {
return text.split('{').join('\\{')
return text ? text.split('{').join('\\{') : text
},

formatSignature: (signature) => {
Expand Down Expand Up @@ -72,6 +78,10 @@ module.exports = {
strong: (data, text) => {
return data[text.toLowerCase()] ? `*${text}* ` : ''
},

valueAsString: (value) => {
return value === undefined ? '' : `${value}`
},
}

function splitOnce (querySpec, token = '=') {
Expand Down
10 changes: 5 additions & 5 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ __metadata:
languageName: node
linkType: hard

"@djencks/asciidoctor-antora-indexer@npm:^0.0.6":
version: 0.0.6
resolution: "@djencks/asciidoctor-antora-indexer@npm:0.0.6"
"@djencks/asciidoctor-antora-indexer@npm:^0.0.7":
version: 0.0.7
resolution: "@djencks/asciidoctor-antora-indexer@npm:0.0.7"
dependencies:
camelcase-keys: ^6.2.2
esprima: ^4.0.1
picomatch: ~2.1
static-eval: ^2.1.0
checksum: 70a23e188556933524608702c30635400852e8b0d59940f74d41fdc0220f667510d3d98681f94eb11c8d6fc60209da1216b93667852a36099de35b0b774b69d2
checksum: d25279cdb2906d003c0db2e9a2c5ffc7fbad9ea9761b6420046030f30825235f27bc788a22a50acb39997ccef240eefa79ff03abf2e9254a9eed17282411e411
languageName: node
linkType: hard

Expand Down Expand Up @@ -822,7 +822,7 @@ __metadata:
dependencies:
"@antora/cli": ^3.0.0-alpha.9
"@antora/site-generator-default": ^3.0.0-alpha.9
"@djencks/asciidoctor-antora-indexer": ^0.0.6
"@djencks/asciidoctor-antora-indexer": ^0.0.7
"@djencks/asciidoctor-jsonpath": ^0.0.4
lite-server: ^2.4.0
pino-pretty: ^5.0.0
Expand Down
2 changes: 1 addition & 1 deletion tooling/scripts/update-antora-config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ replaceInFiles.each { path ->

if (path.getFileName().toString().equals('antora.yml')) {
final String versionReplacement = 'version: ' + (project.version.endsWith('-SNAPSHOT') ? 'latest' : project.version)
println ' - seting '+ versionReplacement
println ' - setting '+ versionReplacement
final Pattern versionPattern = ~'version: [^\\s]+'
newContentString = versionPattern.matcher(newContentString).replaceFirst(versionReplacement)
}
Expand Down

0 comments on commit 35ad834

Please sign in to comment.