Skip to content

export_docs

CLI command for exporting packaged MADA Tools documentation sources.

ExportDocsCmd

Bases: BaseCmd

Export the packaged MkDocs source project to a local directory.

Source code in mada_tools/cli/commands/export_docs.py
class ExportDocsCmd(BaseCmd):
    """Export the packaged MkDocs source project to a local directory."""

    def add_parser(self, subparsers: ArgumentParser):
        """Add the ``export-docs`` subcommand to the main argument parser.

        Args:
            subparsers: Subparser collection owned by the main CLI parser.
        """
        export_docs_parser: ArgumentParser = subparsers.add_parser(
            "export-docs",
            help="Export the packaged documentation source project.",
            formatter_class=ArgumentDefaultsHelpFormatter,
        )
        export_docs_parser.add_argument(
            "destination",
            help="Directory where the documentation source project will be exported.",
        )
        export_docs_parser.set_defaults(func=self.process_command)

    def process_command(self, args: Namespace):
        """Export packaged documentation sources to the requested destination.

        Args:
            args: Parsed CLI arguments containing the destination path.
        """
        destination = export_docs(args.destination)
        LOG.info("Exported documentation source to %s", destination)

add_parser(subparsers)

Add the export-docs subcommand to the main argument parser.

Parameters:

Name Type Description Default
subparsers ArgumentParser

Subparser collection owned by the main CLI parser.

required
Source code in mada_tools/cli/commands/export_docs.py
def add_parser(self, subparsers: ArgumentParser):
    """Add the ``export-docs`` subcommand to the main argument parser.

    Args:
        subparsers: Subparser collection owned by the main CLI parser.
    """
    export_docs_parser: ArgumentParser = subparsers.add_parser(
        "export-docs",
        help="Export the packaged documentation source project.",
        formatter_class=ArgumentDefaultsHelpFormatter,
    )
    export_docs_parser.add_argument(
        "destination",
        help="Directory where the documentation source project will be exported.",
    )
    export_docs_parser.set_defaults(func=self.process_command)

process_command(args)

Export packaged documentation sources to the requested destination.

Parameters:

Name Type Description Default
args Namespace

Parsed CLI arguments containing the destination path.

required
Source code in mada_tools/cli/commands/export_docs.py
def process_command(self, args: Namespace):
    """Export packaged documentation sources to the requested destination.

    Args:
        args: Parsed CLI arguments containing the destination path.
    """
    destination = export_docs(args.destination)
    LOG.info("Exported documentation source to %s", destination)