Markdown plugin

1,498 views
Skip to first unread message

sewpafly

unread,
Feb 10, 2012, 4:40:15 PM2/10/12
to TiddlyWiki
I actually took a minute and got Markdown working as a stand alone
formatter.

If you're interested, it requires 2 tiddlers:
http://showdown.tiddlyspace.com/#ShowDown.js
http://sewpafly.tiddlyspace.com/#Markdown

Then you mark a tiddler with a tag of MarkdownFormat and it appears to
work... (at least for me)

I'd love to get some feedback on if any one else finds this useful or
finds any problems with it.

HansBKK

unread,
Feb 11, 2012, 12:01:35 AM2/11/12
to tiddl...@googlegroups.com
I would find this **very** useful, as I'm sure would others, but unfortunately don't have testing-time bandwidth these days.

However I going to be very presumptious here and ask if at all possible, could you also add (perhaps configurable) support for the Pandoc extensions?

This would allow from some pretty amazing conversion possibilities on export, including
  • HTML
  • PDF
  • OpenDocument XML/ODT
  • docx/rtf
  • AsciiDoc/DocBook XML
  • reStructuredText
  • LaTeX/ConTeXt/textile
  • MediaWiki
  • groff man pages
  • Emacs org-mode
  • EPUB
  • S5 and Slidy
The project is extremely well-supported in the GG, with John the lead developer often turning around wishlist requests within hours.

Personally I'd love to see a Pandoc writer for tiddler-nodes formatted in TW's own markup one day, ideally with tags and navigation structures in place - in other words TW as a target output, another content delivery platform.

There are wikis that already support Pandoc syntax internally, some even natively, others with plug-ins.

Jeremy Ruston

unread,
Feb 11, 2012, 4:29:44 AM2/11/12
to tiddl...@googlegroups.com
Great stuff. It's really good to see how a wikifier can be adapted for
TW in just a few lines of code.

A couple of years ago I used Showdown in the first alpha for
TiddlyWiki5: http://tiddlywiki.com/tiddlywiki5.old/, making some
changes so that tiddler links work.

Best wishes

Jeremy

> --
> You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
> To post to this group, send email to tiddl...@googlegroups.com.
> To unsubscribe from this group, send email to tiddlywiki+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
>

sewpafly

unread,
Feb 12, 2012, 1:17:37 AM2/12/12
to TiddlyWiki
That would be awesome to support the pandoc extensions. I didn't
write the markdown implementation though, it's using showdown. If you
could find a javascript markdown parser that implements the pandoc
extensions I would love to use it, but I haven't been able to find one.

PMario

unread,
Feb 12, 2012, 4:53:49 AM2/12/12
to TiddlyWiki
well done,

There is a minor issues I saw.

The markdown plugin says
|Requires |http://showdown.tiddlyspace.com/#ShowDown.js|

which is right but the "Requires" parameter is scanned by the TW core
to determine the start order of plugins. The above link points to an
external source. But you included the ShowDown.js into your space.

I think it should be:
|''Requires''|ShowDown.js|

Also the Documentation seems to be [[Markdown Documentation]]

-m

Tobias Beer

unread,
Feb 12, 2012, 10:25:27 AM2/12/12
to tiddl...@googlegroups.com
Hi sewpafly,

That's cool stuff. A few people have asked for this since I published my ShowDown implementation. Never took the time to figure out how to implement the tagged version.

I fear, there are some issues though...

1) Any tiddler tagged MarkdownFormat is not shown in the sidebar.

2) When you transclude a tiddler tagged FormatMarkdown, the tiddler is not displayed at all. Using the inline version of ShowDown it renders as it should... as rendered markdown. I would hope yours would render just as it would when rendered standalone.

I have uploaded a MTC (Minimal Testcase) to my dropbox:

tb.

PMario

unread,
Feb 12, 2012, 11:18:22 AM2/12/12
to TiddlyWiki
On Feb 11, 10:29 am, Jeremy Ruston <jeremy.rus...@gmail.com> wrote:
> A couple of years ago I used Showdown in the first alpha for
> TiddlyWiki5:http://tiddlywiki.com/tiddlywiki5.old/, making some
> changes so that tiddler links work.
Did you change the showdown.js file or something else?
-m

PMario

unread,
Feb 12, 2012, 11:24:01 AM2/12/12
to TiddlyWiki
> I have uploaded a MTC (Minimal Testcase) to my dropbox:http://dl.dropbox.com/u/2040050/group/2012.02.12_markdown.html
Hi Tobias,
What did happen to the markdown markers? Version, Source ...
This seems to be a "hack", without changing the plugin header ????
match: "§§§",

