本文整理汇总了Python中aspen.website.Website.renderer_factories['markdown']方法的典型用法代码示例。如果您正苦于以下问题:Python Website.renderer_factories['markdown']方法的具体用法?Python Website.renderer_factories['markdown']怎么用?Python Website.renderer_factories['markdown']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aspen.website.Website
的用法示例。
在下文中一共展示了Website.renderer_factories['markdown']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Website
# 需要导入模块: from aspen.website import Website [as 别名]
# 或者: from aspen.website.Website import renderer_factories['markdown'] [as 别名]
import string
import random
from os.path import basename, dirname
from aspen import Response
from aspen.website import Website
from . import gfm
from .nav import NavItem
website = Website(www_root='www', project_root='.')
# Manually register markdown renderer to work around Heroku deployment woes.
website.renderer_factories['markdown'] = gfm.Factory(website)
website.renderer_factories['jinja2'].Renderer.global_context = {
'range': range,
'unicode': unicode,
'enumerate': enumerate,
'len': len,
'float': float,
'type': type,
'str': str,
}
website.renderer_default = "markdown"
def add_nav_to_website(website):
website.nav = NavItem(website, None, website.www_root, '')