{"id":36358346,"url":"https://github.com/wrklst/docxmustache","last_synced_at":"2026-02-27T20:22:11.781Z","repository":{"id":54355904,"uuid":"90483440","full_name":"wrklst/docxmustache","owner":"wrklst","description":"laravel 12.x docx template manipulation class, based on mustache templating language","archived":false,"fork":false,"pushed_at":"2025-04-30T15:41:06.000Z","size":388,"stargazers_count":56,"open_issues_count":2,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-01-11T16:26:19.777Z","etag":null,"topics":["docx","docxtemplater","laravel-5-package","microsoft-word","moustache","mustache","mustache-templates","openxml","pdf","php-library","reporting","word"],"latest_commit_sha":null,"homepage":"https://wrklst.art","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wrklst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-05-06T18:36:20.000Z","updated_at":"2026-01-02T06:36:26.000Z","dependencies_parsed_at":"2024-02-03T16:24:22.126Z","dependency_job_id":"2219eaab-e255-4f37-b873-e389181a81c6","html_url":"https://github.com/wrklst/docxmustache","commit_stats":{"total_commits":131,"total_committers":8,"mean_commits":16.375,"dds":0.3282442748091603,"last_synced_commit":"46da2623cd857d4c0fbef6bad3b8d04bcc67f896"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/wrklst/docxmustache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrklst%2Fdocxmustache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrklst%2Fdocxmustache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrklst%2Fdocxmustache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrklst%2Fdocxmustache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrklst","download_url":"https://codeload.github.com/wrklst/docxmustache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrklst%2Fdocxmustache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29623554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docx","docxtemplater","laravel-5-package","microsoft-word","moustache","mustache","mustache-templates","openxml","pdf","php-library","reporting","word"],"created_at":"2026-01-11T13:44:56.672Z","updated_at":"2026-02-27T20:22:11.775Z","avatar_url":"https://github.com/wrklst.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![DocxMutache Logo](https://github.com/wrklst/docxmustache/raw/master/example/logo.png)\n# DocxMustache *for Laravel 12.x.*\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) [![Quality Score](https://img.shields.io/scrutinizer/g/wrklst/docxmustache.svg?style=flat-square\u0026b=master)](https://scrutinizer-ci.com/g/wrklst/docxmustache/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/wrklst/docxmustache/badges/build.png?b=master)](https://scrutinizer-ci.com/g/wrklst/docxmustache/build-status/master) [![StyleCI](https://styleci.io/repos/90483440/shield?branch=master)](https://styleci.io/repos/90483440)\n\nDocx template manipulation class for Laravel 12.x, based on [mustache templating language](https://mustache.github.io). This class is still under heavy development and works more like proof of concept at the moment. Things will change quickly and might break things.\n\n![Template Example in Word](https://github.com/wrklst/docxmustache/raw/master/example/ExampleMustacheTemplate.png)\n\nWith DocxMustache, you can:\n- Replace text using Mustache syntax.\n- Embed images dynamically.\n- Support basic HTML styling (bold, italic, underline).\n\n---\n\n## Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require wrklst/docxmustache\n```\n\nRefer to the [Examples](#example) section and the `examples` folder for configuration and usage instructions.\n\n---\n\n## Features\n\n### HTML Conversion\n\nBasic HTML conversion is supported, including:\n- Bold (`\u003cb\u003e`)\n- Italic (`\u003ci\u003e`)\n- Underline (`\u003cu\u003e`)\n\n**Limitations:**\n- Does not support combined styling (e.g., bold + italic).\n- Non-HTML values must be escaped using:\n\n```php\nhtmlspecialchars($value, ENT_COMPAT, 'UTF-8');\n```\n\n**Special Note:**\nTo prevent unnecessary escaping of HTML, prefix the value with:\n\n```php\n*[[DONOTESCAPE]]*\n```\n\n---\n\n### Replacing Images\n\nDynamic image replacement is supported. Follow these steps:\n\n1. Add the image URL (reachable and supported format) to the image's **alt text description** field in the DOCX template.\n2. Use pseudo-tags around the URL, like so:\n\n```text\n[IMG-REPLACE]http://placehold.it/350x150[/IMG-REPLACE]\n```\n\n**Note:** Images will be resampled to match the constraints of the placeholder image in the template.\n\n---\n\n### DOCX to PDF Conversion\n\nTo enable DOCX-to-PDF conversion, install `libreoffice-common` on your server:\n\n```bash\nsudo apt install libreoffice-common\n```\n\nFor Arial font support, install:\n\n```bash\nsudo apt-get install ttf-mscorefonts-installer\n```\n\n---\n\n## Dependencies\n\n### Required Packages\n- [mustache/mustache](https://packagist.org/packages/mustache/mustache)\n- [intervention/image](http://image.intervention.io)\n\nFor Intervention Image, ensure you:\n1. Add the [provider and alias](http://image.intervention.io/getting_started/installation#laravel) to your app config.\n2. Install `gd` or `imagick` as required ([details here](http://image.intervention.io/getting_started/installation#laravel)).\n\n### Laravel-Specific Dependencies\nIf you want to port the package to a non-Laravel environment, consider replacing:\n- **Storage and File Classes**: Based on [Flysystem](https://flysystem.thephpleague.com), can be replaced with PHP native file handling.\n- **Process Handling**: Uses `\\Symfony\\Component\\Process\\Process` for PDF conversion.\n\n---\n\n## Example\n\nCheck out the `examples` folder for sample templates and usage.\n\n---\n\n## Contributions\n\nContributions are welcome! To contribute:\n1. Fork the repository.\n2. Create a pull request with your changes.\n3. Include a corresponding issue for discussion.\n\nWe’ll be happy to review and discuss your ideas!\n\n---\n\n## Why Another DOCX Templating Solution?\n\nWhile there are existing libraries for DOCX manipulation, they often:\n- Use proprietary or non-standard templating syntaxes.\n- Focus on complex feature sets, making them heavyweight for simple use cases.\n\nDocxMustache was designed to:\n- Use the widely adopted Mustache syntax.\n- Provide simple and intuitive value and image replacement.\n- Support repeating content in multiple dimensions.\n\n### Alternatives\nHere are other popular PHP libraries for DOCX manipulation:\n- [openTBS – Tiny But Strong](http://www.tinybutstrong.com/opentbs.php)\n- [PHPWord](https://github.com/PHPOffice/PHPWord)\n- [docxtemplater pro](https://modules.docxtemplater.com) (MIT licensed; image replacement requires a commercial plugin)\n- [docxpresso](http://www.docxpresso.com) (commercial)\n- [phpdocx](https://www.phpdocx.com) (commercial)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrklst%2Fdocxmustache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrklst%2Fdocxmustache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrklst%2Fdocxmustache/lists"}