-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from JanStanleyWatt:add-readme
Add README.md
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Commonmark Figure Extension | ||
|
||
[League\CommonMark](https://github.com/thephpleague/commonmark)extension for HTML diagrams and captions inspired by [Markdig](https://github.com/xoofx/markdig). | ||
|
||
## Installation | ||
```Console | ||
$ composer require jsw/commonmark-figure-extension | ||
``` | ||
|
||
## Usage | ||
```php | ||
$environment = new Environment(); | ||
$environment->addExtension(new CommonMarkCoreExtension()); | ||
->addExtension(new FitureExtension()); | ||
|
||
$converter = new MarkdownConverter($environment); | ||
|
||
$markdown =<<<EOL | ||
^^^ | ||
![example-image](https://example.com/image.jpg) | ||
^^^ This is caption for image | ||
EOL; | ||
|
||
// <figure><img src="https://example.com/image.jpg" alt="example-image"> | ||
// <figcaption>This is caption for image</figcaption></figure> | ||
echo $converter->convert($markdown); | ||
``` | ||
|
||
## License | ||
Apache-v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters