Exemplo n.º 1
0
    def run_validation(self, value):
        themes = utils.get_theme_names()

        if value in themes:
            if value in ['obdocs', 'readthedocs']:
                return value

            self.warnings.append(
                ("The theme '{0}' will be removed in an upcoming obdocs"
                ).format(value)
            )
            return value

        raise ValidationError("Unrecognised theme.")
Exemplo n.º 2
0

def common_options(f):
    f = verbose_option(f)
    f = quiet_option(f)
    return f


clean_help = "Remove old files from the site_dir before building"
config_file_help = "Provide a specific obdocs config"
dev_addr_help = ("IP address and port to serve documentation locally (default: "
                 "localhost:8000)")
strict_help = ("Enable strict mode. This will cause obdocs to abort the build "
               "on any warnings.")
theme_help = "The theme to use when building your documentation."
theme_choices = utils.get_theme_names()
site_dir_help = "The directory to output the result of the documentation build."
reload_help = "Enable and disable the live reloading in the development server."
commit_message_help = ("A commit message to use when commiting to the "
                       "Github Pages remote branch")
remote_branch_help = ("The remote branch to commit to for Github Pages. This "
                      "overrides the value specified in config")


@click.group(context_settings={'help_option_names': ['-h', '--help']})
@click.version_option(__version__, '-V', '--version')
@common_options
def cli():
    """
    OBDocs - OpenBazaar Documentation
    """