2018-01-23 21:24:16 +01:00
|
|
|
#!/usr/bin/env python3
|
2018-02-19 19:50:26 +01:00
|
|
|
#******************************************************************************
|
|
|
|
# Copyright (C) 2018 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
|
|
|
|
# This file is part of the textoutpc project, which is MIT-licensed.
|
|
|
|
#******************************************************************************
|
2018-01-23 21:24:16 +01:00
|
|
|
|
|
|
|
from html import escape as _htmlescape
|
2018-07-28 19:49:29 +02:00
|
|
|
from .. import BlockTag as _BlockTag
|
2018-01-23 21:24:16 +01:00
|
|
|
|
2018-07-28 19:49:29 +02:00
|
|
|
__all__ = ["ShowTag"]
|
2018-01-23 21:24:16 +01:00
|
|
|
|
2018-08-25 17:38:24 +02:00
|
|
|
|
2018-07-28 19:49:29 +02:00
|
|
|
class ShowTag(_BlockTag):
|
2018-01-23 21:24:16 +01:00
|
|
|
""" Tag which shows the HTML code that is produced by textout().
|
|
|
|
Example uses:
|
2018-08-25 17:38:24 +02:00
|
|
|
|
2018-01-23 21:24:16 +01:00
|
|
|
[show][b]hello world![/show]
|
|
|
|
"""
|
|
|
|
|
|
|
|
aliases = ('[show]',)
|
2018-06-22 02:43:31 +02:00
|
|
|
notempty = True
|
2018-02-11 12:01:32 +01:00
|
|
|
superblock = True
|
2018-06-22 01:35:41 +02:00
|
|
|
inlined = True
|
2018-01-24 13:34:13 +01:00
|
|
|
generic = False
|
2018-01-24 12:33:33 +01:00
|
|
|
raw = False
|
2018-01-23 21:24:16 +01:00
|
|
|
|
|
|
|
def preprocess_html(self, content):
|
|
|
|
return _htmlescape(content)
|
|
|
|
|
|
|
|
def begin_html(self):
|
2018-07-29 19:51:42 +02:00
|
|
|
return '<span class="inline-code">'
|
2018-01-23 21:24:16 +01:00
|
|
|
|
|
|
|
def end_html(self):
|
2018-06-22 02:43:31 +02:00
|
|
|
return '</span>'
|
2018-01-23 21:24:16 +01:00
|
|
|
|
|
|
|
# End of file.
|