Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Commit

Permalink
Merge branch '2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Indal committed Mar 3, 2018
2 parents 23bfa33 + e5d2dd0 commit 561c659
Show file tree
Hide file tree
Showing 12 changed files with 1,416 additions and 361 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor
vendor
.phpintel
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: php
php:
- 5.6
- 7.0
- 7.1

before_script:
- composer self-update
- composer install --no-interaction

script:
- vendor/bin/phpunit
41 changes: 17 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,19 @@

A small, lightweight and easy-to-use Laravel package for handling markdown. It comes with a facade, a helper function and a Blade directive to make life easier for you.

This package utilizes the [Parsedown-package](http://parsedown.org/) by @erusev.
| Laravel version | Laravel-Markdown version |
| --------------- | ------------------------------------------------------------------- |
| 5.5 | [2.0](https://github.com/andreasindal/laravel-markdown/tree/2.0) |
| 5.3, 5.4 | [1.1](https://github.com/andreasindal/laravel-markdown/tree/1.1) |
| 5.2 | [1.0](https://github.com/andreasindal/laravel-markdown/tree/master) |

## Installation

To install it, simply pull it down with Composer. Run the `php artisan vendor:publish` command to publish the configuration file.

composer require andreasindal/laravel-markdown:"1.0"

All you have to do is to reference the service provider under the `'providers'` array in your `config/app.php` file. If you want to use the facade as well, include a reference under the `'aliases'` array in the same file.

```php
// config/app.php

'providers' => [
// ...

Indal\Markdown\MarkdownServiceProvider::class,

// ...
];

'aliases' => [
// ...

'Markdown' => Indal\Markdown\Facade::class,

// ...
];
```

## Configuration
Laravel 5.5 uses Package Auto-Discovery, so you do not have to manually add the MarkdownServiceProvider.

## Usage

Expand Down Expand Up @@ -99,6 +81,17 @@ $html = $parser->parse('# Hello'); // <h1>Hello</h1>

```

### Drivers (NEW!)

Laravel-Markdown allows you to add custom markdown drivers. In order to use a custom markdown driver, you need to create a class that implements the `Indal\Markdown\Drivers\MarkdownDriver` interface. The interface contains two methods: `text` and `line`. `text` is used to convert a block of markdown to HTML, while `line` is used to convert a single line.

Laravel-Markdown ships with a `ParsedownDriver` using the [Parsedown-package](http://parsedown.org/) by @erusev.


## Credits

* Mohamed Said [(@themsaid)](https://github.com/themsaid)

## License

Licensed under MIT. For more information, see the [LICENSE-file](https://github.com/andreasindal/laravel-markdown/blob/master/LICENSE).
15 changes: 13 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"require": {
"Illuminate/Support": "^5.2",
"Illuminate/Support": "^5.5",
"erusev/parsedown": "^1.6"
},
"autoload": {
Expand All @@ -21,6 +21,17 @@
]
},
"require-dev": {
"phpunit/phpunit": "^5.2"
"phpunit/phpunit": "^6.0",
"mockery/mockery": "^0.9.9"
},
"extra": {
"laravel": {
"providers": [
"Indal\\Markdown\\MarkdownServiceProvider"
],
"aliases": {
"Markdown": "Indal\\Markdown\\Facade"
}
}
}
}
Loading

0 comments on commit 561c659

Please sign in to comment.