{"id":24016335,"url":"https://github.com/decodelabs/idiom","last_synced_at":"2025-04-15T14:07:31.755Z","repository":{"id":56964658,"uuid":"470503885","full_name":"decodelabs/idiom","owner":"decodelabs","description":"Lightweight text to HTML parser - tags optional","archived":false,"fork":false,"pushed_at":"2025-04-14T08:48:12.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-14T09:45:57.460Z","etag":null,"topics":["parser","php","text-to-html"],"latest_commit_sha":null,"homepage":"","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/decodelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-03-16T09:00:01.000Z","updated_at":"2025-04-14T08:48:15.000Z","dependencies_parsed_at":"2023-01-31T19:31:03.922Z","dependency_job_id":"fb619678-35ff-449c-b832-f62a5d469669","html_url":"https://github.com/decodelabs/idiom","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"a4394d66e64ac8d033e14da98c9e7f4b40e02230"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fidiom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fidiom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fidiom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Fidiom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decodelabs","download_url":"https://codeload.github.com/decodelabs/idiom/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860035,"owners_count":21173339,"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":["parser","php","text-to-html"],"created_at":"2025-01-08T08:48:58.643Z","updated_at":"2025-04-15T14:07:31.748Z","avatar_url":"https://github.com/decodelabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Idiom\n\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/decodelabs/idiom?style=flat)](https://packagist.org/packages/decodelabs/idiom)\n[![Latest Version](https://img.shields.io/packagist/v/decodelabs/idiom.svg?style=flat)](https://packagist.org/packages/decodelabs/idiom)\n[![Total Downloads](https://img.shields.io/packagist/dt/decodelabs/idiom.svg?style=flat)](https://packagist.org/packages/decodelabs/idiom)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/decodelabs/idiom/integrate.yml?branch=develop)](https://github.com/decodelabs/idiom/actions/workflows/integrate.yml)\n[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true\u0026style=flat)](https://github.com/phpstan/phpstan)\n[![License](https://img.shields.io/packagist/l/decodelabs/idiom?style=flat)](https://packagist.org/packages/decodelabs/idiom)\n\n### Lightweight text to HTML parser - tags optional\n\nIdiom provides a simple and easy to use text parser that can convert natural language with an optional subset of HTML tags to full markup ready for consumption.\n\n---\n\n\n## Installation\n\nInstall the library via composer:\n\n```bash\ncomposer require decodelabs/idiom\n```\n\n## Usage\n\nParse a block of text with optional HTML tags into rendered HTML:\n\n```php\nuse DecodeLabs\\Idiom\\Parser;\n\n$content = \u003c\u003c\u003cCONTENT\nIdiom allows you to write naturally, converting paragraphs, lines and spaces to the relevant HTML elements.\n\nYou can include \u003cstrong\u003etags\u003c/strong\u003e where necessary.\n\n\u003cul\u003e\n    \u003cli\u003eBlock elements like this can be used if extended mode is enabled\u003c/li\u003e\n    \u003cli\u003eAlternatively, content can be rendered as inline HTML with inline mode\u003c/li\u003e\n\u003c/ul\u003e\nCONTENT;\n\n$parser = new Parser();\n$parser-\u003esetExtended(true);\necho $parser-\u003eparse($content);\n```\n\n### Metamorph\n\nIdiom also provides a [Metamorph](https://github.com/decodelabs/metamorph/) Handler so that it can be used via its simplified interface:\n\n```php\nuse DecodeLabs\\Metamorph;\n\necho Metamorph::{'idiom.extended'}($content);\n```\n\n## Output\n\nThe parsed HTML provided by Idiom is wrapped in a \u003ccode\u003eMarkup\u003c/code\u003e interface from the [Tagged](https://github.com/decodelabs/tagged/) library such that output is handled correctly in all rendering contexts.\n\n\n### Safety\n\nPlease note, Idiom does not yet exhaustively treat input for malicious entities - this parser should only be used with content considered _safe_.\n\n\n## Licensing\nIdiom is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodelabs%2Fidiom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecodelabs%2Fidiom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodelabs%2Fidiom/lists"}