phpdomain.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:sphinxcontrib-phpdomain 作者: markstory 项目源码 文件源码
def run(self):
        env = self.state.document.settings.env
        modname = self.arguments[0].strip()
        noindex = 'noindex' in self.options
        env.temp_data['php:namespace'] = modname
        env.temp_data['php:class'] = None
        env.domaindata['php']['namespaces'][modname] = (
            env.docname, self.options.get('synopsis', ''),
            'deprecated' in self.options)

        targetnode = nodes.target('', '', ids=['namespace-' + modname],
                                  ismod=True)
        self.state.document.note_explicit_target(targetnode)
        ret = [targetnode]

        # the synopsis isn't printed; in fact, it is only used in the
        # modindex currently
        if not noindex:
            indextext = _('%s (namespace)') % modname
            inode = addnodes.index(entries=[('single', indextext,
                                             'namespace-' + modname, modname, None)])
            ret.append(inode)
        return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号