{"id":24084052,"url":"https://github.com/textile/php-textile","last_synced_at":"2025-05-16T14:04:27.704Z","repository":{"id":997084,"uuid":"807589","full_name":"textile/php-textile","owner":"textile","description":"Textile markup language parser for PHP","archived":false,"fork":false,"pushed_at":"2025-01-07T15:40:53.000Z","size":1980,"stargazers_count":217,"open_issues_count":24,"forks_count":44,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-12T10:57:53.895Z","etag":null,"topics":["composer-packages","formatter","markup-language","parser","php","textile"],"latest_commit_sha":null,"homepage":"https://textile-lang.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/textile.png","metadata":{"files":{"readme":"README.textile","changelog":"CHANGELOG.textile","contributing":".github/CONTRIBUTING.textile","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2010-07-30T15:02:17.000Z","updated_at":"2025-01-07T15:41:45.000Z","dependencies_parsed_at":"2024-06-07T19:52:48.712Z","dependency_job_id":"4b38d24b-d340-413a-a7a6-485c10d8d2ee","html_url":"https://github.com/textile/php-textile","commit_stats":{"total_commits":1019,"total_committers":9,"mean_commits":"113.22222222222223","dds":0.5201177625122669,"last_synced_commit":"6ec7449755958dac14fe5678d3630a92f629d707"},"previous_names":["textile/textile"],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textile%2Fphp-textile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textile%2Fphp-textile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textile%2Fphp-textile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textile%2Fphp-textile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textile","download_url":"https://codeload.github.com/textile/php-textile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"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":["composer-packages","formatter","markup-language","parser","php","textile"],"created_at":"2025-01-10T00:19:17.178Z","updated_at":"2025-05-16T14:04:27.682Z","avatar_url":"https://github.com/textile.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. PHP-Textile\n\n\"Textile reference\":https://textile-lang.com/ | \"Live editor\":https://textile-lang.com/doc\n\n!https://sonarcloud.io/api/project_badges/measure?project=textile_php-textile\u0026metric=coverage!:https://sonarcloud.io/summary/overall?id=textile_php-textile !https://img.shields.io/packagist/v/netcarver/textile.svg!:https://packagist.org/packages/netcarver/textile !https://img.shields.io/packagist/dt/netcarver/textile.svg!:https://packagist.org/packages/netcarver/textile\n\nPHP-Textile is a modern Textile markup language parser for PHP. Textile is a humane web text generator that takes lightweight, readable, plaintext-like markup language and converts it into well formed HTML.\n\nh2. Install\n\nUsing \"Composer\":https://getcomposer.org/:\n\nbc. $ composer require netcarver/textile\n\nh2. Usage\n\nThe Textile parser can be accessed through the @Netcarver\\Textile\\Parser@ class. The class is highly configurable, and actual parsing happens with the @parse@ method:\n\nbc. require './vendor/autoload.php';\n$parser = new \\Netcarver\\Textile\\Parser();\necho $parser-\u003eparse('h1. Hello World!');\n\nh3. Parsing untrusted input\n\nIf you are using PHP-Textile to format user-supplied input, blog comments for instance, remember to enable restricted parser mode:\n\nbc. $parser = new \\Netcarver\\Textile\\Parser();\necho $parser\n    -\u003esetRestricted(true)\n    -\u003eparse('!bad/image/not/allowed.svg!');\n\nIn restricted mode PHP-Textile doesn't allow more powerful formatting options such as inline styles, and removes any raw HTML.\n\nh3. Parsing single-line fields\n\nIf you are using PHP-Textile as a field-level formatter to parse just inline spans and glyphs, use the @setBlockTags@ method to disable block tags:\n\nbc. $parser = new \\Netcarver\\Textile\\Parser();\necho $parser\n    -\u003esetBlockTags(false)\n    -\u003eparse('Hello *strong* world!');\n\nThe above outputs:\n\nbc. Hello \u003cstrong\u003estrong\u003c/strong\u003e world!\n\nh3. Doctypes\n\nCurrently, PHP-Textile can target either XHTML or HTML5 output with XHTML being the default for backward compatibility. The targeted doctype can be changed via the @setDocumentType@ method:\n\nbc. $parser = new \\Netcarver\\Textile\\Parser();\necho $parser\n    -\u003esetDocumentType('html5')\n    -\u003eparse('HTML(HyperText Markup Language)');\n\nh3. Setting alternate glyphs\n\nTextile's typographic substitutions can be overridden with the @setSymbol@ method. If you need to setup Textile to do non-standard substitutions, call @setSymbol@ before you parse the input with @parse@.\n\nbc. $parser = new \\Netcarver\\Textile\\Parser();\n$parser\n    -\u003esetSymbol('half', '1\u0026#8260;2')\n    -\u003eparse('Hello [1/2] World!');\n\nThe symbol names you can pass to @setSymbol@ can be found \"here\":https://github.com/textile/php-textile/blob/v3.6.1/src/Netcarver/Textile/Parser.php#L710.\n\nh3. Prefixing relative image and link paths\n\nSetting prefix might be useful if you want to point relative paths to certain consistent location:\n\nbc. $parser = new \\Netcarver\\Textile\\Parser();\n$parser\n    -\u003esetImagePrefix('/user/uploads')\n    -\u003esetLinkPrefix('/')\n    -\u003eparse('!image.jpg! \"link\":page');\n\nh2. Getting in contact\n\nThe PHP-Textile project welcomes constructive input and bug reports from users. Please \"open an issue\":https://github.com/textile/php-textile/issues on the repository for a comment, feature request or bug.\n\nh2. Development\n\nSee \"CONTRIBUTING.textile\":https://github.com/textile/php-textile/blob/master/.github/CONTRIBUTING.textile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextile%2Fphp-textile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextile%2Fphp-textile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextile%2Fphp-textile/lists"}