Skip to content
This repository was archived by the owner on Jun 5, 2018. It is now read-only.

padawanphysicist/tw5-mathdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TW5-Mathdown - Math + Markdown in TiddlyWiki5

I have modified the official Markdown plugin of TiddlyWiki5 to use markdown-it as Markdown parser, use MathML for (La)TeX equations (using TeXZilla converter). This is an unofficial plugin, although I think it follows the general policy of TiddlyWiki.

As this plugin is in an EXPERIMENTAL stage, it may have some (lots of) bugs. If you are brave enough to give it a try, don't hesitate reporting bugs and raising issues on the project page on GitHub or GitLab.

Why another Markdown plugin?

The official TiddlyWiki5 Markdown plugin uses markdown-js, which gets the tiddler text and outputs what it seem to be a JsonML tree, which is then used by TiddlyWiki.

However, for my purposes I had the following issues with markdown-js:

The first issue is particularly important for me, as I would like to include MathML code together with Markdown.

This plugin breaks the parsing process into steps,

text → Escape tags → Math parsing → Markdown parsing → Preview,

and Markdown parsing is done by the following steps:

  1. Parse markdown code into an HTML string,
  2. Turn HTML string into a Json-like array,
  3. Pass resulting array to TiddlyWiki to be rendered.

With this parsing process it is possible to use any parser which outputs an HTML string.

In particular, markdown-it parser solved my issues with markdown-js, it has additional extensions to Markdown, and it seems to have a more configurable syntax extension, as you can add new rules and replace existing ones.

MathML Support

Not all browsers have support for MathML. As far as I know, Firefox has the most complete native support.

In those cases, it is still possible using this plugin by installing MathJax plugin for TiddlyWiki5, so that MathML rendering will be done by MathJax, and not the browser. I tested this approach on Firefox, Chrome and Opera, and it worked quite well.

Creating WikiLinks

In order to create wiki links, you can use the usual Markdown link syntax targeting # and the target tiddler title:

[link text](#TiddlerTitle)

Creating Math

The math delimiters implemented so far are $...$ for inline equations, and \begin{equation}...\end{equation} and \[...\] for displayed equations.

About

Adds math support to TiddlyWiki5 using TeXZilla

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published