File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,29 @@ composer require limelight/bbcode-markdown-converter
1515Simple as that.
1616
1717## Example Use
18+
19+ Using the library is pretty easy. First up, converting from BBCode to Markdown.
1820``` php
1921use \Limelight\Converter\Converter;
2022
2123require __DIR__ . '/vendor/autoload.php';
2224
2325$bbCode = file_get_contents(__DIR__ . '/data/test_post.bb'); // Pull the test post.
2426
25- $conv = new Converter(); // You can set the text in the constructor too.
26- $conv->setText($bbCode);
27+ $conv = new Converter($bbCode)
2728$conv->bbToMarkdown();
2829echo $conv->getText();
30+ ```
31+
32+ Easy, right? And the other way around.
33+ ``` php
34+ use \Limelight\Converter\Converter;
35+
36+ require __DIR__ . '/vendor/autoload.php';
37+
38+ $mdText = file_get_contents(__DIR__ . '/data/test_md.md'); // Pull the test post.
39+
40+ $conv = new Converter($mdText)
41+ $conv->markdownToBB();
42+ echo $conv->getText();
2943```
You can’t perform that action at this time.
0 commit comments