deliverance/xslt编译器的服务器
dv.xdvserver的Python项目详细描述
XDV已重命名为Diazo等价的wsgi中间件是diazo包的一部分。有关详细信息,请访问Diazo website或Diazo PyPI page。
简介
xdvserver是一个简单的WSGI中间件,它可以执行两个 分步编译并运行xdv的xslt转换。
它需要两个必需的参数:
- rules: a path to a file containing Deliverance rules
- theme: a URI or path to a theme HTML file
此外,它还可以使用几个可选参数:
- absolute_prefix: if given, relative urls in the theme file will be made
- into absolute links with this prefix.
- notheme: a set of regular expression patterns (or just simple names) that
- will be matched against the incoming path to allow the theme to be switched off for some paths. Multiple patterns should be separated by newlines.
- live: set to True to recompile the theme on each request, rather than on
- startup only.
- compiler: a path to the XSLT file that can turn theme+rules into a compiled
- theme. The default, bundled version will probably suffice in most cases.
- boilerplate: a path to the XSLT file that contains boilerplate XSLT
- instructions. The default, bundled version will probably suffice in most cases.
配置
您可以在粘贴部署管道中使用此中间件。下面是一个例子 在其上运行plone站点的应用程序的配置文件 http://localhost:8080/demo静态资源从/静态:
[server:main] use = egg:Paste#http host = 127.0.0.1 port = 5000 [composite:main] use = egg:Paste#urlmap /static = static / = default [app:static] use = egg:Paste#static document_root = %(here)s/static [pipeline:default] pipeline = egg:Paste#cgitb egg:Paste#httpexceptions theme.default zope.proxy [filter:theme.default] use = egg:dv.xdvserver#xdv theme = %(here)s/static/index.html rules = %(here)s/static/rules/default.xml notheme = /emptypage [app:zope.proxy] use = egg:Paste#proxy address = http://localhost:8080/VirtualHostBase/http/localhost:5000/demo/VirtualHostRoot/
更改日志
1.0b8-2010年8月22日
- 使用lxml.html.tostring而不是lxml.tostring输出到 避免使用空标记,如<;script/>;,这会混淆浏览器 [汤姆斯特]
1.0b7-2010年8月19日
- 使用lxml进行web解析。 [埃尔罗]
- 删除xdvcompiler.py(现在在xdv中) [埃尔罗]
- 应用Lukas Zdych的补丁修复绝对前缀。 [选项]
- 通过规则文件的web解析添加。 [马歇尔·斯科西奥]
1.0b6-2009年10月27日
- 更新的xdv编译器 [欠]
1.0b5-2009年10月12日
- 重新获得BSD许可。 [选项]
- 添加了对extrauri参数的支持。 [马托斯霍拉]
1.0b4-2009年3月30日
- 将“theme-uri”参数重命名为“theme”,因为它还允许 文件名。 [选项]
- 添加了对通过“notheme”选项声明一些非限定URL的支持, 基于模式修补。 [选项]
- 修复了与windows相关的各种错误。 [选项]
1.0b3-2009-03-26
- 我们现在允许本地文件路径作为主题uri,并让compiler.xsl选择 默认情况下,它自己的boilerplate.xsl(如果没有给出)。 [选项]
1.0b2-2009-02-25
- 添加了用于脱机编译主题的控制台脚本 [选项]
1.0b1-2009-02-24
- 初始版本