sphinx_.py 文件源码

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

项目:sphinxcontrib-versioning 作者: Robpol86 项目源码 文件源码
def _build(argv, config, versions, current_name, is_root):
    """Build Sphinx docs via multiprocessing for isolation.

    :param tuple argv: Arguments to pass to Sphinx.
    :param sphinxcontrib.versioning.lib.Config config: Runtime configuration.
    :param sphinxcontrib.versioning.versions.Versions versions: Versions class instance.
    :param str current_name: The ref name of the current version being built.
    :param bool is_root: Is this build in the web root?
    """
    # Patch.
    application.Config = ConfigInject
    if config.show_banner:
        EventHandlers.BANNER_GREATEST_TAG = config.banner_greatest_tag
        EventHandlers.BANNER_MAIN_VERSION = config.banner_main_ref
        EventHandlers.BANNER_RECENT_TAG = config.banner_recent_tag
        EventHandlers.SHOW_BANNER = True
    EventHandlers.CURRENT_VERSION = current_name
    EventHandlers.IS_ROOT = is_root
    EventHandlers.VERSIONS = versions
    SC_VERSIONING_VERSIONS[:] = [p for r in versions.remotes for p in sorted(r.items()) if p[0] not in ('sha', 'date')]

    # Update argv.
    if config.verbose > 1:
        argv += ('-v',) * (config.verbose - 1)
    if config.no_colors:
        argv += ('-N',)
    if config.overflow:
        argv += config.overflow

    # Build.
    result = build_main(argv)
    if result != 0:
        raise SphinxError
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号