diff --git a/editions/markdowndemo/tiddlers/HelloThere.tid b/editions/markdowndemo/tiddlers/HelloThere.tid index d3722582c..b3b4aea0b 100644 --- a/editions/markdowndemo/tiddlers/HelloThere.tid +++ b/editions/markdowndemo/tiddlers/HelloThere.tid @@ -1,13 +1,34 @@ title: HelloThere -This is a demo of TiddlyWiki5 incorporating a plugin for the [[markdown-js|https://github.com/evilstreak/markdown-js]] Markdown parser from Dominic Baggott. +This is a demo of TiddlyWiki5 incorporating a plugin for the [[markdown-js|https://github.com/evilstreak/markdown-js]] Markdown parser from Dominic Baggott. The MarkdownExample tiddler below is written in Markdown. -The MarkdownExample tiddler below is written in Markdown. Create wiki links with the usual Markdown link syntax targeting `#` and the target tiddler title: +! Installation + +To add the plugin to your own TiddlyWiki5, just drag this link to the browser window: + +[[$:/plugins/tiddlywiki/markdown]] + +! Markdown Dialects + +By default the markdown parser recognises the original dialect of Markdown [[as described by John Gruber|http://daringfireball.net/projects/markdown/]]. An extended dialect called "Maruku" is also included that provides table support and other advanced features. The syntax extensions are modelled on those of [[PHP Markdown Extra|https://michelf.ca/projects/php-markdown/extra/]]. + +The configuration tiddler [[$:/config/markdown/dialect]] determines which dialect is used: + +|!Dialect |!Description | +|Gruber |Standard Markdown | +|Maruku |Extended Maruku Markdown | + + +! Creating ~WikiLinks + +Create wiki links with the usual Markdown link syntax targeting `#` and the target tiddler title: ``` [link text](#TiddlerTitle) ``` +! Images + Markdown image syntax can be used to reference images by tiddler title or an external URI. For example: ``` @@ -15,8 +36,3 @@ Markdown image syntax can be used to reference images by tiddler title or an ext ![alt text](Motovun Jack.jpg "Title") ``` - -To add the plugin to your own TiddlyWiki5, just drag this link to the browser window: - -[[$:/plugins/tiddlywiki/markdown]] - diff --git a/plugins/tiddlywiki/markdown/dialect.tid b/plugins/tiddlywiki/markdown/dialect.tid new file mode 100644 index 000000000..342ace8ff --- /dev/null +++ b/plugins/tiddlywiki/markdown/dialect.tid @@ -0,0 +1,3 @@ +title: $:/config/markdown/dialect + +Gruber \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/wrapper.js b/plugins/tiddlywiki/markdown/wrapper.js index f16456077..2920da1f1 100644 --- a/plugins/tiddlywiki/markdown/wrapper.js +++ b/plugins/tiddlywiki/markdown/wrapper.js @@ -14,6 +14,9 @@ Wraps up the markdown-js parser for use in TiddlyWiki5 var markdown = require("$:/plugins/tiddlywiki/markdown/markdown.js"); +var CONFIG_DIALECT_TIDDLER = "$:/config/markdown/dialect", + DEFAULT_DIALECT = "Gruber"; + function transformNodes(nodes) { var results = []; for(var index=0; index