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


Python states.Inliner方法代码示例

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


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

示例1: __call__

# 需要导入模块: from docutils.parsers.rst import states [as 别名]
# 或者: from docutils.parsers.rst.states import Inliner [as 别名]
def __call__(
        self,
        name: str,
        rawtext: str,
        text: str,
        lineno: int,
        inliner: Inliner,
        options: Mapping[str, Any] = MappingProxyType({}),
        content: Sequence[str] = (),
    ):
        url = self.url_template.format(text)
        title = self.title_template.format(text)
        options = {**dict(classes=[self.class_name],), **options}
        node = nodes.reference(rawtext, title, refuri=url, **options)
        return [node], [] 
开发者ID:theislab,项目名称:scanpy,代码行数:17,代码来源:github_links.py

示例2: _parse

# 需要导入模块: from docutils.parsers.rst import states [as 别名]
# 或者: from docutils.parsers.rst.states import Inliner [as 别名]
def _parse(self, line):
        """
        Parses a single line/string for inline rst statements, like strong, emphasis, literal, ...

        :param line: string to parse
        :return: nodes
        """
        inline_parser = Inliner()
        inline_parser.init_customizations(self.doc_settings)
        result, message = inline_parser.parse(line, 0, self.doc_memo, self.dummy_doc)
        if message:
            raise SphinxNeedLayoutException(message)
        return result 
开发者ID:useblocks,项目名称:sphinxcontrib-needs,代码行数:15,代码来源:layout.py

示例3: reset

# 需要导入模块: from docutils.parsers.rst import states [as 别名]
# 或者: from docutils.parsers.rst.states import Inliner [as 别名]
def reset(self, document, parent, level):
        """Reset the state of state machine.

        After reset, self and self.state can be used to
        passed to docutils.parsers.rst.Directive.run

        Parameters
        ----------
        document: docutils document
            Current document of the node.
        parent: parent node
            Parent node that will be used to interpret role and directives.
        level: int
            Current section level.
        """
        self.language = languages.get_language(
            document.settings.language_code)
        # setup memo
        self.memo.document = document
        self.memo.reporter = document.reporter
        self.memo.language = self.language
        self.memo.section_level = level
        # setup inliner
        if self.memo.inliner is None:
            self.memo.inliner = Inliner()
            self.memo.inliner.init_customizations(document.settings)
        inliner = self.memo.inliner
        inliner.reporter = document.reporter
        inliner.document = document
        inliner.language = self.language
        inliner.parent = parent
        # setup self
        self.document = document
        self.reporter = self.memo.reporter
        self.node = parent
        self.state.runtime_init()
        self.input_lines = document['source'] 
开发者ID:readthedocs,项目名称:recommonmark,代码行数:39,代码来源:states.py


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