{"id":19374712,"url":"https://github.com/gyselroth/docx-tidy","last_synced_at":"2025-04-23T18:32:05.609Z","repository":{"id":62513827,"uuid":"82078640","full_name":"gyselroth/docx-tidy","owner":"gyselroth","description":"PHP library to tidy DOCX XML files: merges successive elements of same type and properties","archived":false,"fork":false,"pushed_at":"2018-05-31T11:51:38.000Z","size":66,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-25T12:29:02.933Z","etag":null,"topics":["docx","markup","minification","office","php","tidy","word","wordml","wordprocessingml","xml"],"latest_commit_sha":null,"homepage":"http://www.gyselroth.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gyselroth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T16:01:25.000Z","updated_at":"2024-04-17T19:55:07.000Z","dependencies_parsed_at":"2022-11-02T10:16:47.687Z","dependency_job_id":null,"html_url":"https://github.com/gyselroth/docx-tidy","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyselroth%2Fdocx-tidy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyselroth%2Fdocx-tidy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyselroth%2Fdocx-tidy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyselroth%2Fdocx-tidy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gyselroth","download_url":"https://codeload.github.com/gyselroth/docx-tidy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223932207,"owners_count":17227272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","markup","minification","office","php","tidy","word","wordml","wordprocessingml","xml"],"created_at":"2024-11-10T08:35:56.001Z","updated_at":"2024-11-10T08:35:56.710Z","avatar_url":"https://github.com/gyselroth.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"DocxTidy\n========\n\n[![Total Downloads](https://img.shields.io/packagist/dt/gyselroth/docx-tidy.svg)](https://packagist.org/packages/gyselroth/docx-tidy)\n[![Latest Stable Version](https://img.shields.io/packagist/v/gyselroth/docx-tidy.svg)](https://packagist.org/packages/gyselroth/docx-tidy)\n\n\nDescription\n-----------\n\nA PHP library to tidy DOCX XML files: merges successive elements of same type and properties.\n\nBy simplifying the markup of DOCX XML, DocxTidy alleviates the efforts needed for custom modifications (for instance DOCX-based templating).\n\n* Merges successive runs having identical run-properties\n* Merges successive elements of same type (\u0026lt;w:t\u0026gt;, \u0026lt;w:instrText\u0026gt;) within each run\n\n\nDocxTidy supports two tidying modes:\n\n1. DOCX files (includes unpacking and re-archiving of contained XML files)\n2. XML string\n\n\nPlease Note\n-----------\n\n* By merging segmented tags, DocxTidy removes versioning/editing history information\n* When run with default settings, DocxTidy removes spellchecking flags (\"noProof\", \"proofErr\", \"lang\")\n* DocxTidy removes all xml:space=\"preserve\" flags and re-inserts xml:space=\"preserve\" into all \u0026lt;w:t\u0026gt; and \u0026lt;w:instrText\u0026gt; tags\n* To standardize run properties, DocxTidy deletes any font hints\n* After unifying consecutive runs w/ identical properties and removing any spellchecking flags, DocxTidy removes any resulting empty tags\n\nThis library is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, \neither express or implied.\n\n\nInstallation\n------------\n\nThe recommended way to install is via Composer:\n\n```bash\n$ composer require gyselroth/docx-tidy\n```\n\nPHP 7.1 is required since DocxTidy version 0.5.0 (PHP 5.6 until version 0.4.5)\n\n\nUsage\n-----\n\n### Example 1: Tidy a whole DOCX file\n\n```php\n\u003c?php\n\nuse DocxTidy\\DocxTidy;\n\n// tidy a DOCX file\n(new DocxTidy())-\u003etidyDocx('path/to/your.docx');\n```\n\n### Example 2: Tidy an XML (string)\n\n```php\n\u003c?php\n\nuse DocxTidy\\DocxTidy;\n\n// read DOCX XML, e.g. \"document.xml\" / \"header1.xml\" / etc\n$xml = file_get_contents('path/to/your_unzipped_docx/word/document.xml');\n\n// tidy DOCX XML string\n$xml = (new DocxTidy())-\u003etidyXml($xml);\n```\n\n\nChangelog\n---------\n\nhttps://github.com/gyselroth/docx-tidy/blob/master/CHANGELOG.md\n\n\nSubmitting bugs and feature requests\n------------------------------------\n\nBugs and feature request are tracked on [GitHub](https://github.com/gyselroth/docx-tidy/issues)\n\n\nThird party acknowledgements\n----------------------------\n\nMicrosoft Office and Word are registered trademarks of Microsoft Corporation.\n\n\nAuthor and License\n------------------\n\nCopyright 2017 gyselroth™ (http://www.gyselroth.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\":http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgyselroth%2Fdocx-tidy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgyselroth%2Fdocx-tidy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgyselroth%2Fdocx-tidy/lists"}