News for hackers. Stuff that matters.
Re:PHP CommonMark by laacz on Thursday December 25, 2014 @02:54PM (#8797016)
Is there a need for that much of abstraction in a simple markdown parser library?
Re:PHP CommonMark by pan69 on Thursday December 25, 2014 @03:26PM (#8797099)
What abstraction are you specifically referring to if I my ask?
Re:PHP CommonMark by nacs on Thursday December 25, 2014 @03:41PM (#8797137)
I think parent post is just referring to the number of classes in the source.
Re:PHP CommonMark by philstu on Friday December 26, 2014 @06:09PM (#8800866)
It depends which bit you're talking about.

A lot of implementations in various languages go with static regex approaches, which is a bit shit. This uses an AST which helps out a lot.

By adding the customization elements, people can write "GitHub Tables" or any sort of other extra syntax in.

And by keeping the HTML Rendering separate from the parsing process, other PDF renderers or whatever else could be added.

Somebody could make a [Maruka](http://markua.org/) extension for example, which is just CommonMark + Extra tags + PDF / eBook / etc.

It's not madness, and it will be optimized over time. Fear not. :)

Re:PHP CommonMark by alexbilbie on Thursday December 25, 2014 @05:11PM (#8797333)
By abstracting to the extent that the author has it should be simple to add other syntaxes to the library (e.g. rST -> HTML)
Re:PHP CommonMark by laacz on Thursday December 25, 2014 @05:25PM (#8797366)
Yes, but project is called CommonMark, so it's markdown only.
Re:PHP CommonMark by alexbilbie on Thursday December 25, 2014 @05:28PM (#8797379)
I appreciate that, we argued to death on the League internals about the focus of the package:

https://groups.google.com/forum/#!topic/thephpleague/cJECuC5...

https://groups.google.com/forum/#!topic/thephpleague/YBSnpS6...

Re:PHP CommonMark by philstu on Friday December 26, 2014 @06:10PM (#8800869)
rST > HTML is less likely, but CommonMark > PDF could definitely be a thing.
Re:PHP CommonMark by donatj on Thursday December 25, 2014 @03:11PM (#8797050)
It does feel like a bit much.