本文整理汇总了Python中markdown.Markdown.stripTopLevelTags方法的典型用法代码示例。如果您正苦于以下问题:Python Markdown.stripTopLevelTags方法的具体用法?Python Markdown.stripTopLevelTags怎么用?Python Markdown.stripTopLevelTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类markdown.Markdown
的用法示例。
在下文中一共展示了Markdown.stripTopLevelTags方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: markdown
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def markdown(self, input_path, extensions=None):
exts = ['abbr','fenced_code','footnotes','tables','codehilite','smarty','toc', 'attr_list','def_list'] if extensions==None else extensions
style = ",".join(self.__sheets)
styleext = MdStyle(configs={"sheets":[style, "The stylesheet list"]})
exts += [styleext]
md = Markdown(extensions=exts, output_format="html5")
md.stripTopLevelTags = False
md.reset().convertFile(input=input_path, output=input_path + ".html")
示例2: md2node
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def md2node(text):
md = Markdown()
md.serializer = Serializer(md)
md.stripTopLevelTags = False
md.postprocessors = OrderedDict()
md.postprocessors['section'] = SectionPostprocessor()
md.postprocessors['strip'] = StripPostprocessor()
return md.convert(text)
示例3: slack_markdown_converter
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def slack_markdown_converter():
"""
This is a Markdown converter for use with Slack.
"""
md = Markdown(output_format='imtext', extensions=[ExtraExtension(), AnsiExtension()])
md.preprocessors['LinkPreProcessor'] = LinkPreProcessor(md)
md.stripTopLevelTags = False
return md
示例4: slack_markdown_converter
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def slack_markdown_converter(compact_output=False):
"""
This is a Markdown converter for use with Slack.
"""
enable_format('imtext', IMTEXT_CHRS, borders=not compact_output)
md = Markdown(output_format='imtext', extensions=[ExtraExtension(), AnsiExtension()])
md.preprocessors['LinkPreProcessor'] = LinkPreProcessor(md)
md.stripTopLevelTags = False
return md
示例5: borderless_ansi
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def borderless_ansi():
"""This makes a converter from markdown to ansi (console) format.
It can be called like this:
from errbot.rendering import ansi
md_converter = ansi() # you need to cache the converter
ansi_txt = md_converter.convert(md_txt)
"""
md = Markdown(output_format='borderless', extensions=[ExtraExtension(), AnsiExtension()])
md.stripTopLevelTags = False
return md
示例6: text
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def text():
"""This makes a converter from markdown to text (unicode) format.
It can be called like this:
from errbot.rendering import text
md_converter = text() # you need to cache the converter
pure_text = md_converter.convert(md_txt)
"""
from .ansiext import AnsiExtension
md = Markdown(output_format='text', extensions=[ExtraExtension(), AnsiExtension()])
md.stripTopLevelTags = False
return md
示例7: imtext
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def imtext():
"""This makes a converter from markdown to imtext (unicode) format.
imtest is the format like gtalk, slack or skype with simple _ or * markup.
It can be called like this:
from errbot.rendering import imtext
md_converter = imtext() # you need to cache the converter
im_text = md_converter.convert(md_txt)
"""
from .ansiext import AnsiExtension
md = Markdown(output_format='imtext', extensions=[ExtraExtension(), AnsiExtension()])
md.stripTopLevelTags = False
return md
示例8: irc_md
# 需要导入模块: from markdown import Markdown [as 别名]
# 或者: from markdown.Markdown import stripTopLevelTags [as 别名]
def irc_md():
"""This makes a converter from markdown to mirc color format.
"""
md = Markdown(output_format='irc', extensions=[ExtraExtension(), AnsiExtension()])
md.stripTopLevelTags = False
return md