define_05_docs

Document Build and Deploy Automation for Python Projects.

class pywf_internal_proprietary.define_05_docs.PyWfDocs[source]

Namespace class for document related automation.

build_doc(real_run: bool = True, verbose: bool = True)[source]

Use sphinx doc to build documentation site locally. It set the necessary environment variables so that the make html command can build the HTML successfully.

Run:

sphinx-build -M html docs/source docs/build
view_doc(real_run: bool = True, verbose: bool = True)[source]

View documentation site built locally in web browser.

It is usually at the ${dir_project_root}/build/html/index.html

Run:

# For MacOS / Linux
open build/html/index.html
# For Windows
start build/html/index.html
deploy_versioned_doc(bucket: str | None = None, prefix: str = 'projects/', aws_profile: str | None = None, real_run: bool = True, verbose: bool = True) bool[source]

Deploy versioned document to AWS S3.

The S3 bucket has to enable static website hosting. The document site will be uploaded to s3://${bucket}/${prefix}${package_name}/${package_version}/

deploy_latest_doc(bucket: str | None = None, prefix: str = 'projects/', aws_profile: str | None = None, real_run: bool = True, verbose: bool = True) bool[source]

Deploy the latest document to AWS S3.

The S3 bucket has to enable static website hosting. The document site will be uploaded to s3://${bucket}/${prefix}${package_name}/latest/

view_latest_doc(bucket: str | None = None, prefix: str = 'projects/', real_run: bool = True, verbose: bool = True)[source]

Open the latest document that hosted on AWS S3 in web browser.

Here’s a sample document site url https://my-bucket.s3.amazonaws.com/my-prefix/my_package/latest/index.html

notebook_to_markdown(real_run: bool = True, verbose: bool = True)[source]

Convert Jupyter notebooks to Markdown files so they can be more efficiently included in the AI knowledge base.