-m

anyfo...@gmail.com

unread,
Feb 12, 2012, 11:24:59 AM2/12/12
to TiddlyWiki
thanks for the plugin !

when I tagged the tiddler with "MarkdownFormat" it would follow the
markdown syntax and ignore the original syntax which expected.
but how can I insert a link referring to other tiddler ? Is there a
way to do that ?

Regards

Forest


On Feb 11, 5:40 am, sewpafly <brent....@gmail.com> wrote:
> I actually took a minute and got Markdown working as a stand alone
> formatter.
>
> If you're interested, it requires 2 tiddlers:http://showdown.tiddlyspace.com/#ShowDown.jshttp://sewpafly.tiddlyspace.com/#Markdown

Tobias Beer

unread,
Feb 12, 2012, 3:42:51 PM2/12/12
to TiddlyWiki
No idea. Maybe they got eaten by dropbox?!? Weird, if I open the wiki
locally, it's all good. Huh?!?

tb
> match: "§§§",
>
> -m

sewpafly

unread,
Feb 13, 2012, 11:40:34 AM2/13/12
to TiddlyWiki
@Tobias, thanks for pointing that out (and thanks for your original
plugin as well, I've been using it for months!). Anyways, I updated
it (0.1.1) and now it looks like you can include Markdown tagged
tiddlers into other tiddlers, and fixed it so the title shows up in
the sidebar as well.

@pmario, thanks for pointing those errors out as well. Both have been
corrected.

Thanks again.

@Forest - I haven't figured that out yet. (If anyone can help, it
would be appreciated)

Jeremy Ruston

unread,
Feb 13, 2012, 12:58:51 PM2/13/12
to tiddl...@googlegroups.com
> Did you change the showdown.js file or something else?

The code just does some postprocessing to the links that showdown.js generates:

html.find("a").each(function(i) {
$(this).addClass("tw_macro").attr("data-tw-macro","link").attr("data-tw-params",$(this).attr("href"));
});

Cheers

Jeremy

Wordius

unread,
Feb 14, 2012, 11:49:51 AM2/14/12
to TiddlyWiki
> I'd love to get some feedback on if any one else finds this useful or
> finds any problems with it.

Brilliant.

Works perfectly as far as I can tell in FF 3.6.10 on a Mac running OS
X Lion 10.7.2.

sewpafly

unread,
Feb 14, 2012, 3:59:05 PM2/14/12
to TiddlyWiki
On Feb 12, 8:24 am, "anyform...@gmail.com" <anyform...@gmail.com>
wrote:
> how can I insert a link referring to other tiddler ? Is there a
> way to do that ?

Okay, I figured it out: With the latest version (1.0.2), create a link
like this: [this is the link](#[[MyTiddler]]) (The brackets are
optional).

Wordius

unread,
Feb 15, 2012, 5:13:28 AM2/15/12
to TiddlyWiki
> Okay, I figured it out: With the latest version (1.0.2), create a link
> like this: [this is the link](#[[MyTiddler]]) (The brackets are
> optional).

Can't get this to work. Using the formatting you describe produces
what looks like a link, but it does't open the Tiddler it refers to.
It's like a 'href="#"'.

If it's relevant, on a typical Tiddler link using the default TW
stylesheet and where MD is not used, the resulting link is **bold**.
The link resulting from the suggested formatting in an MD-styled
Tiddler is not bold.

Wordius

unread,
Feb 15, 2012, 6:40:15 AM2/15/12
to TiddlyWiki
> Okay, I figured it out: With the latest version (1.0.2), create a link
> like this: [this is the link](#[[MyTiddler]]) (The brackets are
> optional).


Ignore my earlier message. Things move fast around here.

I assumed the MarkDown plugin I installed yesterday was current. Now
I've updated to 1.0.2, your method works fine.


Alen Šiljak

unread,
Feb 17, 2015, 7:39:08 AM2/17/15
to tiddl...@googlegroups.com
Links in the format [text](#[[MyTiddler]]) don't work with the double square brackets. Standard Markdown links [text](#MyTiddler) work.

However, I was hoping Markdown links would be recognised as references when looking at "what points here" references in the Info panel. Unfortunately, they are not.

Is there any workaround?
Reply all
Reply to author
Forward
0 new messages