Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
"""
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}')
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}')
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}')
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)