Coder Social home page Coder Social logo

sculpin-parsedown's Introduction

Sculpin parsedown

Sculpin is a PHP static site generator, that use markdown file to store content. By default it's parse that files using php-markdown, that is a nice PHP markdown parser, but do not support flavored markdown from github and have some performance issues.

This use the awesome parsedown 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 pages

Site is generated on a i7 CPU, an SSD disk and 16GB RAM.

Using markdown:

real  0m8.954s
user  0m7.884s
sys   0m0.235s

Using parsedown:

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:

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:

use Michelf\Markdown;

and transform line 48 from:

    public function __construct(Markdown $markdown, array $extensions = array())

to

    public function __construct(Markdown $markdown, array $extensions = array())

removing Markdown variable definition.

sculpin-parsedown's People

Contributors

mavimo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.