Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ueberdosis/commonmark-hint-extension
Render :::important Hints::: in league/commonmark
https://github.com/ueberdosis/commonmark-hint-extension
commonmark commonmark-extension markdown
Last synced: 7 days ago
JSON representation
Render :::important Hints::: in league/commonmark
- Host: GitHub
- URL: https://github.com/ueberdosis/commonmark-hint-extension
- Owner: ueberdosis
- License: mit
- Created: 2021-08-26T10:08:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-27T15:09:23.000Z (about 3 years ago)
- Last Synced: 2024-10-17T13:32:01.025Z (about 1 month ago)
- Topics: commonmark, commonmark-extension, markdown
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
> We need your support to maintain this package. 💖 https://github.com/sponsors/ueberdosis
# CommonMark Hint Extension
[![](https://img.shields.io/packagist/v/ueberdosis/commonmark-hint-extension.svg)](https://packagist.org/packages/ueberdosis/commonmark-hint-extension)
[![Tests](https://github.com/ueberdosis/commonmark-hint-extension/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/ueberdosis/commonmark-hint-extension/actions/workflows/test.yml)
[![](https://img.shields.io/packagist/dt/ueberdosis/commonmark-hint-extension.svg)](https://packagist.org/packages/ueberdosis/commonmark-hint-extension)
[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)A hint extension for [league/commonmark](https://github.com/thephpleague/commonmark) that renders the following Markdown as HTML.
## Example
### Markdown
```md
:::important Warning!
This is how the **Markdown** looks.
:::
```### HTML
```html
Warning!
This is how the Markdown looks.
```## Installation
You can install the package via composer:
```bash
composer require ueberdosis/commonmark-hint-extension
```## Usage
```php
addExtension(new CommonMarkCoreExtension());// Add this extension
$environment->addExtension(new HintExtension());// Instantiate the converter engine and start converting some Markdown!
$converter = new MarkdownConverter($environment);
$markdown = <<convertToHtml($markdown);
```## Testing
```bash
composer test
```## Credits
- [Hans Pagel](https://github.com/hanspagel)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.