Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janstanleywatt/commonmark-figure-extension
League\CommonMark extension for HTML diagrams and captions inspired by Markdig.
https://github.com/janstanleywatt/commonmark-figure-extension
commonmark commonmark-extension html markdown php php-library
Last synced: 9 days ago
JSON representation
League\CommonMark extension for HTML diagrams and captions inspired by Markdig.
- Host: GitHub
- URL: https://github.com/janstanleywatt/commonmark-figure-extension
- Owner: JanStanleyWatt
- License: apache-2.0
- Created: 2023-03-07T11:32:39.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-10T13:28:11.000Z (10 months ago)
- Last Synced: 2024-10-12T01:50:00.575Z (about 1 month ago)
- Topics: commonmark, commonmark-extension, html, markdown, php, php-library
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
- Fence the top and bottom of the sentence you want to be a figure with `^` like a code block
- Continued text in bottom fence becomes figure caption
- Even if the number of upper and lower `^` is different, it will be processed normally```php
$environment = new Environment();
$environment->addExtension(new CommonMarkCoreExtension());
->addExtension(new FigureExtension());$converter = new MarkdownConverter($environment);
$markdown =<<
// This is caption for image
echo $converter->convert($markdown);
```## Contribution
1. Fork it (https://github.com/JanStanleyWatt/commonmark-figure-extension)
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Rebase your local changes against the master branch (if necessary)
1. Run test suite with the `composer test` command and confirm that it passe
1. Push to the branch (`git push origin my-new-feature`)
1. Create new Pull Request## License
Apache-v2