feat: port all template categories to JSON format

- Ported Minimalist templates to JSON (Swiss Grid, Brutalist, etc.)
- Ported Tech templates to JSON (SaaS, Terminal, Cyberpunk, etc.)
- Ported Creative templates to JSON (Art Gallery, Zine, Pop Art, etc.)
- Ported Industrial templates to JSON (Blueprint, Factory, Schematic, etc.)
- Ported Nature templates to JSON (Botanical, Ocean, Mountain, etc.)
- Ported Lifestyle templates to JSON (Cookbook, Travel, Coffee House, etc.)
- Ported Vintage templates to JSON (Art Deco, Medieval, Retro 80s, etc.)
- Updated README.md to reflect the new JSON-based style system (example configuration and contribution workflow)
- Completed migration of over 150 styles to the new architecture
This commit is contained in:
TypoGenie
2026-02-01 18:51:43 +02:00
parent da335734d3
commit a6f664088c
405 changed files with 69134 additions and 5936 deletions

View File

@@ -0,0 +1,74 @@
// Default templates embedded in the app
// These are written to disk on first run if no templates exist
export const defaultTemplates: Record<string, string> = {
"academic/research-paper.json": JSON.stringify({
"id": "research-paper",
"name": "Research Paper",
"category": "Academic",
"description": "Formal academic formatting for research papers and scholarly articles.",
"vibe": "Scholarly, Formal, Precise",
"googleFontsImport": "https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&display=swap",
"typography": {
"fonts": { "heading": "Crimson Text", "body": "Crimson Text", "code": "Consolas, Monaco, monospace" },
"colors": { "text": "000000", "textSecondary": "444444", "background": "FFFFFF", "accent": "2F5496", "border": "CCCCCC", "codeBg": "F5F5F5", "blockquoteBorder": "2F5496" }
},
"elements": {
"h1": { "font": "heading", "size": 28, "color": "text", "bold": true, "align": "center", "spacing": { "before": 24, "after": 18, "line": 1.2 } },
"h2": { "font": "heading", "size": 14, "color": "text", "bold": true, "align": "left", "spacing": { "before": 18, "after": 8, "line": 1.2 } },
"h3": { "font": "heading", "size": 12, "color": "text", "bold": true, "align": "left", "spacing": { "before": 14, "after": 6, "line": 1.2 } },
"h4": { "font": "heading", "size": 11, "color": "text", "bold": true, "italic": true, "align": "left", "spacing": { "before": 12, "after": 4, "line": 1.2 } },
"p": { "font": "body", "size": 11, "color": "text", "align": "justify", "spacing": { "before": 0, "after": 0, "line": 1.8 }, "indent": 24 },
"blockquote": { "font": "body", "size": 10.5, "color": "textSecondary", "italic": true, "spacing": { "before": 12, "after": 12, "line": 1.5 }, "indent": 36, "borderLeft": { "color": "accent", "width": 3, "style": "solid" } },
"code": { "font": "code", "size": 9.5, "color": "text", "background": "codeBg" },
"pre": { "font": "code", "size": 9, "color": "text", "background": "codeBg", "spacing": { "before": 12, "after": 12 }, "padding": 12, "border": { "color": "border", "width": 1, "style": "solid" } },
"ul": { "spacing": { "before": 8, "after": 8 }, "indent": 24, "bullet": "disc" },
"ol": { "spacing": { "before": 8, "after": 8 }, "indent": 24, "numbering": "decimal" },
"li": { "font": "body", "size": 11, "spacing": { "before": 2, "after": 2 } },
"strong": { "font": "body", "bold": true },
"em": { "font": "body", "italic": true },
"a": { "font": "body", "color": "accent", "underline": true },
"table": { "spacing": { "before": 12, "after": 12 }, "border": { "color": "border", "width": 1, "style": "solid" } },
"th": { "font": "heading", "size": 10, "bold": true, "background": "F0F0F0", "padding": 8 },
"td": { "font": "body", "size": 10, "padding": 8 },
"hr": { "border": { "color": "border", "width": 1, "style": "solid" }, "spacing": { "before": 18, "after": 18 } }
},
"page": { "margins": { "top": 72, "bottom": 72, "left": 72, "right": 72 } }
}, null, 2),
"core/default.json": JSON.stringify({
"id": "default",
"name": "Default Clean",
"category": "Core",
"description": "Clean, versatile default style that works for any document type.",
"vibe": "Clean, Versatile, Professional",
"googleFontsImport": "https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap",
"typography": {
"fonts": { "heading": "Source Sans 3", "body": "Source Sans 3", "code": "Source Sans 3" },
"colors": { "text": "1A1A1A", "textSecondary": "2D2D2D", "background": "FFFFFF", "accent": "2563EB", "border": "E5E5E5", "codeBg": "F5F5F5", "blockquoteBorder": "2563EB" }
},
"elements": {
"h1": { "font": "heading", "size": 28, "color": "text", "bold": true, "align": "left", "spacing": { "before": 20, "after": 10 } },
"h2": { "font": "heading", "size": 15, "color": "textSecondary", "bold": true, "align": "left", "spacing": { "before": 14, "after": 7 } },
"h3": { "font": "heading", "size": 13, "color": "textSecondary", "bold": true, "align": "left", "spacing": { "before": 12, "after": 6 } },
"p": { "font": "body", "size": 11, "color": "333333", "align": "left", "spacing": { "before": 0, "after": 9, "line": 1.6 } },
"blockquote": { "font": "body", "size": 11, "color": "textSecondary", "italic": true, "spacing": { "before": 12, "after": 12 }, "borderLeft": { "color": "accent", "width": 4, "style": "solid" } },
"code": { "font": "code", "size": 9.5, "background": "codeBg" },
"pre": { "font": "code", "size": 9, "background": "codeBg", "padding": 12 },
"ul": { "spacing": { "before": 8, "after": 8 }, "indent": 24 },
"ol": { "spacing": { "before": 8, "after": 8 }, "indent": 24 },
"li": { "font": "body", "size": 11 },
"strong": { "font": "body", "bold": true },
"em": { "font": "body", "italic": true },
"a": { "font": "body", "color": "accent", "underline": true },
"table": { "spacing": { "before": 12, "after": 12 } },
"th": { "font": "heading", "size": 10, "bold": true, "background": "F0F0F0" },
"td": { "font": "body", "size": 10 },
"hr": { "border": { "color": "border", "width": 1, "style": "solid" } }
},
"page": { "margins": { "top": 72, "bottom": 72, "left": 72, "right": 72 } }
}, null, 2)
};
// List of all template paths that should exist
export const templatePaths = Object.keys(defaultTemplates);