From 3e207c9ca9588d06e890ae03968a4e05a4dd8608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haso=C5=88?= Date: Fri, 2 Feb 2024 00:37:14 +0100 Subject: [PATCH] Create 2.0.0 release --- .editorconfig | 3 +++ CHANGELOG.md | 2 +- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index b02db26..00b727e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,6 @@ max_line_length = 120 [*.php] indent_size = 4 + +[composer.*] +indent_size = 4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edde7f..9567cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ CHANGELOG ========= -2.0.0 (2023-12-22) +2.0.0 (2024-02-02) ------------------ * Enable Symfony 7 diff --git a/README.md b/README.md index cea3515..7bcc4a9 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,53 @@ This library can be installed via Composer: Usage ----- +This library can parse all form of front matter: + + + + + + + + +
YAML (Neon)TOMLJson
+ +```markdown +--- +foo: bar +--- + +# h1 + +paragraph +``` + + + +```markdown ++++ +foo = bar ++++ + +# h1 + +paragraph +``` + + + +```markdown +{ + "foo": "bar" +} + +# h1 + +paragraph +``` + +
+ ### Parse an arbitrary string ```php @@ -95,8 +142,8 @@ Hello world! Available converters: | Converter | Twig | -| ----------------------------------------- | ---------------------------------------------------------- | -| `DataToTwigConvertor::nothing()` | `` | +| ----------------------------------------- |------------------------------------------------------------| +| `DataToTwigConvertor::nothing()` | | | `DataToTwigConvertor::vars()` | `{% set key1 = value1 %}` | | `DataToTwigConvertor::vars(false)` | `{% set key1 = key1 is defined ? key1 : value1 %}` | | `DataToTwigConvertor::var('name')` | `{% set name = {key1: value1, key2: value2} %}` | @@ -133,5 +180,6 @@ Alternatives ------------ - https://github.com/spatie/yaml-front-matter +- https://github.com/ergebnis/front-matter - https://github.com/mnapoli/FrontYAML - https://github.com/Modularr/YAML-FrontMatter