Skip to content

Commit edf6c4f

Browse files
committed
ADD README and CHANGELOG for release
1 parent 4181b64 commit edf6c4f

2 files changed

Lines changed: 86 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
## [1.0.0] - 2020-10-16
10+
### Added
11+
- Bundle base
12+
13+
[Unreleased]: https://github.com/AymDev/CommonMarkBundle/compare/v1.0.0...HEAD
14+
[1.0.0]: https://github.com/AymDev/CommonMarkBundle/releases/tag/v1.0.0
15+

README.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,72 @@
11
# CommonMarkBundle
2-
A Symfony 4+ bundle to easily configure league/commonmark
2+
A **Symfony 4 / 5** bundle to easily configure [league/commonmark](https://github.com/thephpleague/commonmark),
3+
allowing you to set multiple **MarkDown** converters.
4+
5+
![Unit Test Suite](https://github.com/AymDev/CommonMarkBundle/workflows/Unit%20Test%20Suite/badge.svg)
6+
[![Latest Stable Version](https://poser.pugx.org/aymdev/commonmark-bundle/v)](//packagist.org/packages/aymdev/commonmark-bundle)
7+
[![License](https://poser.pugx.org/aymdev/commonmark-bundle/license)](//packagist.org/packages/aymdev/commonmark-bundle)
8+
9+
## Installation
10+
Simply install it with **Composer**, an auto-generated recipe will enable the bundle for you:
11+
```sh
12+
composer require aymdev/commonmark-bundle
13+
```
14+
15+
## Configuration
16+
No converter is created by default.
17+
Create a **YAML** configuration file at path `config/packages/aymdev_commonmark.yaml` with the following content:
18+
```yaml
19+
aymdev_commonmark:
20+
converters:
21+
# add any converter here
22+
my_custom_converter:
23+
type: 'github'
24+
options:
25+
enable_strong: true
26+
use_underscore: false
27+
28+
my_other_converter:
29+
type: 'commonmark'
30+
extensions:
31+
- League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension
32+
```
33+
34+
### Converter settings
35+
36+
>Note that all keys inside a converter are optional.
37+
38+
#### Converter type
39+
40+
The `type` key can be used to choose between a *CommonMark* or a *GitHub* converter:
41+
42+
- `commonmark` (default): `CommonMarkConverter`
43+
- `github`: `GithubFlavoredMarkdownConverter`
44+
45+
#### Converter options
46+
47+
The `options` key holds the configuration passed to the converter, as an array.
48+
>For more information, see the [CommonMark documentation about Configuration](https://commonmark.thephpleague.com/1.5/configuration/).
49+
50+
#### Converter extensions
51+
52+
The `extensions` key allows to add any extension class to a converter.
53+
>Check the complete list of extensions on the [CommonMark documentation](https://commonmark.thephpleague.com/1.5/extensions/overview/).
54+
55+
### Using the converters
56+
57+
The bundle registers your converters as **services** with the following ID:
58+
```
59+
aymdev_commonmark.converter.CONVERTER_NAME
60+
```
61+
62+
It also creates an alias, so you can get them by *autowiring* using the *converter name* as the *argument name*,
63+
type with the `League\CommonMark\CommonMarkConverter` class.
64+
65+
**Example YAML configuration**:
66+
```yaml
67+
aymdev_commonmark:
68+
converters:
69+
# You can add an argument for this converter as:
70+
# CommonMarkConverter $myConverter
71+
my_converter:
72+
```

0 commit comments

Comments
 (0)