✅ Migration completed: - server.js: Complete rewrite using docxtemplater + pizzip - server-old.js: Backup of original docx-templates implementation - package.json: Added docxtemplater and pizzip dependencies - Removed docx-templates dependency 🚀 New features: - True dynamic tables with {#array}{field}{/array} syntax - Unlimited table rows (no more fixed array indices) - New API endpoints: /analyze, /generate, /demo - Simplified template creation scripts 🎯 Template improvements: - Updated template syntax examples - Added dynamic-template.docx with loop syntax - Enhanced template analysis functionality 📊 Benefits: - Real dynamic table generation - Better template flexibility - Cleaner API design - Preserved SSL and WebDAV functionality
78 lines
2.0 KiB
Plaintext
78 lines
2.0 KiB
Plaintext
Beispiel für ein DOCX-Template (template-beispiel.docx)
|
|
|
|
Da ich keine echte DOCX-Datei erstellen kann, hier eine Anleitung:
|
|
|
|
1. Öffnen Sie Microsoft Word
|
|
2. Erstellen Sie ein neues Dokument
|
|
3. Fügen Sie folgenden Inhalt ein:
|
|
|
|
---
|
|
|
|
RECHNUNG
|
|
|
|
Kunde: {{name}}
|
|
E-Mail: {{email}}
|
|
Datum: {{date}}
|
|
|
|
ARTIKEL
|
|
-------
|
|
{{#items}}
|
|
{{product}} - Anzahl: {{quantity}} - Preis: {{price}}€
|
|
{{/items}}
|
|
|
|
Gesamtsumme: {{total}}€
|
|
|
|
---
|
|
|
|
4. Speichern Sie die Datei als "template-beispiel.docx" im templates/ Ordner
|
|
5. Verwenden Sie diese Template-Namen in der Web-Oberfläche
|
|
|
|
📄 DOCX TEMPLATE ANLEITUNG
|
|
============================
|
|
|
|
🏷️ VERFÜGBARE TEMPLATES:
|
|
|
|
1. simple-template.docx
|
|
- Einfaches Template mit Name, Email, Datum, Tabelle
|
|
- Perfekt für erste Tests
|
|
|
|
2. tabellen-template.docx
|
|
- Erweiterte Tabellen-Funktionalität
|
|
- Mehrere Tabellenzeilen-Beispiele
|
|
|
|
3. test-template.docx
|
|
- Umfassendes Test-Template
|
|
- Verschiedene Tag-Typen zum Experimentieren
|
|
|
|
4. rechnung-template.docx ⭐ NEU
|
|
- Professionelle Rechnungsvorlage
|
|
- Firma, Kunde, Rechnungsposten, MwSt
|
|
- Tags: ++firma++, ++kunde_name++, ++positionen[0].artikel++
|
|
|
|
5. angebot-template.docx ⭐ NEU
|
|
- Angebots-/Kostenvoranschlag-Template
|
|
- Projektinformationen, Leistungen, Preise
|
|
- Tags: ++projekt_name++, ++leistungen[0].titel++
|
|
|
|
6. brief-template.docx ⭐ NEU
|
|
- Geschäftsbrief-Template
|
|
- Absender, Empfänger, Betreff, Brieftext
|
|
- Tags: ++betreff++, ++anrede++, ++haupttext++
|
|
|
|
🎯 TEMPLATE-SYNTAX:
|
|
Verwende ++tagname++ für Platzhalter
|
|
Verwende ++tabelle[0].spalte++ für Tabellen
|
|
|
|
🚀 NEUE FUNKTIONEN:
|
|
- 📊 Analysieren: /analyze-template/templatename.docx
|
|
- 🎲 Testen: POST /test-template/templatename.docx
|
|
- 🚀 Demo: POST /demo-template/templatename.docx (Analyse + Demo in einem!)
|
|
|
|
💡 BEISPIEL-NUTZUNG:
|
|
curl -X POST -d '{"rowCount": 5}' \
|
|
http://localhost:3000/demo-template/rechnung-template.docx
|
|
|
|
📱 WEB-INTERFACE:
|
|
http://localhost:3000/templates.html
|
|
|
|
Das war's! Viel Spaß beim Template-Erstellen! 🎉 |