Package: tiddlywebplugins.markdown
# IntroA [TiddlyWeb](http://tiddlyweb.com/) plugin to render markdownsyntax wikitext to HTML using the[Python Markdown](https://github.com/waylan/Python-Markdown) library.The source repository is available[on GitHub](https://github.com/tiddlyweb/tiddlywebplugins.markdown).# FeaturesIf `markdown.wiki_link_base` is set in[instance](http://tiddlyweb.tiddlyspace.com/instance) config, thenTiddlyWeb oriented features are turned on (see below),otherwise the text is treated as straight Markdown.By default HTML in user input is escaped. If different behavioris desired set `markdown.safe_mode` in config to one of the valuesdescribed in the [Python-Markdowndocumentation](http://pythonhosted.org/Markdown/reference.html#safe_mode):"replace", "escape", "remove" of `False`.Additional Markdown extensions can be activated via the `markdown.extensions`configuration settings, which is a tuple of two items: A list of extension namesand a dictionary with configuration settings.By default some extensions are included:* `fenced_code`: http://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html* `def_list`: http://pythonhosted.org/Markdown/extensions/definition_lists.html* `foootnotes`: http://pythonhosted.org/Markdown/extensions/footnotes.html* `headerid`: http://pythonhosted.org/Markdown/extensions/header_id.htmlThe TiddlyWeb features add the following:* `wikilinks`: CamelCase* `freelinks`: [[some page]]* `labeled freelinks`: [[label|some page]]* `transclusion`: see belowWikilinks and freelinks will be prefixed by `wiki_link_base`.Set it to '' (emptry string) to activate the features without any prefix.Transclusion uses the following syntax:```{{tiddler title}}```That will include tiddler with the given title from thecurrent context (recipe or bag) of the transcluding tiddler.Links and transclusion can be augmented with `@target` syntax:* `@target`* `CamelCase@target`* `[[some page]]@target`* `[[label|some page]]@target`* `{{tiddler title}}@target``target` is resolved via three different configuration settings:* `markdown.interlinker` names a function which returns a linkto whatever might be considered a target of some kind. It'sarguments are a WSGI environ and a string representing thetarget. It returns a URI for the target, without the titleof the tiddler.* `markdown.target_resolver` names a function which determinesthe tiddler object that is to be transcluded. It's argumentsare a WSGI environ, a string representing the context fromwhich a tiddler is being transcluded and a tiddler object.That tiddler object is modified in place to add the bag inwhich it can be found.* `markdown.transclude_url` names a function which returns alink to a tiddler in a target context. It's arguments are aWSGI environ and a tiddler. It returns a URI for the tiddlerthat has been transcluded. This is useful for augmenting theoutput to include a link to the transcluded tiddler.If the desired target contains spaces, wrap the target in [[ ]], forexample:[[my page]]@[[my bag]]To use this renderer on Tiddlers which have a type of`text/x-markdown` adjust[tiddlywebconfig.py](http://tiddlyweb.tiddlyspace.com/tiddlywebconfig.py)to include:```'wikitext.type_render_map' :{'text/x-markdown': 'tiddlywebplugins.markdown'}```If you want all tiddlers with no type to be rendered as markdown,then set```'wikitext.default_renderer': 'tiddlywebplugins.markdown'```# InstallationAvailable from [PyPi](https://pypi.python.org/pypi/tiddlywebplugins.markdown),install with [pip](https://pypi.python.org/pypi/pip):```pip install -U tiddlywebplugins.markdown```# OtherCopyright 2009-2014 Chris Dent <cdent@peemore.com>Licensed under the same BSD license as TiddlyWebhttp://tiddlyweb.com/