{"id":15529358,"url":"https://github.com/mnapoli/frontyaml","last_synced_at":"2025-05-14T15:06:55.999Z","repository":{"id":13528893,"uuid":"16220252","full_name":"mnapoli/FrontYAML","owner":"mnapoli","description":"YAML Front matter parser","archived":false,"fork":false,"pushed_at":"2025-01-29T09:02:46.000Z","size":60,"stargazers_count":285,"open_issues_count":1,"forks_count":29,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T02:56:15.798Z","etag":null,"topics":["frontmatter","markdown","markdown-parser","php","yaml"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"lecho/hellocharts-android","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnapoli.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}},"created_at":"2014-01-24T23:32:00.000Z","updated_at":"2025-01-29T09:02:31.000Z","dependencies_parsed_at":"2025-02-27T23:11:25.121Z","dependency_job_id":"45615e6f-f5dd-4717-8102-06a074471698","html_url":"https://github.com/mnapoli/FrontYAML","commit_stats":{"total_commits":56,"total_committers":15,"mean_commits":"3.7333333333333334","dds":0.5892857142857143,"last_synced_commit":"d42d84159f3725d50f7bda953ed90185b3c41cc4"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2FFrontYAML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2FFrontYAML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2FFrontYAML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnapoli%2FFrontYAML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnapoli","download_url":"https://codeload.github.com/mnapoli/FrontYAML/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169470,"owners_count":22026212,"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":["frontmatter","markdown","markdown-parser","php","yaml"],"created_at":"2024-10-02T11:17:27.129Z","updated_at":"2025-05-14T15:06:55.971Z","avatar_url":"https://github.com/mnapoli.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FrontYAML\n\nAn implementation of YAML Front matter for PHP. It can parse both YAML **and** Markdown.\n\n[![Total Downloads](https://poser.pugx.org/mnapoli/front-yaml/downloads.svg)](https://packagist.org/packages/mnapoli/front-yaml)\n\n## Installation\n\nRequire the project with Composer:\n\n```\ncomposer require mnapoli/front-yaml\n```\n\n## Usage\n\n```php\n$parser = new Mni\\FrontYAML\\Parser;\n\n$document = $parser-\u003eparse($str);\n\n$yaml = $document-\u003egetYAML();\n$html = $document-\u003egetContent();\n```\n\nIf you don't want the Markdown to be parsed (maybe because it is not Markdown):\n\n```php\n$document = $parser-\u003eparse($str, false);\n```\n\n## Example\n\nThe following file:\n\n```markdown\n---\nfoo: bar\n---\nThis is **strong**.\n```\n\nWill give:\n\n```php\nvar_export($document-\u003egetYAML());\n// array(\"foo\" =\u003e \"bar\")\n\nvar_export($document-\u003egetContent());\n// \"\u003cp\u003eThis is \u003cstrong\u003estrong\u003c/strong\u003e\u003c/p\u003e\"\n```\n\n## YAML and Markdown parsers\n\n```php\n$parser = new Mni\\FrontYAML\\Parser($yamlParser, $markdownParser);\n```\n\nThis library uses dependency injection and abstraction to allow you to provide your own YAML or Markdown parser.\n\n```php\ninterface YAMLParser\n{\n    public function parse($yaml);\n}\n```\n\nFrontYAML uses by default [Symfony's YAML parser](http://symfony.com/doc/current/components/yaml/introduction.html).\n\n```php\ninterface MarkdownParser\n{\n    public function parse($markdown);\n}\n```\n\nFrontYAML uses by default the [League CommonMark parser](https://github.com/thephpleague/commonmark).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnapoli%2Ffrontyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnapoli%2Ffrontyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnapoli%2Ffrontyaml/lists"}