Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #339 from gratipay/mistune
Browse files Browse the repository at this point in the history
Replace misaka with mistune
  • Loading branch information
chadwhitacre committed Sep 12, 2015
2 parents 4003477 + 30e10fc commit 957ad7b
Show file tree
Hide file tree
Showing 10 changed files with 519 additions and 740 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ python := "$(shell { command -v python2.7 || command -v python; } 2>/dev/null)"
# NOTE: Creating a virtualenv on Windows places binaries in the 'Scripts' directory.
bin_dir := $(shell $(python) -c 'import sys; bin = "Scripts" if sys.platform == "win32" else "bin"; print(bin)')
env_bin := env/$(bin_dir)
venv := "./vendor/virtualenv-1.9.1.py"
venv := "./vendor/virtualenv-12.0.7.py"

env:
$(python) $(venv)\
--unzip-setuptools \
--prompt="[inside.gratipay.com] " \
--never-download \
--extra-search-dir=./vendor/ \
--distribute \
./env/
./$(env_bin)/pip --version
./$(env_bin)/pip install -f file:///$(PWD)/vendor -r requirements.txt
Expand Down
17 changes: 11 additions & 6 deletions gfm.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
from __future__ import absolute_import, division, print_function, unicode_literals

import misaka
import mistune
from mistune_contrib.toc import TocMixin
from aspen_jinja2_renderer import Renderer as Jinja2Renderer, Factory as Jinja2Factory


# setup Markdown rendering, with anchors for headers
class TocRenderer(TocMixin, mistune.Renderer):
pass
toc = TocRenderer()
markdown = mistune.Markdown(renderer=toc)


def gfm(md):
html = misaka.html( md
, misaka.EXT_STRIKETHROUGH | misaka.EXT_AUTOLINK | misaka.EXT_FENCED_CODE | \
misaka.EXT_TABLES
, misaka.HTML_SMARTYPANTS | misaka.HTML_TOC
)
toc.reset_toc()
html = markdown( md )
return html


Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ aspen-jinja2==0.3

simplejson==2.3.2

misaka==1.0.2
mistune==0.7.1
mistune_contrib==0.1

honcho==0.5.0

Expand Down
Binary file removed vendor/misaka-1.0.2.tar.gz
Binary file not shown.
Binary file added vendor/mistune-0.7.1-py2.py3-none-any.whl
Binary file not shown.
Binary file added vendor/mistune_contrib-0.1-py2.py3-none-any.whl
Binary file not shown.
Binary file removed vendor/pip-1.0.2.tar.gz
Binary file not shown.
Binary file added vendor/pip-7.1.2-py2.py3-none-any.whl
Binary file not shown.
Binary file added vendor/setuptools-18.3.1-py2.py3-none-any.whl
Binary file not shown.
Loading

0 comments on commit 957ad7b

Please sign in to comment.