update
This commit is contained in:
104
templates/Format/Baustein.md
Normal file
104
templates/Format/Baustein.md
Normal file
@@ -0,0 +1,104 @@
|
||||
```
|
||||
BAUSTEIN-CARD-STIL (HTML+CSS, in Browser anzeigbar)
|
||||
|
||||
ZWECK
|
||||
- Einzelner Baustein als kompakte Card-Darstellung
|
||||
- Schnelles Nachschlagen einzelner Konzepte
|
||||
- Card ist Teil einer größeren Baustein-Sammlung
|
||||
- Nicht zum Lernen, sondern zum Wiedererkennen
|
||||
- Pro Card genau 1 Baustein
|
||||
|
||||
FORMAT
|
||||
- HTML mit eingebettetem CSS
|
||||
- Im Browser anzeigbar (kein PDF-Output)
|
||||
- Card auf hellgrauem Hintergrund zentriert
|
||||
- Max-width 1000px, padding 28px 36px
|
||||
- Border-radius 12px, dezenter Schatten
|
||||
- Page-Hintergrund #f0f0f5
|
||||
|
||||
STRUKTUR — STRIKT NUR DIESE 4 ELEMENTE
|
||||
1. Titel (h1, fett, ohne Label, ohne Logo)
|
||||
2. Beschreibung (ein knapper Satz)
|
||||
3. Zweck (kursiv, grau, ein knapper Satz)
|
||||
4. Code-Beispiele (untereinander, mit Mini-Label oben)
|
||||
|
||||
KEIN Logo, KEIN "Baustein"-Label, KEIN Sprach-Tag, KEINE Sektion-Überschriften ("Beschreibung", "Zweck", "Relevante Beispiele"), KEINE Info-Blöcke, KEINE Warn/Tip/Note-Boxen, KEINE Meta-Informationen, KEINE Trennlinien zwischen Sektionen.
|
||||
|
||||
TYPOGRAFIE
|
||||
- Body: -apple-system, "Segoe UI", sans-serif, 14px, line-height 1.5
|
||||
- Titel h1: 28px, font-weight 800, letter-spacing -0.5px, line-height 1.1
|
||||
- Beschreibung: 14px, line-height 1.55
|
||||
- Zweck: 14px, italic, color #5a6470
|
||||
- Code: "SF Mono", Consolas, monospace, 12px, line-height 1.5
|
||||
- Code-Label: 10px, uppercase, letter-spacing 1px
|
||||
|
||||
FARBEN
|
||||
- Card-Hintergrund: #ffffff
|
||||
- Page-Hintergrund: #f0f0f5
|
||||
- Text: #1a1a1a
|
||||
- Muted (Zweck): #5a6470
|
||||
- Code-Hintergrund: #1e2a3a
|
||||
- Code-Text: #e6e6e6
|
||||
- Syntax-Highlighting:
|
||||
- Keywords (.k): #ff79c6 (pink)
|
||||
- Variablen (.v): #ffb86c (orange)
|
||||
- Strings (.s): #f1c40f (gelb)
|
||||
- Funktionen (.f): #50fa7b (grün)
|
||||
- Typen (.t): #8be9fd (cyan)
|
||||
- Kommentare (.c): #6b8aae italic
|
||||
- Label-Farbe in Code: #8be9fd (cyan)
|
||||
|
||||
INHALTLICHE PRINZIPIEN
|
||||
- Titel: nur der Baustein-Name, kein Präfix, keine Variante
|
||||
- Beschreibung: 1 Satz, was es macht (mechanisch, neutral)
|
||||
- Zweck: 1 Satz, wofür man es nutzt (Anwendungsfall)
|
||||
- Beide Sätze knapp wie möglich, jedes überflüssige Wort raus
|
||||
- Pro Beispiel ein knappes Label oben (2-4 Wörter, uppercase)
|
||||
|
||||
LAYOUT-DETAILS
|
||||
- Header und Body keine separaten Sektionen, alles in einer Card
|
||||
- Titel zuerst, darunter direkt Beschreibung, darunter Zweck (mit margin-bottom)
|
||||
- Margin-bottom Beschreibung: 6px (eng zum Zweck)
|
||||
- Margin-bottom Zweck: 22px (Abstand zu Code)
|
||||
- Margin-bottom Titel: 14px
|
||||
- Code-Blöcke untereinander, gap 14px
|
||||
- Code-Block padding: 14px 16px, border-radius 8px
|
||||
|
||||
CODE-BEISPIELE
|
||||
- So viele wie nötig, so wenige wie möglich
|
||||
- Untereinander gestapelt (grid-template-columns: 1fr)
|
||||
- Jedes Beispiel zeigt eine sinnvolle Variante / Use-Case
|
||||
- Sehr kurz: ideal 3-6 Zeilen, max 8 Zeilen
|
||||
- Mit kurzem Label was die Variante zeigt
|
||||
- Syntax-Highlighting durch span-Klassen (.k, .v, .s, etc.)
|
||||
- Triviale Bausteine: 1-2 Beispiele
|
||||
- Komplexere Bausteine: 4-6 Beispiele
|
||||
- Anzahl ergibt sich aus dem Inhalt, nicht aus Vorgabe
|
||||
|
||||
VERMEIDEN
|
||||
- Lange Erklärungstexte
|
||||
- Mehrere Sätze für Beschreibung oder Zweck
|
||||
- Performance-Tipps, Trade-Offs, Edge Cases
|
||||
- Verwandte Bausteine, Varianten, Anti-Patterns
|
||||
- Tabellen, Listen, Aufzählungen
|
||||
- Icons, Emojis, Symbole
|
||||
- Komplexe Code-Beispiele (über 8 Zeilen)
|
||||
|
||||
THEMENSPEZIFISCHE ANPASSUNGEN
|
||||
- Bei anderen Sprachen: Syntax-Highlighting-Klassen anpassen
|
||||
- Titel-Größe und Spacing bleiben gleich
|
||||
- Card-Layout bleibt gleich
|
||||
- Inhalte (Beschreibung, Zweck, Beispiele) sprachspezifisch
|
||||
|
||||
GENERIERUNG MIT FEEDBACK-LOOP
|
||||
1. HTML schreiben
|
||||
2. In Browser anzeigen (Playwright-Screenshot oder direkt)
|
||||
3. Prüfen:
|
||||
- Wirklich nur 4 Elemente (Titel, Beschreibung, Zweck, Beispiele)?
|
||||
- Beschreibung und Zweck unter 15 Wörtern?
|
||||
- Code-Beispiele unter 8 Zeilen?
|
||||
- Labels über Code-Blöcken kurz und prägnant?
|
||||
- Card kompakt, kein leerer Raum?
|
||||
4. Wenn etwas zu viel: weglassen, nicht hinzufügen
|
||||
5. Bei jeder Iteration prüfen: lässt sich noch was weglassen?
|
||||
```
|
||||
119
templates/Referenz/Baustein.md
Normal file
119
templates/Referenz/Baustein.md
Normal file
@@ -0,0 +1,119 @@
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Baustein: for-Schleife</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
font-family: -apple-system, "Segoe UI", sans-serif;
|
||||
background: #f0f0f5;
|
||||
padding: 40px 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #ffffff;
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
border-radius: 12px;
|
||||
padding: 28px 36px;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
||||
color: #1a1a1a;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 28px;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.5px;
|
||||
line-height: 1.1;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.beschreibung {
|
||||
font-size: 14px;
|
||||
line-height: 1.55;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.zweck {
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
color: #5a6470;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.examples {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.code-block {
|
||||
background: #1e2a3a;
|
||||
color: #e6e6e6;
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
padding: 14px 16px;
|
||||
border-radius: 8px;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.code-block .label {
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
color: #8be9fd;
|
||||
margin-bottom: 6px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.k { color: #ff79c6; }
|
||||
.v { color: #ffb86c; }
|
||||
.n { color: #ffb86c; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="card">
|
||||
|
||||
<h1>for-Schleife</h1>
|
||||
|
||||
<p class="beschreibung">Führt einen Code-Block wiederholt aus.</p>
|
||||
|
||||
<p class="zweck">Wiederholung wenn Anzahl Durchläufe bekannt ist oder Index gebraucht wird.</p>
|
||||
|
||||
<div class="examples">
|
||||
|
||||
<div class="code-block"><span class="label">Vorwärts zählen</span><span class="k">for</span> (<span class="v">$i</span> = <span class="n">0</span>; <span class="v">$i</span> < <span class="n">10</span>; <span class="v">$i</span>++) {
|
||||
<span class="k">echo</span> <span class="v">$i</span>;
|
||||
}</div>
|
||||
|
||||
<div class="code-block"><span class="label">Rückwärts zählen</span><span class="k">for</span> (<span class="v">$i</span> = <span class="n">10</span>; <span class="v">$i</span> > <span class="n">0</span>; <span class="v">$i</span>--) {
|
||||
<span class="k">echo</span> <span class="v">$i</span>;
|
||||
}</div>
|
||||
|
||||
<div class="code-block"><span class="label">In 2er-Schritten</span><span class="k">for</span> (<span class="v">$i</span> = <span class="n">0</span>; <span class="v">$i</span> <= <span class="n">20</span>; <span class="v">$i</span> += <span class="n">2</span>) {
|
||||
<span class="k">echo</span> <span class="v">$i</span>;
|
||||
}</div>
|
||||
|
||||
<div class="code-block"><span class="label">Mit Array-Index</span><span class="k">for</span> (<span class="v">$i</span> = <span class="n">0</span>; <span class="v">$i</span> < <span class="n">3</span>; <span class="v">$i</span>++) {
|
||||
<span class="k">echo</span> <span class="v">$arr</span>[<span class="v">$i</span>];
|
||||
}</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
Reference in New Issue
Block a user