-
Notifications
You must be signed in to change notification settings - Fork 24
Added basic support for Markdown-extra format. #1232
base: master
Are you sure you want to change the base?
Conversation
@oemunoz Thanks for the pull request. I would love to have markdown support for WikkaWiki. This is a big chunk of code. I'd like to focus my review on changes affecting existing codebase. Can you provide a brief overview of the changes? It looks like most the new code is packaged in |
Hi, thanks for you early comment, and yes is a short edit on libs/Wakka.class.php the important code. I try to keep the rest of the code under the handlers/md directory. The edit over templates is for prism.js highligther, is very configurable and file copy/paste code on javascript and css. The real change to view is only a few lines over libs/Wakka.class.php for support on the ".md" extension on the documents with markdown format. |
If you want to try a good example, looks on: I have another handler waiting, Wikka-reveal-handler, this is for presentations on reveal.js. How we cant manage this series of plugins? |
@oemunoz Looks impressive! One of the items on my to-do list is to provide support for alternative parsers. This is a good start. I'll take a look over the holidays and come up with some ideas. I like the idea of a handler, but not having to rename pages to use a specific parser. But I understand it works for you, and requires a minimum amount of base code changes to implement. Right now, my first priority is to get the next release PHP 7 compliant. |
That are excellent upgrade news, I use WikkaWiki for almost everything, you are right I create the handlers with a minimum code changes in mind, and based on community code. Im only a lamer copy/paste programmer, but if I can help, tell me please. If you gonna to dev, maybe take a look over the WikkaWiki docker container. |
Now is not necessary to copy the prism.css and the prism.js to all themes, the handler uses some on the "plugins/handlers/md/" the edition of the Wakka.class.php can be done manually. The only change that the handlers needs is on Wakka.class.php. And we dont need a merge to this. There is some way to iterate on the Wakka.class.php without ask for a merge on each new handler? elseif( $this->GetHandler() == 'show' && pathinfo($this->GetPageTag(), PATHINFO_EXTENSION) == 'md' && $this->page['body'] != '' )
{
// Hugly handler but util.
$this->Handler($this->handler = 'md');
echo $this->Header();
echo $this->Handler($this->GetHandler());
echo $this->Footer();
} |
Probably a more elegant way to do this would be to create a formatter wrapper (the handler 'show' calls Format(), which can specify any defined formatter) called "md" or whatever, rather than creating a new handler. For instance, look at the handler 'html'...it simply calls Format(...'html'...), which is a defined formatter. I'm thinking about the bigger picture here...alternate formatters have always been on the radar. I'd like to see formatters that can be specified at the page level, user level (with individual page overrides) and site level (with user level and page level overrides, if permitted by the admin). But this is a good start. I'll take a look at it when I get the time to do so. |
The handler plugins stay on separated projects (Wikka-reveal-handler , Wikka-md-handler ) , but two of them works with only the appropriated modification on Wakka.class.php. |
I'd like to keep this open otherwise I'll lose track of it. |
Sorry for asking this in this space, but you know how to create a user on the ".org" page? I never could |
I agree with what @bakoontz has said. I worry however that this will get pushed off indefinitely when I would really like to have a chance for myself and other users to give it a spin now. I'd favor a more incremental approach, moving the plugin itself into its own repository. In your fork of this project, make the changes you need to make that plugin work. Then resubmit those core changes as a pull request along perhaps with an update of the README that includes a section explaining how to use the plugin to enable markdown support. This will separate out concerns more cleanly and give reviewers a chance to recommend ways, as @bakoontz suggests, to integrate this feature more elegantly. So I recommend closing this pull request but coming back quickly with a new smaller one without the plugin itself that we could review more thoroughly. |
You are right, I gonna to leave this here, but I gonna to work on a cleaner implementation from a fresh Fork. Then we can replace the request with a solid one. |
@oemunoz Email me offline (click my profile link) and I'll get you set up. |
I put a demo on http://wiki.pepitosoft.com/ The incremental repo is on Wikka-md-handler, and the dockerhub |
Hi to all, I put a complete repository on https://github.com/pepitosoft/wikkademo with the respective changes We will to keep all on this pull request or we gonna to create a new one? Please check the demo on http://wiki.pepitosoft.com/ tnks |
Just leave this pull request for now. I'm about 90% done with the PHP 7 database changes using PDO. I'm going to check in a prerelease branch, perhaps you and @klenwell can take a look at it, make sure I didn't mess anything up in a major way. There are still a couple of MySQL-specific instances of code, but I figure whoever takes on a postgres port can address those. After that, I can look at what you've done and see about how best to integrate it. At some point, I should look at @klenwell 's refactor as well. |
This is adaptation of cede/markdown parser, the complete description is under Wikka-md-handler.