in src/doc_builder/commands/build.py [0:0]
def build_command_parser(subparsers=None):
if subparsers is not None:
parser = subparsers.add_parser("build")
else:
parser = argparse.ArgumentParser("Doc Builder build command")
parser.add_argument("library_name", type=str, help="Library name")
parser.add_argument(
"path_to_docs",
type=str,
help="Local path to library documentation. The library should be cloned, and the folder containing the "
"documentation files should be indicated here.",
)
parser.add_argument("--build_dir", type=str, help="Where the built documentation will be.", default="./build/")
parser.add_argument("--clean", action="store_true", help="Whether or not to clean the output dir before building.")
parser.add_argument("--language", type=str, help="Language of the documentation to generate", default="en")
parser.add_argument(
"--version",
type=str,
help="Version of the documentation to generate. Will default to the version of the package module (using "
"`main` for a version containing dev).",
)
parser.add_argument("--notebook_dir", type=str, help="Where to save the generated notebooks.", default=None)
parser.add_argument("--html", action="store_true", help="Whether or not to build HTML files instead of MDX files.")
parser.add_argument(
"--not_python_module",
action="store_true",
help="Whether docs files do NOT have corresponding python module (like HF course & hub docs).",
)
parser.add_argument(
"--version_tag_suffix",
type=str,
default="src/",
help="Suffix to add after the version tag (e.g. 1.3.0 or main) in the documentation links. For example, the default `src/` suffix will result in a base link as `https://github.com/huggingface/{package_name}/blob/{version_tag}/src/`.",
)
parser.add_argument(
"--repo_owner",
type=str,
default="huggingface",
help="Owner of the repo (e.g. huggingface, rwightman, etc.).",
)
parser.add_argument(
"--repo_name",
type=str,
default=None,
help="Name of the repo (e.g. transformers, pytorch-image-models, etc.). By default, this is the same as the library_name.",
)
if subparsers is not None:
parser.set_defaults(func=build_command)
return parser