Page 1 of 1

Markdown module

Posted: Sun Aug 28, 2005 4:54 pm
by arl
One of the few things I have been been missing in CMSMS is the ability to use a simple kind of markup language when writing content. Using HTML gets a bit annoying in the long run and the WYSIWYG editors just seem a bit too clumsy for me. So I have made a simple module that integrates Markdown (http://daringfireball.net/projects/markdown/) into CMSMS. Markdown is  a very simple and elegant markup language similar to what is used in a wiki.

You can find the module here: http://bogong.dk/markdown. Let me know if you experience any problems with it.

Allan

Re: Markdown module

Posted: Sun Aug 28, 2005 9:49 pm
by Ted
I've been wanting to do this, but on a more low level.  I'm definitly going to take a look at your module, though.  I'm very curious as to how it's implemented.

What would people think of the idea of making this a WYSIWYG option, along side of TinyMCE and FCKeditor?

Re: Markdown module

Posted: Sun Aug 28, 2005 10:32 pm
by Redguy
yeah.. I would like to give it a try...
However, I'm mostly looking forward to the next CMSMS release, giving the FCKeditor a test ride and the CSSMenu implementation!

How's CMSMS version 0.11 Beta1 looking Wishy?

Re: Markdown module

Posted: Sun Aug 28, 2005 10:42 pm
by Ted
It's getting there.  I need to check out the FCKeditor progress before I decide to do a total replacement of TinyMCE first.

I was going to make this 0.10.1, but it looks like there are enough big changes to warrant 0.11 instead.

Re: Markdown module

Posted: Fri Sep 02, 2005 7:09 am
by nils73
arl,

great work. I will have a look into it because I like MarkDown as well as Textpattern but I am more familiar with the latter.

Regards,
Nils

Re: Markdown module

Posted: Fri Sep 02, 2005 10:50 pm
by arl
I have just released version 1.1, it contains a couple of bugfixes:
  • Support for multiline Smarty tags.
  • Fix some problems regarding paragraphs and Smarty tags - e.g. don't make a Smarty tag by itself into a paragraph and don't mess up paragraphs that begin or end with a Smarty tag.
It can be downloaded from: http://bogong.dk/markdown

Please let me know if you find any bugs.

Wishy: regarding the idea of making it a WYSIWYG option, there is a major problem. When using Markdown then content of pages are stored as Markdown markup and not as HTML. Therefore you need a system where all users either use or don't use Markdown - any combination will become a real mess. An option to enable or disable Markdown must be systemwide and to avoid too much confusion it would probably be best if enabling it automatically disabled the WYSIWYG editors.

Allan

Re: Markdown module

Posted: Sat Sep 03, 2005 1:46 am
by Ted
Oh, so you're converting it to html on rendering?  That's actually very close to what I originally wanted to do.  In fact, there is already a field in the content table that I default to 'html'.  The idea was that I could do 'markdown' or 'bbcode' and only those pages would get rendered that way.

Obviously it gets kind of complicated...

But, anyway, keep doing what you're doing.  Good stuff.

Re: Markdown module

Posted: Sat Sep 03, 2005 3:55 pm
by arl
Yes, I am using ContentData() to do the conversion. Very simple actually...

That extra field in the content table might be all we need for a good solution. Say that you add a selection box to the "edit content" page where the user can set the "content type" of the page to html, markdown or something else (default selection controlled in user preferences). If a page is configured for markdown then the "edit content" page always shows a standard textarea for input and not any of the WYSIWYG editors. That way users should not start to mix the two without knowing what they are doing.

The user should be able to change content type of existing pages (might want to add a global setting to allow/disallow this):

Markdown -> HTML: Offer to convert content to HTML for the user.
HTML -> Markdown: Just change the content type, Markdown will happily leave the HTML in the page alone.
Markdown -> Something else (e.g. BBCode): Not possible.

And then we of course only process pages with content-type Markdown during rendering.

Allan

Re: Markdown module

Posted: Mon Sep 05, 2005 6:47 am
by arl
Hi Patricia,

I am actually working on a CMS module that does this, the gallery you see on bogong.dk is created using this module. The module is almost finished, I will try to get it ready for release (it is GPL) within a couple of days - no promises though, I am a little busy this week...

Allan

Re: Markdown module

Posted: Tue Sep 06, 2005 9:03 am
by arl
The Flickr module has been released. See this thread: http://forum.cmsmadesimple.org/index.ph ... 584.0.html

Allan

Re: Markdown module

Posted: Fri Feb 03, 2006 11:15 pm
by good
it looks like Markdown module won't work
on preview everything good, but it won't save results :~\
please help

Re: Markdown module

Posted: Fri Feb 03, 2006 11:27 pm
by arl
The markdown module is unsupported. It worked with the 0.10 series of CMS, but the API was changed for the 0.11 series and it was no longer possible to obtain the desired effect.

Allan