Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Added basic support for Markdown-extra format. #1232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oemunoz
Copy link
Contributor

@oemunoz oemunoz commented Dec 5, 2016

This is adaptation of cede/markdown parser, the complete description is under Wikka-md-handler.

@klenwell
Copy link

klenwell commented Dec 5, 2016

@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 handlers/md and that the changes in existing codebase are located in libs/Wakka.class.php and templates. Is that correct?

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 5, 2016

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.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 5, 2016

If you want to try a good example, looks on:
Readme.md
the plugin uses the extended sintaxis (this is optional.)

I have another handler waiting, Wikka-reveal-handler, this is for presentations on reveal.js.

How we cant manage this series of plugins?

@bakoontz
Copy link
Owner

bakoontz commented Dec 5, 2016

@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.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 5, 2016

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.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 5, 2016

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();
		}

@bakoontz
Copy link
Owner

bakoontz commented Dec 6, 2016

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.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 6, 2016

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.

@oemunoz oemunoz closed this Dec 6, 2016
@bakoontz bakoontz reopened this Dec 6, 2016
@bakoontz
Copy link
Owner

bakoontz commented Dec 6, 2016

I'd like to keep this open otherwise I'll lose track of it.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 6, 2016

Sorry for asking this in this space, but you know how to create a user on the ".org" page? I never could

@klenwell
Copy link

klenwell commented Dec 6, 2016

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.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 6, 2016

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.

@bakoontz
Copy link
Owner

bakoontz commented Dec 6, 2016

@oemunoz Email me offline (click my profile link) and I'll get you set up.

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 7, 2016

I put a demo on http://wiki.pepitosoft.com/
Allow registration please-be-nice.

The incremental repo is on Wikka-md-handler, and the dockerhub

@oemunoz
Copy link
Contributor Author

oemunoz commented Dec 14, 2016

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/
Allow registration please-be-nice.

tnks

@bakoontz
Copy link
Owner

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.

@wikkawik wikkawik added this to the 1.4.0 milestone Jan 4, 2017
@bakoontz bakoontz modified the milestones: 1.4.0, 1.4.1 Apr 11, 2018
@bakoontz bakoontz modified the milestones: 1.4.1, 1.4.2 Feb 11, 2020
@bakoontz bakoontz modified the milestones: 1.4.2, 1.4.3 Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants