Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.9.0
v22.15
2 changes: 1 addition & 1 deletion .updateTdev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_COMMIT=5103a900773b33dca171a591128d82a758724ac5
CURRENT_COMMIT=439e0c4d9568d740a8577e58774106100f0522c7
22 changes: 4 additions & 18 deletions dev/demoExamFile.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"data": {
"type": "string",
"documentRootId": "178c93a6-fa60-4ca8-97ed-f6b9344043e9",
"transformers": [
"trim"
],
"transformers": ["trim"],
"solutions": [
{ "value": "/Users/[^/]+/Desktop/demo.mp4", "regex": true },
{ "value": "C://Users/[^/]+/Desktop/demo.mp4", "regex": true }
Expand All @@ -19,14 +17,7 @@
"points": 3,
"data": {
"type": "true-false",
"answers": [
true,
true,
false,
true,
false,
false
],
"answers": [true, true, false, true, false, false],
"grading": {
"correct": 0.5,
"incorrect": -0.25,
Expand All @@ -47,12 +38,7 @@
"points": 2,
"data": {
"type": "multiple-choice",
"answers": [
true,
true,
false,
false
],
"answers": [true, true, false, false],
"grading": {
"error": -1,
"negativePoints": false
Expand All @@ -66,4 +52,4 @@
"type": "string"
}
}
}
}
3 changes: 1 addition & 2 deletions docs/tdev/app-architecture/api-deploy/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page_id: 560cfd4d-4464-42ff-a121-a3d116ea1994
import Steps from '@tdev-components/Steps'
import { Val, TemplateCode, DynamicInput } from '@tdev-components/DynamicValues';
import _ from 'es-toolkit/compat';
import { generateRandomBase64 } from './secureToken';
import { generateRandomBase64 } from '../helpers/secureToken';

# API Aufsetzen

Expand All @@ -16,7 +16,6 @@ import { generateRandomBase64 } from './secureToken';
<DynamicInput name="app" default='inf-teaching-api' />
<DynamicInput name="domain" default='teaching-api.gbsl.website' />
<DynamicInput name="APP_NAME" derived default={(page) => _.camelCase((page.dynamicValues.get('app') || 'inf-teaching-api'))} />
<DynamicInput name="API_URI" placeholder='api://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' />
<DynamicInput name="ALLOWED_ORIGINS" default='gbsl.website' />
<DynamicInput name="ALLOW_SUBDOMAINS" default='true' />
<DynamicInput name="SESSION_SECRET" monospace default='$(openssl rand -base64 32)' onRecalculate={() => generateRandomBase64()} />
Expand Down
11 changes: 5 additions & 6 deletions docs/tdev/app-architecture/dokku/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ page_id: 323ff390-40d6-4bd5-ac6c-7a05f3515526

import Steps from '@tdev-components/Steps'
import { Val, TemplateCode, DynamicInput } from '@tdev-components/DynamicValues';
import { generateRandomBase64 } from '../helpers/secureToken';

# Dokku Deploy

Expand All @@ -18,8 +19,8 @@ Durch das Hosten auf einem eigenen Server kann mit bspw. `http-auth` der Zugriff
1. Eine neue App __<Val name="app" />__ auf dem Server erstellen
<DynamicInput name="app" default='info-teaching-website' />
<DynamicInput name="domain" default='info.gbsl.website' />
<DynamicInput name="API_URI" default='api://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' />
<DynamicInput name="BACKEND_URL" default='https://xxx-api.gbsl.website' />
<DynamicInput name="BETTER_AUTH_URL" default='https://xxx-api.gbsl.website' />
<DynamicInput name="BETTER_AUTH_SECRET" monospace default='$(openssl rand -base64 32)' onRecalculate={() => generateRandomBase64()} />
<DynamicInput name="CLIENT_ID" default='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' />
<DynamicInput name="TENANT_ID" default='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' />
<TemplateCode>
Expand All @@ -32,19 +33,17 @@ Durch das Hosten auf einem eigenen Server kann mit bspw. `http-auth` der Zugriff
# remove default global domain
dokku domains:remove {{app}} {{app}}.gbsl.website

dokku config:set --no-restart {{app}} API_URI={{API_URI}}
dokku config:set --no-restart {{app}} APP_URL=https://{{domain}}
dokku config:set --no-restart {{app}} BACKEND_URL={{BACKEND_URL}}
dokku config:set --no-restart {{app}} BETTER_AUTH_URL={{BETTER_AUTH_URL}}
dokku config:set --no-restart {{app}} CLIENT_ID={{CLIENT_ID}}
dokku config:set --no-restart {{app}} TENANT_ID={{TENANT_ID}}
```
</TemplateCode>
:::details[Alternativ: direkt über <Val as="code">`/home/dokku/{{app}}/ENV`</Val>]
<TemplateCode>
```bash title="/home/dokku/{{app}}/ENV"
API_URI="{{API_URI}}"
APP_URL="https://{{domain}}"
BACKEND_URL="{{BACKEND_URL}}"
BETTER_AUTH_URL="{{BETTER_AUTH_URL}}"
CLIENT_ID="{{CLIENT_ID}}"
TENANT_ID="{{TENANT_ID}}"
NGINX_ROOT="build"
Expand Down
149 changes: 149 additions & 0 deletions docs/tdev/app-architecture/remark-plugins/code-as-attribute/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
page_id: a923c804-819a-4683-b284-001c285626bc
tags: [remark]
---

# Code as Attribute

Dieses Remark-Plugin ermöglicht es, Codeblöcke als Attribute an spezifizierte MDX-Komponenten zu übergeben. Dies ist besonders nützlich, wenn Codeblöcke als MD-Codeblock formatiert werden sollen, aber der Code als Inhalt an eine Komponente übergeben werden muss.

Wird bspw. eingesetzt für:
- [SVG-Editor](../../../gallery/persistable-documents/svg-editor/index.mdx)
- [Netpbm-Editor](../../../gallery/persistable-documents/netpbm-editor/index.mdx)
- [HTML-Editor](../../../gallery/persistable-documents/html-editor/index.mdx)

:::flex{minWidth=250px}
#### Vorher
````md
# Remark Code as Attribute

<HtmlEditor>
```html name="index.html"
<h1>Foo Bar</h1>
```
</HtmlEditor>
````
::br
#### Nachher
```md
<HtmlEditor code="\n<h1>Foo Bar</h1>\n" />
```
:::

## Optionen

### `codeAttributesName`

Wird `codeAttributesName` angegeben, so werden die Attribute `lang` und `meta` des Codeblocks zusätzlich als Objekt mit diesem Namen übergeben.

```ts title="Komponenten-Konfiguration"
{
name: 'HtmlIDE',
// highlight-start
attributeName: 'code',
codeAttributesName: 'codeAttributes'
// highlight-end
}
```

:::flex{minWidth=250px}
#### Vorher
````md
# Remark Code as Attribute

<TemplateCode>
```html name=index.html
<h1>Foo Bar</h1>
```
</TemplateCode>
````
::br
#### Nachher
```md
<TemplateCode
code="\n<h1>Foo Bar</h1>\n"
lang="html"
meta="name=index.html"
/>
```
:::

### `processMultiple`
Ist `processMultiple` gesetzt, so werden alle aufeinanderfolgenden Codeblöcke als Array von Objekten an die Komponente übergeben, wobei der CodeBlock im Feld `code` zu finden ist. Jedes Objekt enthält den Code und ggf. die Attribute `lang` und `meta`.

```ts title="Komponenten-Konfiguration"
{
name: 'HtmlIDE',
// highlight-start
attributeName: 'files',
processMultiple: true
// highlight-end
}
```

:::flex{minWidth=250px}
#### Vorher
````md
# Remark Code as Attribute

<HtmlIDE>
```html name=foo.html
<h1>Foo</h1>
```
```html name=bar.html
<h1>Bar</h1>
```
</HtmlIDE>
````
::br
#### Nachher
```mdx
<HtmlIDE
files={[
{ code: "\n<h1>Foo</h1>\n", lang: "html", meta: "name=foo.html" },
{ code: "\n<h1>Bar</h1>\n", lang: "html", meta: "name=bar.html" }
]}
/>
```
:::


## Installation

:::info[Code]
- `src/plugins/remark-code-as-attribute`
:::

:::info[`docusaurus.config.ts`]
```ts
import codeAsAttributePlugin from './src/plugins/remark-code-as-attribute/plugin';

const REMARK_PLUGINS = [
/* ... */
[
[
codeAsAttributePlugin,
{
components: [
{
name: 'HtmlEditor', // Name der React-Komponente
attributeName: 'code' // der Code wird als Attribut `code` übergeben
},
{
name: 'HtmlIDE',
attributeName: 'files',
processMultiple: true // der Code wird als Array von MultiCode-Objekten übergeben
},
{
name: 'TemplateCode',
attributeName: 'code',
codeAttributesName: 'codeAttributes' // es werden zusätzlich `lang` und `meta` übergeben
}
/*...*/
],
}
]
]
];
```
:::
84 changes: 84 additions & 0 deletions docs/tdev/gallery/display/browser-window/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
page_id: 250b7597-b43c-4923-968b-f10fd099fc10
---
import BrowserWindow from '@tdev-components/BrowserWindow';

# Browser Window

```tsx
import BrowserWindow from '@tdev-components/BrowserWindow';

<BrowserWindow>
Inhalte...
</BrowserWindow>
```

<BrowserWindow>
Inhalte...
</BrowserWindow>

## Optionen

### `url`

```tsx
<BrowserWindow url="https://example.com">
Auf der Seite [example.com](https://example.com) findet man...
</BrowserWindow>
```

<BrowserWindow url="https://example.com">
Auf der Seite [example.com](https://example.com) findet man...
</BrowserWindow>

### `href`

Die Adresse wird als Link dargestellt.

```tsx
<BrowserWindow href="https://example.com">
Auf der Seite example.com findet man...
</BrowserWindow>
<BrowserWindow href="https://example.com" url="👉 https://example.com">
Inhalte...
</BrowserWindow>
```

<BrowserWindow href="https://example.com">
Auf der Seite example.com findet man...
</BrowserWindow>
<BrowserWindow href="https://example.com" url="👉 https://example.com">
Inhalte...
</BrowserWindow>


### `minHeight` und `maxHeight`

```tsx
<BrowserWindow minHeight={200} maxHeight={400}>
Inhalte...
</BrowserWindow>
<BrowserWindow maxHeight={200}>
<div style={{ height: '800px', width: '70%', border: '2px solid red', borderRadius: '5px', padding: '10px' }}>
Vieeele Inhalte...
</div>
</BrowserWindow>
```

<BrowserWindow minHeight={200} maxHeight={400}>
Inhalte...
</BrowserWindow>
<BrowserWindow maxHeight={200}>
<div style={{ height: '800px', width: '70%', border: '2px solid red', borderRadius: '5px', padding: '10px' }}>
Vieeele Inhalte...
</div>
</BrowserWindow>

### Weitere Attribute

`style`
: CSS-Stil für das gesamte Browser-Fenster
`bodyStyle`
: CSS-Stil für den Inhaltsbereich
`className`
: Zusätzliche CSS-Klasse für das gesamte Browser-Fenster
1 change: 1 addition & 0 deletions docs/tdev/gallery/markdown/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ page_id: 49c5bf94-f670-4aa1-bfe8-5fcfa6371a15
sidebar_position: 20
---


# Markdown

Remark und seine Plugins helfen dabei, Markdown- und MDX-Dateien zu verarbeiten und anzupassen, indem sie individuelle Funktionen hinzufügen, wie etwa die Umwandlung spezieller Syntax oder die Einbindung zusätzlicher Inhalte.
Expand Down
Loading