2017 © Pedro Peláez
 

library docxmustache

docx template manipulation class, based on mustache templating language

image

wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  • Wednesday, May 30, 2018
  • by wrklst
  • Repository
  • 4 Watchers
  • 9 Stars
  • 200 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 35 Versions
  • 20 % Grown

The README.md

DocxMutache Logo, (*1)

DocxMustache for Laravel 12.x.

Software License Quality Score Build Status StyleCI, (*2)

Docx template manipulation class for Laravel 12.x, based on mustache templating language. 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., (*3)

Template Example in Word, (*4)

With DocxMustache, you can: - Replace text using Mustache syntax. - Embed images dynamically. - Support basic HTML styling (bold, italic, underline)., (*5)


Installation

Install the package via Composer:, (*6)

composer require wrklst/docxmustache

Refer to the Examples section and the examples folder for configuration and usage instructions., (*7)


Features

HTML Conversion

Basic HTML conversion is supported, including: - Bold (<b>) - Italic (<i>) - Underline (<u>), (*8)

Limitations: - Does not support combined styling (e.g., bold + italic). - Non-HTML values must be escaped using:, (*9)

htmlspecialchars($value, ENT_COMPAT, 'UTF-8');

Special Note: To prevent unnecessary escaping of HTML, prefix the value with:, (*10)

*[[DONOTESCAPE]]*

Replacing Images

Dynamic image replacement is supported. Follow these steps:, (*11)

  1. Add the image URL (reachable and supported format) to the image's alt text description field in the DOCX template.
  2. Use pseudo-tags around the URL, like so:
[IMG-REPLACE]http://placehold.it/350x150[/IMG-REPLACE]

Note: Images will be resampled to match the constraints of the placeholder image in the template., (*12)


DOCX to PDF Conversion

To enable DOCX-to-PDF conversion, install libreoffice-common on your server:, (*13)

sudo apt install libreoffice-common

For Arial font support, install:, (*14)

sudo apt-get install ttf-mscorefonts-installer

Dependencies

Required Packages

For Intervention Image, ensure you: 1. Add the provider and alias to your app config. 2. Install gd or imagick as required (details here)., (*15)

Laravel-Specific Dependencies

If you want to port the package to a non-Laravel environment, consider replacing: - Storage and File Classes: Based on Flysystem, can be replaced with PHP native file handling. - Process Handling: Uses \Symfony\Component\Process\Process for PDF conversion., (*16)


Example

Check out the examples folder for sample templates and usage., (*17)


Contributions

Contributions are welcome! To contribute: 1. Fork the repository. 2. Create a pull request with your changes. 3. Include a corresponding issue for discussion., (*18)

We’ll be happy to review and discuss your ideas!, (*19)


Why Another DOCX Templating Solution?

While there are existing libraries for DOCX manipulation, they often: - Use proprietary or non-standard templating syntaxes. - Focus on complex feature sets, making them heavyweight for simple use cases., (*20)

DocxMustache was designed to: - Use the widely adopted Mustache syntax. - Provide simple and intuitive value and image replacement. - Support repeating content in multiple dimensions., (*21)

Alternatives

Here are other popular PHP libraries for DOCX manipulation: - openTBS – Tiny But Strong - PHPWord - docxtemplater pro (MIT licensed; image replacement requires a commercial plugin) - docxpresso (commercial) - phpdocx (commercial), (*22)

The Versions

30/05 2018

dev-master

9999999-dev https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

30/05 2018

v0.0.26

0.0.26.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

29/05 2018

v0.0.25

0.0.25.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

29/05 2018

v0.0.24

0.0.24.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

19/02 2018

v0.0.23

0.0.23.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

19/02 2018

v0.0.22

0.0.22.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

17/02 2018

v0.0.21

0.0.21.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

20/12 2017

v0.0.20

0.0.20.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

16/11 2017

v0.0.19

0.0.19.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

15/11 2017

v0.0.18

0.0.18.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

03/11 2017

v0.0.16

0.0.16.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

03/11 2017

v0.0.17

0.0.17.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

03/11 2017

dev-analysis-qgEPn4

dev-analysis-qgEPn4 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

03/11 2017

v0.0.15

0.0.15.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

02/11 2017

v0.0.14

0.0.14.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

21/10 2017

v0.0.13

0.0.13.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

19/10 2017

v0.0.12

0.0.12.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

26/09 2017

v0.0.11

0.0.11.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

13/09 2017

v0.0.10

0.0.10.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

12/09 2017

v0.0.9

0.0.9.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

12/09 2017

v0.0.8

0.0.8.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

15/07 2017

v0.0.7

0.0.7.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

04/07 2017

v0.0.6

0.0.6.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

04/07 2017

v0.0.5

0.0.5.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

01/07 2017

v0.0.4

0.0.4.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

01/07 2017

dev-analysis-XVO63w

dev-analysis-XVO63w https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

31/05 2017

v0.0.3

0.0.3.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

24/05 2017

v0.0.2

0.0.2.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

22/05 2017

dev-analysis-qByp9V

dev-analysis-qByp9V https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

08/05 2017

v0.0.1

0.0.1.0 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

08/05 2017

dev-analysis-8PrVJ9

dev-analysis-8PrVJ9 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

08/05 2017

dev-analysis-8mMj7a

dev-analysis-8mMj7a https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

07/05 2017

dev-scrutinizer-patch-3

dev-scrutinizer-patch-3 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

07/05 2017

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx

07/05 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/wrklst/docxmustache

docx template manipulation class, based on mustache templating language

  Sources   Download

MIT

The Requires

 

by Tobias Vielmetter-Diekmann

laravel template php mustache openxml docx