Skip to content

Commit

Permalink
Merge pull request #7 from JanStanleyWatt:add-readme
Browse files Browse the repository at this point in the history
Add README.md
  • Loading branch information
J.S.W authored Mar 8, 2023
2 parents 88500c1 + 793dd63 commit 397ca7f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
],
"description": "League/commonmark extension for HTML figure and caption.",
"license": "Apache-2.0",
"readme": "README.md",
"require-dev": {
"league/commonmark": "^2.3",
"phpunit/phpunit": "^9.5",
Expand Down

0 comments on commit 397ca7f

Please sign in to comment.