-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,108 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,11 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Set EOL for PHP project files | ||
*.php text eol=lf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.eot binary | ||
*.ttf binary | ||
*.woff binary | ||
*.woff2 binary |
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,7 @@ | ||
/vendor/ | ||
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
|
||
# Dev environment | ||
.idea |
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,17 @@ | ||
dist: trusty | ||
sudo: required | ||
language: php | ||
php: | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
- 8.0 | ||
|
||
before_install: | ||
- sudo apt-get -qq update | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install | ||
|
||
script: vendor/bin/phpunit |
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,8 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
This project adheres to [Semantic Versioning] (http://semver.org/). | ||
For change log format, use [Keep a Changelog] (http://keepachangelog.com/). | ||
|
||
## [1.0.0] - 2020-08-13 | ||
|
||
Initial development |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Ronan Giron | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,31 @@ | ||
# Emoji support for `league/commonmark` | ||
|
||
This extension adds UTF-8 emoji with Github tag for the `league/commonmark` PHP Markdown parsing engine, based on the CommonMark spec. | ||
|
||
## Installation | ||
|
||
You can install the client with [Composer](https://getcomposer.org/): | ||
|
||
```bash | ||
composer require elgigi/commonmark-emoji | ||
``` | ||
|
||
## Usage | ||
|
||
Extension can be added to any new Environment: | ||
|
||
```php | ||
use League\CommonMark\CommonMarkConverter; | ||
use League\CommonMark\Environment; | ||
use ElGigi\CommonMarkEmoji\EmojiExtension; | ||
|
||
// Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go | ||
$environment = Environment::createCommonMarkEnvironment(); | ||
|
||
// Add this extension | ||
$environment->addExtension(new EmojiExtension()); | ||
|
||
// Instantiate the converter engine and start converting some Markdown! | ||
$converter = new CommonMarkConverter($config, $environment); | ||
echo $converter->convertToHtml('This extension is great :smile:!'); | ||
``` |
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,25 @@ | ||
{ | ||
"name": "elgigi/commonmark-emoji", | ||
"description": "CommonMark extension adds UTF-8 emoji with Github tag for the `league/commonmark` PHP Markdown parsing engine, based on the CommonMark spec.", | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"type": "library", | ||
"minimum-stability": "stable", | ||
"autoload": { | ||
"psr-4": { | ||
"ElGigi\\CommonMarkEmoji\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"ElGigi\\CommonMarkEmoji\\Tests\\": "tests/" | ||
} | ||
}, | ||
"require": { | ||
"php": "^7.2", | ||
"league/commonmark": "^1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^8.0|^9.0" | ||
} | ||
} |
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="./tests/bootstrap.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="ElGigi CommonMark Emoji Extension test suite"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
Oops, something went wrong.