Giter VIP home page Giter VIP logo

Comments (22)

samdark avatar samdark commented on May 30, 2024

I think it should support github style markdown as well.

from yii2.

cebe avatar cebe commented on May 30, 2024

Should at least be easily extendable to parse additional syntax like username highlighting or issues numbers, or whatever the like.

from yii2.

samdark avatar samdark commented on May 30, 2024

Well, current one in 1.1 is extensible enough.

from yii2.

samdark avatar samdark commented on May 30, 2024

f2258e7

Autoloading looks a bit ugly.

from yii2.

samdark avatar samdark commented on May 30, 2024

Done but should be improved:

  1. Code highlighting.
  2. Github flavor support.

from yii2.

samdark avatar samdark commented on May 30, 2024

I prefer syntax highlighter to be serverside. Found these options so far:

from yii2.

yiidevelop avatar yiidevelop commented on May 30, 2024

I like code highlighter used on www.yiiframework.com

from yii2.

samdark avatar samdark commented on May 30, 2024

@yiidevelop that's the one from Pear and isn't maintained anymore.

from yii2.

yiidevelop avatar yiidevelop commented on May 30, 2024

@samdark yea, Pear use code syntax php old version, implement very difficult

from yii2.

yiidevelop avatar yiidevelop commented on May 30, 2024

@qiangxue DocComment on Yii2 class object as MarkDown syntax?
ex: [[ABC]] not found on markdown default

from yii2.

cebe avatar cebe commented on May 30, 2024

@yiidevelop Markdown + additional syntax for linking to classes, methods and properties.

from yii2.

zinzinday avatar zinzinday commented on May 30, 2024

@samdark Thanks for implement MarkdownHelper
Do you have any plans to convert from html to markdown text?
If someone does find a vendor php do this, please share.
Thank advanced

from yii2.

samdark avatar samdark commented on May 30, 2024

No, no plans for reverse conversion.

from yii2.

samdark avatar samdark commented on May 30, 2024

Another highlighting option: https://github.com/scrivo/highlight.php Original JS code is quite good so if port is accurate I'd use it.

from yii2.

iJackUA avatar iJackUA commented on May 30, 2024

I have found today this markdown parser https://github.com/kzykhys/Ciconia
it is already bundled with Github Flavored Markdown support
and has clear Extesions system, looks very promising (as with php-markdown looks very hard to extend, atleast parsing code not very clear for me).

from yii2.

iJackUA avatar iJackUA commented on May 30, 2024

Have made some test of Ciconia
Some visual rendering comparison here http://i.imm.io/1k8Z5.jpeg
Plus is that Ciconia really support some minor GFM things addtionally, liek checkboxes (but it is not so commonly needed).
Great plus is that if is very easy to extend - I was able to add basic Mustache-like syntax parser with custom plugin

    public function processWidget(Text $text)
    {
        $text->replace('/{\s*([^}]+)\s*}/', function (Text $w, Text $name) {
            return $w->replaceString("{{$name}}","RENDER $name RENDER");
        });
    }

so anyone will be able to add any simple snippets-widgets (in any case Markdown is mostly pre-rendered and cached on save to DB), so it depends only on regex you will use.

Minus (quite significant) is memory, speed and dependency on some Symfony components. As we can see for the same text

php-markdown
Memory usage: 334.8046875 Kb
Time taken : 1.1970820426941 sec

Ciconia
Memory usage: 839.6796875 Kb
Time taken : 4.6268730163574 sec

from yii2.

samdark avatar samdark commented on May 30, 2024

Quite significant speed difference...

from yii2.

samdark avatar samdark commented on May 30, 2024

http://kzykhys.com/blog/benchmarked-markdown-parsers-written-in-php/

from yii2.

cebe avatar cebe commented on May 30, 2024

Currently working with https://github.com/erusev/parsedown which is the fastest from the benchmark. I also really like what I see in the code. It currently is not extendable at all but I sent some pull requests and also got positive feedback. Imo this one is a really good choice as it support GFM out of the box and will be highly extendable when my PRs are merged.

from yii2.

cebe avatar cebe commented on May 30, 2024

Reviewed some existing markdown implementations and decided to start my own: https://github.com/cebe/markdown
All existing implementations are either slow or not extensible so I decided to combine these two factors in a new implementation. It already parses the original markdown very well. Will extend it with MarkdownExtra and GFM soon.

Please help testing it and send bug reports: https://github.com/cebe/markdown/issues

I am going to integrate this with Yii 2 when it is stable enough and will maintain a release at least as stable as yii2 will be.

from yii2.

angrybrad avatar angrybrad commented on May 30, 2024

@cebe Sorry for resurrecting an old issue, but I see you've had a bunch of pull requests merged over on the parsedown repo. Any plans of including parsedown as an official flavor in BaseMarkdown?

from yii2.

cebe avatar cebe commented on May 30, 2024

@takobell we could consider it but please open a new issue for that.

from yii2.

Related Issues (20)

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.