tux.cli.docs
¶
Documentation commands for the Tux CLI.
Functions:
Name | Description |
---|---|
find_mkdocs_config | Find the mkdocs.yml configuration file. |
docs_serve | Serve documentation locally. |
docs_build | Build documentation site. |
Functions¶
find_mkdocs_config() -> str
¶
Find the mkdocs.yml configuration file.
Returns:
Type | Description |
---|---|
str | Path to the mkdocs.yml file |
Source code in tux/cli/docs.py
Python
def find_mkdocs_config() -> str:
"""Find the mkdocs.yml configuration file.
Returns
-------
str
Path to the mkdocs.yml file
"""
current_dir = pathlib.Path.cwd()
# Check if we're in the docs directory
if (current_dir / "mkdocs.yml").exists():
return "mkdocs.yml"
# Check if we're in the root repo with docs subdirectory
if (current_dir / "docs" / "mkdocs.yml").exists():
return "docs/mkdocs.yml"
logger.error("Can't find mkdocs.yml file. Please run from the project root or docs directory.")
return ""
docs_serve() -> int
¶
Serve documentation locally.