Skip to content

Commit

Permalink
Create 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
hason committed Feb 2, 2024
1 parent 8e28c26 commit 3e207c9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ max_line_length = 120

[*.php]
indent_size = 4

[composer.*]
indent_size = 4
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CHANGELOG
=========

2.0.0 (2023-12-22)
2.0.0 (2024-02-02)
------------------

* Enable Symfony 7
Expand Down
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,53 @@ This library can be installed via Composer:
Usage
-----

This library can parse all form of front matter:

<table>
<thead><tr><th>YAML (Neon)</th><th>TOML</th><th>Json</th></tr></thead>
<tbody><tr>
<td>

```markdown
---
foo: bar
---

# h1

paragraph
```

</td>
<td>

```markdown
+++
foo = bar
+++

# h1

paragraph
```

</td>
<td>

```markdown
{
"foo": "bar"
}

# h1

paragraph
```

</td>
</tr></tbody>
</table>

### Parse an arbitrary string

```php
Expand Down Expand Up @@ -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} %}` |
Expand Down Expand Up @@ -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

0 comments on commit 3e207c9

Please sign in to comment.