You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-2Lines changed: 29 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ There are two entry classes:
21
21
22
22
The naming convention for methods that are not part of the League CommonMark implementation follow the convention established by [PSR-7](https://www.php-fig.org/psr/psr-7/).
23
23
24
-
Methods prefixed by the word `with` will return a new instance to facilitate immunitability.
24
+
Methods prefixed by the word `with` will return a new instance to facilitate immutability.
25
25
26
26
### Markdown
27
27
@@ -32,6 +32,8 @@ The Markdown class makes some presumptions the FluentCommonMark class does not:
32
32
33
33
The Markdown class uses the the default configuration provided by CommonMark with modifications recommended by the [security](https://commonmark.thephpleague.com/2.0/security/) page of the CommonMark documentation.
34
34
35
+
The Markdown class also affords users the ability to use the [8fold CommonMark Abbreviations](https://github.com/8fold/commonmark-abbreviations) and [8fold CommonMark Accessible Heading Permalinks](https://github.com/8fold/commonmark-accessible-heading-permalinks) extensions whereas FluentCommonMark is strictly vanilla [League CommonMark](https://commonmark.thephpleague.com).
36
+
35
37
Write some markdown:
36
38
37
39
```markdown
@@ -89,12 +91,37 @@ Output:
89
91
90
92
```
91
93
92
-
The Mardkown extends the FluentCommonMark class.
94
+
The Markdown extends the FluentCommonMark class.
93
95
94
96
### FluentMarkdown
95
97
96
98
The FluentMarkdown class is designed to mimic the behavior and feel of the CommonMark library. There are additional methods in place to facilitate the fully fluent nature of this library.
97
99
100
+
### Container
101
+
102
+
The Container class is a singleton that may contain one or more converter configurations.
103
+
104
+
This is useful if you find yourself instantiating multiple markdown converters:
105
+
106
+
1. With each server request.
107
+
2. With the same configuration and options.
108
+
109
+
By placing those converters in the Container, they only need to be instantiated once and you should see a performance increase by doing so.
110
+
111
+
```
112
+
Container::instance()->addConverter(
113
+
Markdown::create()->abbreviations()
114
+
)->addConverter(
115
+
FluentCommonMark::create()->descriptionLists()
116
+
);
117
+
118
+
// Returns the Markdown instance (first converter in list)
0 commit comments