Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mavimo/sculpin-parsedown
Sculpin parsedown
https://github.com/mavimo/sculpin-parsedown
Last synced: about 2 months ago
JSON representation
Sculpin parsedown
- Host: GitHub
- URL: https://github.com/mavimo/sculpin-parsedown
- Owner: mavimo
- Created: 2014-01-11T22:13:15.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-11T22:34:44.000Z (about 11 years ago)
- Last Synced: 2024-12-01T04:52:12.989Z (2 months ago)
- Language: PHP
- Size: 113 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sculpin parsedown
[Sculpin](http://sculpin.io) is a PHP static site generator, that use markdown file to store content. By default it's parse that files using [php-markdown](https://github.com/michelf/php-markdown), that is a nice PHP markdown parser, but do not support [flavored markdown from github](http://github.github.com/github-flavored-markdown/) and have some performance issues.
This use the awesome [parsedown](http://parsedown.org) library that is faster that php-markdown and support flavored markdown syntax.
# Performance
I used my blog as test platform with:
* approx 100 posts
* archive (paginated posts)
* tags
* categories
* some static pagesSite is generated on a i7 CPU, an SSD disk and 16GB RAM.
#### Using [markdown](https://github.com/michelf/php-markdown):
~~~
real 0m8.954s
user 0m7.884s
sys 0m0.235s
~~~#### Using [parsedown](http://parsedown.org):
~~~
real 0m6.115s
user 0m5.834s
sys 0m0.267s
~~~the improvement is approx:
~~~
real 32%
user 26%
sys 12%
~~~average **29%** of improvement.
# Installation
To install add in your ```sculpin.json``` file the following package declaration:
~~~
{
"require": {
"mavimo/sculpin-parsedown": "@dev"
}
}
~~~Now you can update using ```sculpin update``` command.
After that add the following definition in the ```sculpin_kernel.yml```:
~~~yaml
sculpin_markdown:
parser_class: Mavimo\Sculpin\Bundle\ParsedownBundle\ParsedownConverter
~~~Sculpin have a declared dependencie in bundle, so we need to manually patch it, in file:
~~~
src/Sculpin/Bundle/MarkdownBundle/MarkdownConverter.php
~~~remove from line 14:
~~~php
use Michelf\Markdown;
~~~and transform line 48 from:
~~~php
public function __construct(Markdown $markdown, array $extensions = array())
~~~to
~~~php
public function __construct(Markdown $markdown, array $extensions = array())
~~~
removing ```Markdown``` variable definition.