Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thephpleague/commonmark-ext-inlines-only
Extension for league/commonmark which only renders inline text
https://github.com/thephpleague/commonmark-ext-inlines-only
commonmark commonmark-extension inlines markdown php
Last synced: 3 months ago
JSON representation
Extension for league/commonmark which only renders inline text
- Host: GitHub
- URL: https://github.com/thephpleague/commonmark-ext-inlines-only
- Owner: thephpleague
- License: other
- Archived: true
- Created: 2019-03-11T14:09:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T14:53:32.000Z (over 4 years ago)
- Last Synced: 2024-07-19T03:51:23.737Z (4 months ago)
- Topics: commonmark, commonmark-extension, inlines, markdown, php
- Language: PHP
- Size: 25.4 KB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Inline-only extension for `league/commonmark`
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]## DEPRECATED
**This extension has been deprecated**. All of its functionality now exists in [`league/commonmark`][link-league-commonmark] 1.3+ under the `League\CommonMark\Extension\InlinesOnly` namespace, so you should upgrade to that version and use that bundled extension instead of this one.
## Overview
This extension configures the [`league/commonmark` Markdown parser for PHP](https://github.com/thephpleague/commonmark) to only render inline elements - no paragraph tags, headers, code blocks, etc.
## Install
Via Composer
``` bash
$ composer require league/commonmark-ext-inlines-only
```## Usage
Although you normally add extra extensions to the default core one, we're not going to do that here, because this is essentially a slimmed-down version of the core extension:
``` php
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Ext\InlinesOnly\InlinesOnlyExtension;// Create a new, empty environment
$environment = new Environment();// Add this extension
$environment->addExtension(new InlinesOnlyExtension());// Instantiate the converter engine and start converting some Markdown!
$converter = new CommonMarkConverter($config, $environment);
echo $converter->convertToHtml('**Hello World!**');
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Colin O'Dell][link-author]
- [John MacFarlane][link-jgm]
- [All Contributors][link-contributors]## License
This library is licensed under the BSD-3 license. See the [License File](LICENSE.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/league/commonmark-ext-inlines-only.svg?style=flat-square
[ico-license]: http://img.shields.io/badge/License-BSD--3-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/thephpleague/commonmark-ext-inlines-only/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/thephpleague/commonmark-ext-inlines-only.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/thephpleague/commonmark-ext-inlines-only.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/league/commonmark-ext-inlines-only.svg?style=flat-square[link-packagist]: https://packagist.org/packages/league/commonmark-ext-inlines-only
[link-travis]: https://travis-ci.org/thephpleague/commonmark-ext-inlines-only
[link-scrutinizer]: https://scrutinizer-ci.com/g/thephpleague/commonmark-ext-inlines-only/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/thephpleague/commonmark-ext-inlines-only
[link-downloads]: https://packagist.org/packages/league/commonmark-ext-inlines-only
[link-author]: https://github.com/colinodell
[link-contributors]: ../../contributors
[link-league-commonmark]: https://github.com/thephpleague/commonmark
[link-jgm]: https://github.com/jgm