Using Markdown in the core (latest core svn)

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Using Markdown in the core (latest core svn)

Post by calguy1000 »

In the latest core svn code (I just committed it minutes ago), I've added the Markdown language.

to use it, just modify your templates in one of these two ways:

a) Use markdown as a block tag
you can do something like this in your template.

Code: Select all

{markdown}
{content wysiwig=false}
{/markdown}
b) Use markdown as a modifier

Code: Select all

{content wysiwig=false | markdown }
It should just work.  and should allow you to develop html code without having to learn html (well, you'll have to learn the markdown syntax instead.

The markdown syntax is available here:  http://daringfireball.net/projects/markdown/syntax

Have fun everybody.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Using Markdown in the core (latest core svn)

Post by calguy1000 »

I erred, if you're using the latest and greatest svn, and you wish to use the markdown stuff in block form you need to use

Code: Select all

{cms_markdown}
stuff
===
{/cms_markdown}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Using Markdown in the core (latest core svn)

Post by tsw »

as calguy is such a nice person to let us use markdown I imported a markdown toolbar for him  ;D

http://dev.cmsmadesimple.org/projects/markdowntoolbar/
glezos

Re: Using Markdown in the core (latest core svn)

Post by glezos »

Hi.

First of all, 1K thanks for adding Markdown to the core. This is a great addition.

Is there any way that one could disable markdown inside another smarty tag? For example:

{cms_markdown}
  foo...
    {news markdown=false}
  bar...
{/cms_markdown}

Because without this, the stuff {news} return get messed up by markdown.

Thanks again!
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Using Markdown in the core (latest core svn)

Post by tsw »

dont know any other way than

{cms_markdown}
  foo...
{/cms_markdow}
    {news markdown=false}
{cms_markdown}
  bar...
{/cms_markdown}

or changing news template to not have indents (thats what causing the output to be broken as three spaces in the beginnning makes markdown to treat it as a code)

hope this helps
glezos

Re: Using Markdown in the core (latest core svn)

Post by glezos »

Maybe we could put this in a TODO or something?

I guess it's something that might be useful for many purposes. I mean, provide each module with an option to disable plugins when called. For example:

    {news disable="markdown"}

or
    {news disable="foo, bar"}

-d
hansom

Re: Using Markdown in the core (latest core svn)

Post by hansom »

We had a Markdown regarding in this thread, but nothing really came out of it. I've said it before, but what really would be useful IMHO is an option to set the kind of text processing on Page and/or Content Block level. That way one could specify how content should be rendered for a specific Content Block on a specific Page, e.g. with some of the wysiwig options, by Markdown or perhaps Textile, or if the text should be output simply as is. I don't know if this possible to implement, anyone?
Post Reply

Return to “Tips and Tricks”