Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
- *config_file*: The [TOML](https://github.com/toml-lang/toml#toml) formatted
config file you wish to use.
- *message*: The commit message to use when uploading your documentation.
- *force*: Force the push to the repository.
- *ignore_version*: Ignore check that build is not being deployed with an old version.
- *modules*: One or more modules to render reference documentation for
"""
directory = directory if directory else os.getcwd()
project_config = project_configuration(directory, config_file, modules)
with render.documentation_in_temp_folder(project_config):
conf = render._mkdocs_config(project_config["mkdocs"])
conf.config_file_path = directory
mkdocs.commands.gh_deploy.gh_deploy(
conf, message=message, force=force, ignore_version=ignore_version
)
print(logo.ascii_art)
print("Documentation successfully generated and pushed!")
This is powered by [hug](https://github.com/hugapi/hug) which means unless necessary
it should maintain 1:1 compatibility with the programmatic API definition in the
[API module](/reference/portray/api)
- `portray as_html`: Renders the project as HTML into the `site` or other specified output directory
- `portray in_browser`: Runs a server with the rendered documentation pointing a browser to it
- `portray server`: Starts a local development server (by default at localhost:8000)
- `portray project_configuration`: Returns back the project configuration as determined by` portray`
"""
from pprint import pprint
import hug
from portray import api, logo
cli = hug.cli(api=hug.API(__name__, doc=logo.ascii_art))
cli(api.as_html)
cli.output(pprint)(api.project_configuration)
cli(api.server)
cli(api.in_browser)
cli(api.on_github_pages)
- *directory*: The root folder of your project.
- *config_file*: The [TOML](https://github.com/toml-lang/toml#toml)
formatted config file you wish to use.
- *output_dir*: The directory to place the generated HTML into.
- *overwrite*: If set to `True` any existing documentation output will be removed
before generating new documentation. Otherwise, if documentation exists in the
specified `output_dir` the command will fail with a `DocumentationAlreadyExists`
exception.
- *modules*: One or more modules to render reference documentation for
"""
directory = directory if directory else os.getcwd()
render.documentation(
project_configuration(directory, config_file, modules=modules, output_dir=output_dir),
overwrite=overwrite,
)
print(logo.ascii_art)
print(f"Documentation successfully generated into `{os.path.abspath(output_dir)}` !")