@@ -120,7 +120,7 @@
pkgStr.value = JSON.stringify(pkg, null, 2)
rcJsonStr.value = JSON.stringify(pkg.cds??{}, null, 2)
- rcJsStr.value = 'exports.' + Object.keys(pkg.cds??{})[0] + ' = ' + JSON.stringify(Object.values(pkg.cds??{})[0], null, 2).replaceAll('"', '')
+ rcJsStr.value = 'exports.' + Object.keys(pkg.cds??{})[0] + ' = ' + (JSON.stringify(Object.values(pkg.cds??{})[0], null, 2)??'').replaceAll('"', '')
rcYmlStr.value = yaml.stringify(pkg.cds)
let envKey = fqn.replaceAll('_', '__').replaceAll(keyDel, '_')
diff --git a/java/developing-applications/properties.data.ts b/java/developing-applications/properties.data.ts
index d18846316..76f24b01b 100644
--- a/java/developing-applications/properties.data.ts
+++ b/java/developing-applications/properties.data.ts
@@ -1,5 +1,6 @@
import { defineLoader } from 'vitepress'
+//@ts-expect-error
const { themeConfig: { capire }} = global.VITEPRESS_CONFIG.site
const version = capire.versions.java_services
@@ -13,15 +14,19 @@ export default defineLoader({
function massageProperties(properties: JavaSdkProperties[]): OurProperties[] {
return properties.map(({ name, header, type, default:defaultValue, doc }) => {
- if (defaultValue && type?.startsWith('List')) { // split list default values into multiple lines for better readability
- defaultValue = defaultValue.replace(/, ?/g, ',
')
- }
+ const isListValue = type?.startsWith('List')
+ let defaultValueHTML = defaultValue ? `${defaultValue}` : ''
+ defaultValueHTML = isListValue ? defaultValueHTML.replace(/, ?/g, ',
') : defaultValueHTML
return {
- name: name.replaceAll(/<(index|key)>/g, '<$1>'), // decorate special and names
+ name,
+ nameHTML: name
+ .replaceAll(/<(index|key)>/g, '<$1>') // decorate special and names
+ .replaceAll('.', '.'), // wrap long property names on dots
type: type?.replaceAll(/<(.*)>/g, ''), // remove generics for display
typeFull: type,
description: md2Html(doc),
- defaultValue: defaultValue ? `${defaultValue}` : '',
+ defaultValue: isListValue ? (defaultValue??'').split(',').map(item => item.trim()) : defaultValue,
+ defaultValueHTML,
header,
anchor: name.replaceAll('.', '-').replaceAll(/[<>]/g, '').toLowerCase()
}
@@ -45,10 +50,12 @@ type JavaSdkProperties = {
type OurProperties = {
name: string,
+ nameHTML: string,
header: string,
type: string,
description: string,
- defaultValue: string,
+ defaultValue: string | string[],
+ defaultValueHTML: string,
typeFull: string,
anchor: string
}
diff --git a/java/developing-applications/properties.md b/java/developing-applications/properties.md
index 8d7054488..525cbab1c 100644
--- a/java/developing-applications/properties.md
+++ b/java/developing-applications/properties.md
@@ -32,9 +32,11 @@ In property files `` should be replaced with a number and `` with an
|
- |
+
+ {{p.name}}={{ Array.isArray(p.defaultValue) ? `${JSON.stringify(p.defaultValue)}` : p.defaultValue }}
+ |
|
- |
+ |
|
@@ -50,16 +52,61 @@ In property files `` should be replaced with a number and `` with an
td.anchor .header-anchor {
top: 50% !important;
left: 50% !important;
+ margin-left: 0;
transform: translate(-50%, -50%);
}
td.group { font-weight:600; }
- th.anchor, td.anchor { border-right:none; }
+ th.anchor, td.anchor {
+ width: 0;
+ border-right:none;
+ }
th.prop, td.prop { border-left:none; padding-left:0px;}
+ thead {
+ position: sticky;
+ top: calc(var(--vp-nav-height, 44px) + var(--vp-layout-top-height, 0px));
+ z-index: 4;
+ }
+ thead th {
+ position: sticky;
+ top: calc(var(--vp-nav-height, 44px) + var(--vp-layout-top-height, 0px));
+ z-index: 5;
+ background: var(--vp-c-bg);
+ }
+ table {
+ display: table;
+ width: max-content;
+ min-width: 100%;
+ overflow-x: visible;
+ }
+ th.java-type, td.java-type { white-space: nowrap; }
+ th.default, td.default {
+ white-space: normal;
+ overflow-wrap: anywhere;
+ word-break: break-word;
+ min-width: 12ch;
+ }
+ td.default :deep(code) {
+ display: inline-block;
+ white-space: normal;
+ overflow-wrap: anywhere;
+ word-break: break-word;
+ min-width: 12ch;
+ max-width: 100%;
+ }
/* expand this extra wide table on big screens */
@media screen and (min-width: 1600px) {
- table { min-width: fit-content; }
+ th.prop, td.prop {
+ width: 36ch;
+ max-width: 36ch;
+ }
+ th.default, td.default {
+ min-width: 24ch;
+ width: 34ch;
+ max-width: 34ch;
+ }
+ th.descr, td.descr { min-width: 64ch; }
tr { position: initial; } /* for anchor to appear */
}