Skip to content

Commit

Permalink
Initial development
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Aug 13, 2020
1 parent 360a726 commit 44447c5
Show file tree
Hide file tree
Showing 14 changed files with 2,108 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
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
7 changes: 7 additions & 0 deletions .gitignore
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
17 changes: 17 additions & 0 deletions .travis.yml
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
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
21 changes: 21 additions & 0 deletions LICENSE
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.
31 changes: 31 additions & 0 deletions README.md
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:!');
```
25 changes: 25 additions & 0 deletions composer.json
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"
}
}
8 changes: 8 additions & 0 deletions phpunit.xml.dist
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>
Loading

0 comments on commit 44447c5

Please sign in to comment.