{"id":40970560,"url":"https://github.com/coenttb/swift-document-templates","last_synced_at":"2026-01-22T06:42:58.352Z","repository":{"id":251193812,"uuid":"836607181","full_name":"coenttb/swift-document-templates","owner":"coenttb","description":"A Swift package for data-driven business document creation.","archived":false,"fork":false,"pushed_at":"2025-10-31T15:14:13.000Z","size":2459,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T15:33:02.337Z","etag":null,"topics":["business","business-documents","documents","generation","html","html-templates","invoices","legaltech","pdf-generation","swift","templates"],"latest_commit_sha":null,"homepage":"https://coenttb.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coenttb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["coenttb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-08-01T07:47:27.000Z","updated_at":"2025-10-31T15:14:17.000Z","dependencies_parsed_at":"2025-09-29T11:19:15.174Z","dependency_job_id":null,"html_url":"https://github.com/coenttb/swift-document-templates","commit_stats":null,"previous_names":["coenttb/swift-document-templates"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coenttb/swift-document-templates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coenttb%2Fswift-document-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coenttb%2Fswift-document-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coenttb%2Fswift-document-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coenttb%2Fswift-document-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coenttb","download_url":"https://codeload.github.com/coenttb/swift-document-templates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coenttb%2Fswift-document-templates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28657108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["business","business-documents","documents","generation","html","html-templates","invoices","legaltech","pdf-generation","swift","templates"],"created_at":"2026-01-22T06:42:58.230Z","updated_at":"2026-01-22T06:42:58.346Z","avatar_url":"https://github.com/coenttb.png","language":"Swift","funding_links":["https://github.com/sponsors/coenttb"],"categories":[],"sub_categories":[],"readme":"# swift-document-templates\n\n[![CI](https://github.com/coenttb/swift-document-templates/workflows/CI/badge.svg)](https://github.com/coenttb/swift-document-templates/actions/workflows/ci.yml)\n![Development Status](https://img.shields.io/badge/status-active--development-blue.svg)\n\nA Swift package for data-driven generation of common business documents including invoices, letters, agendas, attendance lists, invitations, and signature pages.\n\n## Overview\n\nswift-document-templates provides type-safe Swift models and HTML-based rendering for business documents. Built on swift-html's DSL, it enables programmatic document generation with multi-language support via swift-translating, and PDF export capabilities through swift-html-to-pdf.\n\n## Features\n\n- **Invoice**: Generate invoices with line items, VAT calculations, and customizable metadata\n- **Letter**: Create formal business letters with structured sender/recipient information\n- **Agenda**: Build meeting agendas with topics, speakers, and timings\n- **Attendance List**: Track attendees for meetings, events, or training sessions\n- **Invitation**: Generate professional event invitations\n- **Signature Page**: Create signature blocks for natural persons, legal entities, and complex organizational structures\n- **Multi-language support**: Dutch and English translations built-in via swift-translating\n- **Type-safe HTML**: All documents rendered using swift-html's compile-time-checked DSL\n- **PDF export**: Direct conversion to PDF via swift-html-to-pdf integration\n\n## Installation\n\nAdd swift-document-templates to your package dependencies:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/coenttb/swift-document-templates.git\", from: \"0.1.0\")\n]\n```\n\nThen add the product to your target:\n\n```swift\ntargets: [\n    .target(\n        name: \"YourTarget\",\n        dependencies: [\n            .product(name: \"DocumentTemplates\", package: \"swift-document-templates\")\n        ]\n    )\n]\n```\n\n## Quick Start\n\n### Invoice Example\n\n```swift\nimport DocumentTemplates\n\nlet invoice = Invoice(\n    sender: .init(\n        name: \"Your Company\",\n        address: [\"123 Main St\", \"City\", \"Country\"],\n        phone: \"123-456-7890\",\n        email: \"billing@company.com\",\n        website: \"www.company.com\",\n        kvk: \"12345678\",\n        btw: \"NL123456789B01\",\n        iban: \"NL00BANK1234567890\"\n    ),\n    client: .init(\n        id: \"CUST001\",\n        name: \"Client Name\",\n        address: [\"789 Maple St\", \"City\", \"Country\"]\n    ),\n    invoiceNumber: \"INV001\",\n    invoiceDate: Date.now,\n    expiryDate: (Date.now + 30.days),\n    metadata: [:],\n    rows: [\n        .service(.init(\n            amountOfHours: 160,\n            hourlyRate: 140.00,\n            vat: 21%,\n            description: \"Consulting services\"\n        ))\n    ]\n)\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Images/invoice.png\" width=\"400\" max-width=\"90%\" alt=\"Invoice\" /\u003e\n\u003c/p\u003e\n\n### Letter Example\n\n```swift\nimport DocumentTemplates\n\nlet sender: Letter.Sender = .init(\n    name: \"Your Company\",\n    address: [\"123 Main St\", \"City\", \"Country\"],\n    phone: \"123-456-7890\",\n    email: \"info@company.com\",\n    website: \"www.company.com\"\n)\n\nlet recipient: Letter.Recipient = .init(\n    name: \"Recipient Name\",\n    address: [\"456 Elm St\", \"City\", \"Country\"]\n)\n\nlet letter = Letter(\n    sender: sender,\n    recipient: recipient,\n    location: \"Utrecht\",\n    date: (sending: Date.now, signature: nil),\n    subject: \"Subject of the Letter\"\n) {\n    \"Dear \\(recipient.name),\"\n    p { \"I hope this finds you well.\" }\n    p { \"Best regards,\" }\n    p { \"Your Name\" }\n}\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Images/letter.png\" width=\"400\" max-width=\"90%\" alt=\"Letter\" /\u003e\n\u003c/p\u003e\n\n## Usage Examples\n\n### Agenda\n\nCreate meeting agendas with topics:\n\n```swift\nimport Agenda\n\nlet agenda = Agenda(\n    items: [\n        .init(title: \"Opening Remarks\"),\n        .init(title: \"Q1 Financial Results\"),\n        .init(title: \"Strategic Planning Discussion\")\n    ]\n)\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Images/agenda.png\" width=\"400\" max-width=\"90%\" alt=\"Agenda\" /\u003e\n\u003c/p\u003e\n\n### Attendance List\n\nTrack event participants:\n\n```swift\nimport AttendanceList\n\nlet attendanceList = AttendanceList(\n    title: \"Annual Conference\",\n    metadata: [:],\n    attendees: [\n        .init(firstName: \"John\", lastName: \"Doe\", role: \"Manager\"),\n        .init(firstName: \"Jane\", lastName: \"Smith\", role: \"Director\")\n    ]\n)\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Images/attendance_list.png\" width=\"400\" max-width=\"90%\" alt=\"Attendance List\" /\u003e\n\u003c/p\u003e\n\n### Invitation\n\nGenerate event invitations:\n\n```swift\nimport Invitation\n\nlet invitation = Invitation(\n    sender: .init(\n        name: \"Your Company\",\n        address: [\"123 Main St\", \"City\"],\n        phone: \"123-456-7890\",\n        email: \"events@company.com\",\n        website: \"www.company.com\"\n    ),\n    recipient: .init(\n        id: \"RECIP001\",\n        name: \"Guest Name\",\n        address: [\"456 Guest St\", \"City\"]\n    ),\n    invitationNumber: \"INV-2024-001\",\n    invitationDate: Date.now,\n    eventDate: Date.now,\n    location: \"Conference Center\",\n    metadata: [:]\n)\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Images/invitation.png\" width=\"400\" max-width=\"90%\" alt=\"Invitation\" /\u003e\n\u003c/p\u003e\n\n### Signature Page\n\nCreate signature blocks with Signatory enum:\n\n```swift\nimport SignaturePage\n\n// Single individual\nlet individual = Signatory.individual(\n    name: \"John Doe\",\n    title: .init(dutch: \"Directeur\", english: \"Director\"),\n    metadata: [:]\n)\n\n// Group of signers\nlet group = Signatory(\n    name: .init(dutch: \"Bedrijf B.V.\", english: \"Company B.V.\"),\n    signers: [\n        .init(name: .init(\"Jane Smith\"), metadata: [:]),\n        .init(name: .init(\"Bob Johnson\"), metadata: [:])\n    ],\n    metadata: [:]\n)\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Images/signature_page.png\" width=\"400\" max-width=\"90%\" alt=\"Signature Page\" /\u003e\n\u003c/p\u003e\n\n## Generated Examples\n\nAll code examples shown in this README are automatically generated and tested as PDF documents to ensure they stay in sync with the codebase. The generated PDFs can be found in:\n\n```\n.github/Images/\n```\n\nThese PDFs are regenerated on every test run (macOS only) by the `README PDF Examples` test suite, providing visual verification that the examples work as documented.\n\n## Platform Support\n\n- macOS 14.0+\n- iOS 17.0+\n- Mac Catalyst 17.0+\n\n## Related Packages\n\n### Dependencies\n\n- [swift-html](https://github.com/coenttb/swift-html): The Swift library for domain-accurate and type-safe HTML \u0026 CSS.\n- [swift-html-to-pdf](https://github.com/coenttb/swift-html-to-pdf): The Swift package for printing HTML to PDF.\n- [swift-money](https://github.com/coenttb/swift-money): A Swift package with foundational types for currency and monetary calculations.\n- [swift-percent](https://github.com/coenttb/swift-percent): A Swift package with foundational types for percentages.\n- [swift-translating](https://github.com/coenttb/swift-translating): A Swift package for inline translations.\n- [swift-types-foundation](https://github.com/coenttb/swift-types-foundation): A Swift package bundling essential type-safe packages for domain modeling.\n\n### Third-Party Dependencies\n\n- [pointfreeco/swift-dependencies](https://github.com/pointfreeco/swift-dependencies): A dependency management library for controlling dependencies in Swift.\n- [apple/swift-collections](https://github.com/apple/swift-collections): Commonly used data structures for Swift.\n\n## License\n\nThis package is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for details.\n\n## Contributing\n\nContributions are welcome. Please open an issue to discuss significant changes before submitting a pull request.\n\n## Contact\n\nFor questions or feedback, reach out at coen@coenttb.com or visit [coenttb.com](https://coenttb.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoenttb%2Fswift-document-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoenttb%2Fswift-document-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoenttb%2Fswift-document-templates/lists"}