Skip to content

Commit 115e3ad

Browse files
committed
Merge remote-tracking branch 'origin/main' into alesi_java_docu
2 parents 00d75d2 + 2fac839 commit 115e3ad

39 files changed

+3020
-1137
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ java/ @smahati
88
# Infra
99
.github/ @chgeo @swaldmann
1010
.vitepress/ @chgeo @swaldmann
11+
public/ @chgeo @swaldmann
1112

1213
# allow dependencies updates through renovate w/o code owners
1314
package.json

.github/renovate.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,16 @@
5454
"depNameTemplate": "com.sap.cds:cds4j-api",
5555
"datasourceTemplate": "maven",
5656
"versioningTemplate": "maven"
57+
},
58+
{
59+
"customType": "regex",
60+
"fileMatch": [ ".vitepress/config.*" ],
61+
"matchStrings": [
62+
"cloud_sec_ams\\s*:\\s*'(?<currentValue>.*?)'"
63+
],
64+
"depNameTemplate": "com.sap.cloud.security.ams.client:cap-ams-support",
65+
"datasourceTemplate": "maven",
66+
"versioningTemplate": "maven"
5767
}
68+
5869
]}

.vitepress/config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const base = process.env.GH_BASE || '/docs/'
44
// Construct vitepress config object...
55
import path from 'node:path'
66
import { defineConfig } from 'vitepress'
7+
import playground from './lib/cds-playground/index.js'
78
import languages from './languages'
89
import { Menu } from './menu.js'
910

@@ -75,10 +76,17 @@ const config = defineConfig({
7576
['link', { rel: 'icon', href: base+'favicon.ico' }],
7677
['link', { rel: 'shortcut icon', href: base+'favicon.ico' }],
7778
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: base+'logos/cap.png' }],
78-
['script', { src: base+'script.js' } ]
79+
// Inline script to restore impl-variant selection immediately (before first paint)
80+
['script', { id: 'check-impl-variant' }, `{const p=new URLSearchParams(location.search),v=p.get('impl-variant')||localStorage.getItem('impl-variant');if(v)document.documentElement.classList.add(v)}`]
7981
],
8082

