Example #1
0
def get_conf():
    project_root_dir, conf_file, conf, cached = discover_config_file()

    if cached is True:
        return conf

    conf = schema_migration_0(conf)

    conf_file = crawl_up_tree(conf_file, 2)
    conf.paths.projectroot = os.path.abspath(os.path.join(os.path.dirname(conf_file), '..'))
    conf.system.conf_file = conf_file

    if os.path.exists('/etc/arch-release'):
        conf.system.python = 'python2'
    else:
        conf.system.python = 'python'

    conf.system.processed = AttributeDict()
    conf.system.processed.paths = False
    conf.system.processed.edition = False
    conf.system.processed.project_paths = False
    conf.system.processed.project_conf = False
    conf.system.processed.versions = False

    conf = mangle_configuration(conf)
    conf = render_versions(conf)

    conf.git.branches.current = get_branch()
    conf.git.commit = get_commit()
    conf.project.basepath = get_manual_path(conf)

    conf = render_paths(conf)
    conf = mangle_paths(conf)

    conf.system.dependency_cache = os.path.join(conf.paths.projectroot,
                                                conf.paths.branch_output,
                                                'dependencies.json')


    conf_cache_dir = os.path.join(conf.paths.projectroot, conf.paths.branch_output)
    conf_cache = os.path.join(conf_cache_dir, 'conf-cache.json')

    if not os.path.exists(conf_cache_dir):
        os.makedirs(conf_cache_dir)

    with open(conf_cache, 'w') as f:
        json.dump(conf, f)

    return conf
Example #2
0
def render_paths(conf=None, language=None):
    if is_processed('paths', conf):
        return conf
    else:
        conf = lazy_conf(conf)

        if language is None:
            public_path = 'public'
        else:
            public_path = os.path.join('public', language)

        conf.project.basepath = get_manual_path(conf)
        conf.paths.public = os.path.join(conf.paths.output, public_path)
        conf.paths.branch_output = os.path.join(conf.paths.output, get_branch())
        conf.paths.branch_source = os.path.join(conf.paths.branch_output, 'source')
        conf.paths.branch_staging = os.path.join(conf.paths.public, get_branch())
        conf.paths.buildarchive = os.path.join(conf.paths.output, 'archive')
        conf.paths.global_config = os.path.join(conf.paths.buildsystem, 'data')

        conf.system.processed.paths = True
        return conf
Example #3
0
def render_paths(conf=None, language=None):
    if is_processed('paths', conf):
        return conf
    else:
        conf = lazy_conf(conf)

        if language is None:
            public_path = 'public'
        else:
            public_path = os.path.join('public', language)

        conf.project.basepath = get_manual_path(conf)
        conf.paths.public = os.path.join(conf.paths.output, public_path)
        conf.paths.branch_output = os.path.join(conf.paths.output,
                                                get_branch())
        conf.paths.branch_source = os.path.join(conf.paths.branch_output,
                                                'source')
        conf.paths.branch_staging = os.path.join(conf.paths.public,
                                                 get_branch())
        conf.paths.buildarchive = os.path.join(conf.paths.output, 'archive')
        conf.paths.global_config = os.path.join(conf.paths.buildsystem, 'data')

        conf.system.processed.paths = True
        return conf
Example #4
0
html_domain_indices = True
html_use_index = True
html_split_index = False
html_show_sourcelink = False
html_show_sphinx = True
html_show_copyright = True

manual_edition_path = '{0}/{1}/{2}'.format(conf.project.url,
                                           conf.git.branches.current,
                                           sconf.theme.book_path_base)

html_theme_options = {
    'branch': conf.git.branches.current,
    'pdfpath': dot_concat(manual_edition_path, 'pdf'),
    'epubpath': dot_concat(manual_edition_path, 'epub'),
    'manual_path': get_manual_path(conf),
    'translations': languages,
    'language': language,
    'repo_name': sconf.theme.repo,
    'jira_project': sconf.theme.jira,
    'google_analytics': sconf.theme.google_analytics,
    'project': sconf.theme.project,
    'version': version,
    'version_selector': get_versions(conf),
    'stable': conf.version.stable,
    'sitename': sconf.theme.sitename,
    'nav_excluded': sconf.theme.nav_excluded,
}

html_sidebars = sconf.sidebars
Example #5
0
File: conf.py Project: nopjorn/docs
html_copy_source = False
html_use_smartypants = True
html_domain_indices = True
html_use_index = True
html_split_index = False
html_show_sourcelink = False
html_show_sphinx = True
html_show_copyright = True

manual_edition_path = "{0}/{1}/{2}".format(conf.project.url, conf.git.branches.current, sconf.theme.book_path_base)

html_theme_options = {
    "branch": conf.git.branches.current,
    "pdfpath": dot_concat(manual_edition_path, "pdf"),
    "epubpath": dot_concat(manual_edition_path, "epub"),
    "manual_path": get_manual_path(conf),
    "translations": languages,
    "language": language,
    "repo_name": sconf.theme.repo,
    "jira_project": sconf.theme.jira,
    "google_analytics": sconf.theme.google_analytics,
    "project": sconf.theme.project,
    "version": version,
    "version_selector": get_versions(conf),
    "stable": conf.version.stable,
    "sitename": sconf.theme.sitename,
    "nav_excluded": sconf.theme.nav_excluded,
}

html_sidebars = sconf.sidebars
Example #6
0
html_domain_indices = True
html_use_index = True
html_split_index = False
html_show_sourcelink = False
html_show_sphinx = True
html_show_copyright = True

manual_edition_path = '{0}/{1}/{2}'.format(conf.project.url,
                                           conf.git.branches.current,
                                           sconf.theme.book_path_base)

html_theme_options = {
    'branch': conf.git.branches.current,
    'pdfpath': dot_concat(manual_edition_path, 'pdf'),
    'epubpath': dot_concat(manual_edition_path, 'epub'),
    'manual_path': get_manual_path(conf),
    'translations': languages,
    'language': language,
    'repo_name': sconf.theme.repo,
    'jira_project': sconf.theme.jira,
    'google_analytics': sconf.theme.google_analytics,
    'project': sconf.theme.project,
    'version': version,
    'version_selector': get_versions(conf),
    'stable': conf.version.stable,
    'sitename': sconf.theme.sitename,
    'nav_excluded': sconf.theme.nav_excluded,
}

html_sidebars = sconf.sidebars