"GitHub Flavored Markdown" (GFM) for ReText 2.1.5

Asked by Michael Nagel on 2012-10-23

I am using ReText 2.1.5 as it comes bundled with Ubuntu 12.04.
I'd like to know if it is possible to use GFM with this setup.

Alternatively, is it possible to use GFM with the latest release of ReText?
Also, is it possible to run the latest version of ReText without installing (I am a little skeptic about the Python Distutils and where it puts the files and dependencies...)

Question information

English Edit question
ReText Edit question
No assignee Edit question
Solved by:
Dmitry Shachnev
Last query:
Last reply:
Dmitry Shachnev (mitya57) said : #1

You may achieve compatibility with GFM by enabling "nl2br" and "fenced_code" extensions. Simply add this line to ~/.config/ReText project/ReText.conf:

     mdExtensions=nl2br, fenced_code

See http://packages.python.org/Markdown/extensions/ for details.

I would recommend you to upgrade to the latest stable version of ReText, which is available in ppa:mitya57/ppa.

Alternatively, you can use the beta version that is in ppa:mitya57/retext-beta, but its handling of extensions is a bit different — see http://sourceforge.net/p/ReText/wiki/Configuration%20file for details.

Michael Nagel (nailor) said : #2

thanks a lot, i have retext-beta running now with the extensions extra, toc and nl2br.

biggest difference from GFM is that urls are not automatically hyperlinked.
is it possible that urls (like https://launchpad.net ) become hyperlinks automatically?

Best Dmitry Shachnev (mitya57) said : #3

URLs become hyperlinks only if they are wrapped into <> (like <https://launchpad.net>). There is a third-party extension to make unwrapped URLs linked: https://github.com/r0wb0t/markdown-urlize, though I've never tried to use it.

Michael Nagel (nailor) said : #4

For future reference:

I have installed ReText 4.

I have cloned https://github.com/r0wb0t/markdown-urlize to /FOOBAR to use it like this:

$ cat bin/retext
#! /bin/bash
PYTHONPATH=/FOOBAR /usr/bin/retext "$@"

I have the following python-markdown config:

$ cat .config/markdown-extensions.txt

and I have the following retext config:

$ cat .config/ReText\ project/ReText.conf

This setup works for me and is reasonably similar to GFM.
If you are interested, you can put this somewhere in your wiki.

Thank you very much!

Michael Nagel (nailor) said : #5

Thanks Dmitry Shachnev, that solved my question.

Michael Nagel (nailor) said : #6

PS: after cloning markdown-urlize rename the script (urlize.py) to mdx_urlize.py to make things work smoothly.

Dmitry Shachnev (mitya57) said : #7

If you have root access, you could also copy urlize.py to /usr/lib/python3/dist-packages/markdown/ without renaming it or tweaking PYTHONPATH.

Sorry for not mentioning that.