Traceback (most recent call last):
File "./misaka.py", line 3, in <module>
import misaka as m
File "..test/misaka.py", line 8, in <module>
class HighlighterRenderer(m.HtmlRenderer):
AttributeError: module 'misaka' has no attribute 'HtmlRenderer'
#!/usr/bin/python
#import houdini as h
import misaka as m
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name
class HighlighterRenderer(m.HtmlRenderer):
def blockcode(self, text, lang):
if not lang:
return '\n<pre><code>{}</code></pre>\n'.format(text.strip())
#h.escape_html(text.strip()))
lexer = get_lexer_by_name(lang, stripall=True)
formatter = HtmlFormatter()
return highlight(text, lexer, formatter)
renderer = HighlighterRenderer()
md = m.Markdown(renderer, extensions=('fenced-code',))
print(md("""
Here is some code:
```python
print(123)
More code:
print(123)
"""))
v. 2.0.0 on Arch Linux (AUR PKGBUILD)
Am I missing something ?
Trying the example from the docs I get this:
More code:
"""))