当前位置: 首页>>代码示例>>Python>>正文


Python E.meta方法代码示例

本文整理汇总了Python中lxml.html.builder.E.meta方法的典型用法代码示例。如果您正苦于以下问题:Python E.meta方法的具体用法?Python E.meta怎么用?Python E.meta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lxml.html.builder.E的用法示例。


在下文中一共展示了E.meta方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _build_html_head

# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import meta [as 别名]
    def _build_html_head(self):
        '''Add title, metadata, and styles'''
        self.elements.head.append(E.meta(charset='UTF-8'))

        self._build_html_title()

        for key, value in self._default_meta_values:
            self.meta[key] = value

        self._build_html_head_meta()
        self._build_html_head_links()
        self._build_html_stylesheets()
开发者ID:chfoo,项目名称:wuff,代码行数:14,代码来源:html.py

示例2: gen_body_redirect

# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import meta [as 别名]
def gen_body_redirect(code, location):
    from lxml.html.builder import E
    from lxml.html import tostring
    return tostring(E.HTML(
        E.HEAD(
            E.meta(**{
                "http-equiv": "content-type",
                "content": "text/html;charset=utf-8",
            }),
            E.TITLE(code),
        ),
        E.BODY(
            E.H1(code),
            E.P("The document has moved"),
            E.A("here", HREF=location),
            ".",
        )
    ))
开发者ID:1-bit,项目名称:spyne,代码行数:20,代码来源:http.py

示例3: _build_html_head_meta

# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import meta [as 别名]
    def _build_html_head_meta(self):
        '''Builds the meta elements.'''
        head = self.elements.head

        for key, value in self.meta.items():
            head.append(E.meta(name=key, content=value))
开发者ID:chfoo,项目名称:wuff,代码行数:8,代码来源:html.py

示例4: main

# 需要导入模块: from lxml.html.builder import E [as 别名]
# 或者: from lxml.html.builder.E import meta [as 别名]

#.........这里部分代码省略.........
        try:
            json_str = (cmd << json_str)()
        except Exception as error:
            print(repr(error))

        info("Flag Tombstones (end of proofs)")
        cmd = local[str(BIN / "tombstone.hs")]
        subinfo(cmd, "< json > json")
        try:
            json_str = (cmd << json_str)()
        except Exception as error:
            print(repr(error))

        info("Convert Images to SVG Images")
        cmd = local[str(BIN / "svg.hs")]
        subinfo(cmd, "< json > json")
        json_str = (cmd << json_str)()

        info("Generate HTML body from markdown")
        args = ["--email-obfuscation", "none",
                "-f", "json", 
                "--mathjax", 
                "-t", "html5", "--section-divs"]
        cmd = pandoc[args]
        subinfo(cmd, "< json > body")
        pandoc_body_str = (cmd << json_str)()
        pandoc_html = lxml.html.document_fromstring(pandoc_body_str)
        pandoc_body = pandoc_html.cssselect("body")[0]

        info("Generate standalone HTML doc")
        html = HTML.html(HTML.head, HTML.body)
        body = html.cssselect("body")[0]
        head = html.cssselect("head")[0]
        head.append(HTML.meta(charset="utf-8"))
        body.attrib.update(pandoc_body.attrib)
        body.extend(pandoc_body[:])

        # ----------------------------------------------------------------------
        info("Add JQuery")
        head.extend(jquery(standalone=standalone))

        # ----------------------------------------------------------------------
        info("Add Velocity")
        head.extend(velocity(standalone=standalone))

        # ----------------------------------------------------------------------
        info("Add Clipboard.js")
        head.extend(clipboard(standalone=standalone))

        # ----------------------------------------------------------------------
        info("Add Highlight.js")
        head.extend(highlight(standalone=standalone))

        # ----------------------------------------------------------------------
        info("Add Google Fonts support")
        head.extend(google_fonts(["Alegreya", "Alegreya SC"], standalone=standalone))

        # ----------------------------------------------------------------------
        info("Add Mathjax support")
        head.extend(mathjax(standalone=standalone))

        # ----------------------------------------------------------------------
        info("Add Font Awesome support")
        head.extend(font_awesome(standalone=standalone))

        # ----------------------------------------------------------------------
开发者ID:boisgera,项目名称:artdoc,代码行数:70,代码来源:__init__.py


注:本文中的lxml.html.builder.E.meta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。