How to use the mkdocs.config.load_config function in mkdocs

To help you get started, we’ve selected a few mkdocs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github restaction / mkdocs-autodoc / mkdocs_autodoc / __init__.py View on Github external
def patched_build(f, config, *args, **kwargs):
    print("HACK".center(60, "-"))
    real_config = load_config(config_file=None)
    for k in ["theme", "theme_dir"]:
        config[k] = real_config[k]
    return f(config, *args, **kwargs)
github mkdocs / mkdocs / mkdocs / main.py View on Github external
"""
    Build the documentation, and optionally start the devserver.
    """
    configure_logging(options)
    clean_site_dir = 'clean' in options
    if cmd == 'serve':
        config = load_config(options=options)
        serve(config, options=options)
    elif cmd == 'build':
        config = load_config(options=options)
        build(config, clean_site_dir=clean_site_dir)
    elif cmd == 'json':
        config = load_config(options=options)
        build(config, dump_json=True, clean_site_dir=clean_site_dir)
    elif cmd == 'gh-deploy':
        config = load_config(options=options)
        build(config, clean_site_dir=clean_site_dir)
        gh_deploy(config)
    elif cmd == 'new':
        new(args, options)
    else:
        print('MkDocs (version {0})'.format(__version__))
        print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')
github mkdocs / mkdocs / mkdocs / main.py View on Github external
def main(cmd, args, options=None):
    """
    Build the documentation, and optionally start the devserver.
    """
    configure_logging(options)
    clean_site_dir = 'clean' in options
    if cmd == 'serve':
        config = load_config(options=options)
        serve(config, options=options)
    elif cmd == 'build':
        config = load_config(options=options)
        build(config, clean_site_dir=clean_site_dir)
    elif cmd == 'json':
        config = load_config(options=options)
        build(config, dump_json=True, clean_site_dir=clean_site_dir)
    elif cmd == 'gh-deploy':
        config = load_config(options=options)
        build(config, clean_site_dir=clean_site_dir)
        gh_deploy(config)
    elif cmd == 'new':
        new(args, options)
    else:
        print('MkDocs (version {0})'.format(__version__))
        print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')
github mkdocs / mkdocs / mkdocs / main.py View on Github external
def main(cmd, args, options=None):
    """
    Build the documentation, and optionally start the devserver.
    """
    configure_logging(options)
    clean_site_dir = 'clean' in options
    if cmd == 'serve':
        config = load_config(options=options)
        serve(config, options=options)
    elif cmd == 'build':
        config = load_config(options=options)
        build(config, clean_site_dir=clean_site_dir)
    elif cmd == 'json':
        config = load_config(options=options)
        build(config, dump_json=True, clean_site_dir=clean_site_dir)
    elif cmd == 'gh-deploy':
        config = load_config(options=options)
        build(config, clean_site_dir=clean_site_dir)
        gh_deploy(config)
    elif cmd == 'new':
        new(args, options)
    else:
        print('MkDocs (version {0})'.format(__version__))
        print('mkdocs [help|new|build|serve|gh-deploy|json] {options}')
github SAP / vulnerability-assessment-tool / docs / docs.py View on Github external
def handle_mkdocs_ghdeploy(to_ghdeploy, kind, remote):
    if to_ghdeploy:
        delete_branch('gh-pages')
        cfg = config.load_config(
            config_file=os.path.join(CWD, select_config(kind)),
            remote_name=remote
        )
        build.build(cfg)
        print('Deploying {} Github Pages to {}#gh-pages'.format(kind, remote))
        gh_deploy.gh_deploy(cfg, force=True)