Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

from django.utils.translation import ugettext_lazy as _ 

 

from markupmirror import settings 

from markupmirror.markup.base import BaseMarkup 

from markupmirror.markup.base import register_markup 

 

 

class TextileMarkup(BaseMarkup): 

    """Markup transformer for Textile content. 

 

    """ 

    codemirror_mode = 'text/plain' 

    title = _(u"Textile") 

 

    def __init__(self): 

        self.textile_settings = settings.TEXTILE_SETTINGS 

        self.textile = textile 

 

    def convert(self, markup): 

        return self.textile(markup, **self.textile_settings) 

 

 

# Only register if textile is installed 

try: 

    from textile import textile 

    register_markup(TextileMarkup) 

except ImportError: 

    pass 

 

 

__all__ = ('TextileMarkup',)