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


Python Builder.post_process_images方法代码示例

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


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

示例1: post_process_images

# 需要导入模块: from sphinx.builders import Builder [as 别名]
# 或者: from sphinx.builders.Builder import post_process_images [as 别名]
 def post_process_images(self, doctree):
     """Pick the best candidate for an image and link down-scaled images to
     their high res version.
     """
     Builder.post_process_images(self, doctree)
     for node in doctree.traverse(nodes.image):
         scale_keys = ("scale", "width", "height")
         if not any((key in node) for key in scale_keys) or isinstance(node.parent, nodes.reference):
             # docutils does unfortunately not preserve the
             # ``target`` attribute on images, so we need to check
             # the parent node here.
             continue
         uri = node["uri"]
         reference = nodes.reference("", "", internal=True)
         if uri in self.images:
             reference["refuri"] = posixpath.join(self.imgpath, self.images[uri])
         else:
             reference["refuri"] = uri
         node.replace_self(reference)
         reference.append(node)
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:22,代码来源:html.py

示例2: post_process_images

# 需要导入模块: from sphinx.builders import Builder [as 别名]
# 或者: from sphinx.builders.Builder import post_process_images [as 别名]
 def post_process_images(self, doctree):
     """Pick the best candidate for an image and link down-scaled images to
     their high res version.
     """
     Builder.post_process_images(self, doctree)
     for node in doctree.traverse(nodes.image):
         if not node.has_key('scale') or \
            isinstance(node.parent, nodes.reference):
             # docutils does unfortunately not preserve the
             # ``target`` attribute on images, so we need to check
             # the parent node here.
             continue
         uri = node['uri']
         reference = nodes.reference('', '', internal=True)
         if uri in self.images:
             reference['refuri'] = posixpath.join(self.imgpath,
                                                  self.images[uri])
         else:
             reference['refuri'] = uri
         node.replace_self(reference)
         reference.append(node)
开发者ID:APSL,项目名称:django-braces,代码行数:23,代码来源:html.py

示例3: post_process_images

# 需要导入模块: from sphinx.builders import Builder [as 别名]
# 或者: from sphinx.builders.Builder import post_process_images [as 别名]
 def post_process_images(self, doctree):
     Builder.post_process_images(self, doctree)
开发者ID:chadmv,项目名称:sphinx-confluence,代码行数:4,代码来源:__init__.py


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