At the moment \Michelf\MarkdownExtra is implemented as a subclass of \Michelf\_MarkdownExtra_TmpImpl. Are there any plans to change this? When using PHP Markdown Extra it would be nice to be able to use a single PHP file, as in previous release. Thanks!
Actually yes, there is a plan to move the actual implementation of MarkdownExtra to the MarkdownExtra.php file. I've only temporarily refrained from doing so because I want git merges to continue to work between the extra and lib branches. After the cutoff date for the classic parser and the extra branch (February 1, 2014) I'll move everything where they logically belong.
Do you mean you want to include only one file? I'm aware that not everyone use autoloading and I plan to have a "master include" file that'd include the others. With the changes I just made today in the lib branch you have to include both MarkdownInterface.php, Markdown.php, and MarkdownExtra.php, and in the right order, if you wish to use the MarkdownExtra parser. That's not pretty. The only thing delaying that is I wonder what should be the name of that file and whether it should be put in the Michelf directory or at the root. If you've seen this "master include" pattern elsewhere, or something else doing the same job, please let me know.
Yes, I would like to include only one file. It was quite handy in the past. I didn't know that the plan is to have multiple files in the future, so I probably wait until February 2014 and then see what's a good way to switch to latest MarkdownExtra version.
Added ".inc.php" files in the Michelf directory.
Switching to 1.4.0 was very simple. Included Markdown.php with minor modifications, renamed class and removed interface. If Markdown Extra class would not be abstract and interface would be in same file, it could be used without any modification.
But have you tried including the ".inc.php" file?
Then I would have to add 4 files to my project. MarkdownExtra.inc.php plus the 3 referenced in it.
Ah, I see. There's no escape to the fact that the "lib" distribution is a folder and not a single file, even though you can now require_once only one file.
The abstract class in the Markdown.php file is a temporary hack to be able to merge the changes between the extra and lib branches. It's abstract because you shouldn't use it.
You really can't add a folder with 6 files in it to your project instead of adding a file?
@michelf Just wanted to say thanks for the .inc.php file! Really appreciate that because it just keeps things simpler when I want to pop your Markdown class into a project file.
I also wanted to chime in here because I actually think it would be nice if Markdown was broken down further (e.g. into MORE files, not fewer). As it exists (it's awesome); but breaking the class methods apart further in the future could help to better organize the codebase and make it easier for others to get involved here at GitHub.
The current class files are very long and that tends to make it harder for a newcomer to grasp what each component is designed for. Particularly with IDEs like PhpStorm where a long file can also make it difficult to navigate.
Anyway, just my opinion. Thanks again! 😀
Perhaps there can be a way that satisfies both needs, use the complete folder and be non-autoloader friendly?
A possible solution (assuming Markdown gets broken down into more files in the future); which is only an opinion of my own at this point. Anyway, if Markdown where broken down into many files in the future, if a developer would like to pull all of those files into a project with just ONE file, a PHAR file could be used for this.
Composer is a great example of this.
See also: http://php.net/phar
@markseu I'm still missing the reason why you can't put a folder in your project and include "Michelf/MakdownExtra.inc.php". Are you worried about performance dropping with more files, or is it something else?
@michelf The reason is simplicity. Software grows over time, sometimes I think about what can be removed before adding more things.