8183
vite: {
84+
plugins: [...playground.plugins()],
85+
esbuild: {
86+
supported: {
87+
'top-level-await': true //browsers can handle top-level-await features in special cases
88+
},
89+
},
8290
build: {
8391
chunkSizeWarningLimit: 6000, // chunk for local search index dominates
8492
},
@@ -117,7 +125,8 @@ if (!siteURL.pathname.endsWith('/')) siteURL.pathname += '/'
117125
config.themeConfig.capire = {
118126
versions: {
119127
java_services: '4.7.0',
120-
java_cds4j: '4.7.0'
128+
java_cds4j: '4.7.0',
129+
cloud_sec_ams: '3.8.0'
121130
},
122131
gotoLinks: [],
123132
siteURL
@@ -194,11 +203,13 @@ if (process.env.VITE_CAPIRE_EXTRA_ASSETS) {
194203
import { dl } from '@mdit/plugin-dl'
195204
import * as MdAttrsPropagate from './lib/md-attrs-propagate'
196205
import * as MdTypedModels from './lib/md-typed-models'
206+
import * as MdLiveCode from './lib/cds-playground/md-live-code'
197207
import * as MdDiagramSvg from './lib/md-diagram-svg'
198208

199209
config.markdown.config = md => {
200210
MdAttrsPropagate.install(md)
201211
MdTypedModels.install(md)
212+
MdLiveCode.install(md)
202213
MdDiagramSvg.install(md)
203214
md.use(dl)
204215
}

.vitepress/languages/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import scsv from './scsv.tmLanguage.json' with {type:'json'}
55

66
import type { LanguageInput } from 'shiki'
77
export default [
8-
{ ...cds, aliases:['cds','dcl'] },
8+
{ ...cds, aliases:['cds','dcl', 'cql'] },
99
{ ...csv, aliases:['csv','csvc'] },
1010
{ ...scsv, aliases:['csvs'] },
1111
{ ...log, aliases:['log','logs'] },
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import templates from './vite-plugin-templates'
2+
import path from 'path'
3+
4+
let enabled = false
5+
let plugins = () => []
6+
7+
try {
8+
const { node, cap } = await import('vite-plugin-cds')
9+
plugins = () => {
10+
return [node(), cap(), templates([path.join(__dirname, 'templates')])]
11+
}
12+
enabled = true
13+
}
14+
catch {
15+
// eslint-disable-next-line no-console
16+
console.error('live code not available - run `npm i` to update your modules')
17+
}
18+
19+
export {
20+
enabled,
21+
plugins,
22+
}
23+
export default { enabled, plugins }
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { MarkdownRenderer, MarkdownEnv } from 'vitepress'
2+
import { dirname, join, relative } from 'path'
3+
import { enabled } from '.'
4+
5+
/**
6+
* Makes code blocks with "live" in the info string interactive by rendering a <LiveCode /> component.
7+
*
8+
* ```cds live
9+
* select from Books { title }
10+
* ```
11+
*
12+
* ```js live
13+
* await INSERT.into('Books').entries(
14+
* { ID: 2, author_ID: 150, title: 'Eldorado' }
15+
* )
16+
* ```
17+
*
18+
* Additional options:
19+
* - as <lang>: specify the language to execute the code block as (defaults to the language specified before "live")
20+
* example: ```cds live as cql
21+
* - readonly: make the code block readonly
22+
* example: ```cds live readonly
23+
*/
24+
export function install(md: MarkdownRenderer) {
25+
if (!enabled) return
26+
const fence = md.renderer.rules.fence
27+
md.renderer.rules.fence = (tokens, idx, options, env: MarkdownEnv, ...args) => {
28+
29+
const { info } = tokens[idx]
30+
const [language, live, ...rest] = info.split(' ')
31+
if (live === 'live') {
32+
const mdDir = dirname(env.realPath ?? env.path)
33+
const filePath = './' + relative(mdDir, join(__dirname, '../../theme/components/cds-playground/LiveCode.vue'))
34+
const imp = `import LiveCode from "${filePath}";`
35+
insertScriptSetup(env, imp)
36+
37+
const opts = Object.fromEntries(['as'].map(key => {
38+
const idx = rest.findIndex(k => k === key)
39+
return idx > -1 ? [key, rest.splice(idx+1, 1)[0]] : [];
40+
}))
41+
const props = {
42+
language: opts.as ?? language,
43+
}
44+
const flags = ['readonly'].filter(k => rest.includes(k))
45+
46+
const content = tokens[idx].content.trim()
47+
return `<LiveCode initialQuery="${md.utils.escapeHtml(content)}" ${Object.entries(props).map(([k, v]) => `${k}="${v}"`)} ${flags.join(' ')}></LiveCode>`
48+
}
49+
return fence!(tokens, idx, options, env, ...args)
50+
}
51+
}
52+
53+
function insertScriptSetup(env: MarkdownEnv, imp: string) {
54+
const sfcBlocks = env.sfcBlocks!
55+
if (!sfcBlocks.scriptSetup) {
56+
sfcBlocks.scriptSetup = {
57+
content: '<script setup>\n</script>',
58+
contentStripped: '\n',
59+
tagClose: '</script>',
60+
tagOpen: '<script setup>',
61+
type: 'script'
62+
}
63+
sfcBlocks.scripts.push(sfcBlocks.scriptSetup)
64+
}
65+
66+
const { scriptSetup } = sfcBlocks
67+
const { tagOpen, tagClose, contentStripped: rest } = scriptSetup
68+
69+
if (!scriptSetup.content.includes(imp)) {
70+
scriptSetup.contentStripped = `${imp}\n${rest}`
71+
scriptSetup.content = `${tagOpen}${imp}\n${rest}${tagClose}`
72+
}
73+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ID,name,dateOfBirth,placeOfBirth,dateOfDeath,placeOfDeath
2+
101,Emily Brontë,1818-07-30,"Thornton, Yorkshire",1848-12-19,"Haworth, Yorkshire"
3+
107,Charlotte Brontë,1818-04-21,"Thornton, Yorkshire",1855-03-31,"Haworth, Yorkshire"
4+
150,Edgar Allen Poe,1809-01-19,"Boston, Massachusetts",1849-10-07,"Baltimore, Maryland"
5+
170,Richard Carpenter,1929-08-14,"King’s Lynn, Norfolk",2012-02-26,"Hertfordshire, England"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ID,title,descr,author_ID,stock,price,currency_code,genre_ID
2+
201,Wuthering Heights,"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.",101,12,11.11,GBP,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
3+
207,Jane Eyre,"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.",107,11,12.34,GBP,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
4+
251,The Raven,"""The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.",150,333,13.13,USD,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
5+
252,Eleonora,"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.",150,555,14,USD,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
6+
271,Catweazle,"Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.",170,22,150,JPY,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ID_texts,ID,locale,title,descr
2+
d2a65a27-9f2a-480f-bc38-84ee8ec5c13e,201,de,Sturmhöhe,"Sturmhöhe (Originaltitel: Wuthering Heights) ist der einzige Roman der englischen Schriftstellerin Emily Brontë (1818–1848). Der 1847 unter dem Pseudonym Ellis Bell veröffentlichte Roman wurde vom viktorianischen Publikum weitgehend abgelehnt, heute gilt er als ein Klassiker der britischen Romanliteratur des 19. Jahrhunderts."
3+
8c42c706-a979-41cf-9ffe-91e6cf1383a0,201,fr,Les Hauts de Hurlevent,"Les Hauts de Hurlevent (titre original : Wuthering Heights), parfois orthographié Les Hauts de Hurle-Vent, est l'unique roman d'Emily Brontë, publié pour la première fois en 1847 sous le pseudonyme d’Ellis Bell. Loin d'être un récit moralisateur, Emily Brontë achève néanmoins le roman dans une atmosphère sereine, suggérant le triomphe de la paix et du Bien sur la vengeance et le Mal."
4+
9e1c4c81-dc90-4600-85b1-e9dd4bf12ce0,207,de,Jane Eyre,"Jane Eyre. Eine Autobiographie (Originaltitel: Jane Eyre. An Autobiography), erstmals erschienen im Jahr 1847 unter dem Pseudonym Currer Bell, ist der erste veröffentlichte Roman der britischen Autorin Charlotte Brontë und ein Klassiker der viktorianischen Romanliteratur des 19. Jahrhunderts. Der Roman erzählt in Form einer Ich-Erzählung die Lebensgeschichte von Jane Eyre (ausgesprochen /ˌdʒeɪn ˈɛə/), die nach einer schweren Kindheit eine Stelle als Gouvernante annimmt und sich in ihren Arbeitgeber verliebt, jedoch immer wieder um ihre Freiheit und Selbstbestimmung kämpfen muss. Als klein, dünn, blass, stets schlicht dunkel gekleidet und mit strengem Mittelscheitel beschrieben, gilt die Heldin des Romans Jane Eyre nicht zuletzt aufgrund der Kino- und Fernsehversionen der melodramatischen Romanvorlage als die bekannteste englische Gouvernante der Literaturgeschichte"
5+
9be0524b-4cb9-4fc1-9dc2-d65b1c13cf53,252,de,Eleonora,"“Eleonora” ist eine Erzählung von Edgar Allan Poe. Sie wurde 1841 erstveröffentlicht. In ihr geht es um das Paradox der Treue in der Treulosigkeit."
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ID,parent_ID,name
2+
10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,,Fiction
3+
11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Drama
4+
12aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Poetry
5+
13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Fantasy
6+
131aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Fairy Tale
7+
132aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Epic Fantasy
8+
133aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,High Fantasy
9+
134aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Gothic
10+
14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Science Fiction
11+
141aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Utopian and Dystopian
12+
1411aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,141aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Utopian
13+
1412aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,141aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Dystopian
14+
14121aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1412aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Cyberpunk
15+
141211aa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14121aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Steampunk
16+
142aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Space Opera
17+
143aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Time Travel
18+
144aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,14aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Tech Noir
19+
15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Romance
20+
151aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Contemporary Romance
21+
152aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Historical Romance
22+
153aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Romantic Suspense
23+
16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Mystery
24+
161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Crime
25+
1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Thriller
26+
16111aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Police Procedural
27+
16112aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Legal Thriller
28+
16113aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Medical Thriller
29+
16114aaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,1611aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Spy Thriller
30+
1612aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Detective
31+
1613aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,161aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Suspense
32+
162aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Noir
33+
1621aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,162aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Nordic Noir
34+
1622aaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,162aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Tart Noir
35+
163aaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Cozy Mystery
36+
17aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Adventure
37+
18aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Short Story
38+
19aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,10aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Graphic Novel
39+
20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,,Non-Fiction
40+
21aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Biography
41+
22aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,21aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Autobiography
42+
23aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Essay
43+
24aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,20aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,Speech

0 commit comments

Comments
 (0)