Skip to content

Commit

Permalink
Configured documentation website for ArmoniK.Admin.CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
AncientPatata committed Jan 22, 2025
1 parent 8e36f05 commit 100a0e0
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/code_docs_gen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
::: armonik_cli.cli

# Core

## Exceptions

::: armonik_cli.core.filters.SemanticError

::: armonik_cli.exceptions.ArmoniKCLIError

::: armonik_cli.exceptions.InternalError

::: armonik_cli.exceptions.InternalArmoniKError

::: armonik_cli.exceptions.NotFoundError


## Decorators

The error handler decorator is supposed to serve as the object where all errors that happen during command execution are routed to. It helps make said errors more presentable.

::: armonik_cli.core.decorators.error_handler

Base command is a decorator that's used for all the commands in the ArmoniK CLI, it includes the error handler.

::: armonik_cli.core.decorators.base_command

## Options

We've created some custom options that simplify the task of writing certain commands.

::: armonik_cli.core.options.MutuallyExclusiveOption


## Filters

The following classes are used for a custom Click parameter type that allows you to filter ArmoniK's objects based on specific conditions.

::: armonik_cli.core.filters.FilterParser

::: armonik_cli.core.filters.FilterTransformer
80 changes: 80 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Installing ArmoniK.Admin.CLI for development :

### Requirements

The CLI requires Python version 3.8 or newer. In order to install the ArmoniK CLI in an isolated environment, you must have python3-venv installed on your machine.

```bash
sudo apt update && sudo apt install python3-venv
```

### Installation

To install the CLI from source, first clone this repository.

```bash
git clone [email protected]/aneoconsulting/ArmoniK.Admin.CLI.git
```

Navigate in the root directory

```bash
cd ArmoniK.Admin.CLI
```

Create and activate the virtual environment

```bash
python -m venv ./venv
source ./venv/bin/activate
```

Perform an editable install of the ArmoniK.Admin.CLI

```bash
pip install -e .
```

### Running tests

We use pytest for unit tests

```bash
pytest tests/
```

### Linting and formatting

Install the development packages

```bash
pip install '.[dev]'
```

Formatting
```bash
ruff format
```

Linting
```bash
ruff check .
```

### Documentation

Install the documentation packages

```bash
pip install '.[docs]'
```

Serving the documentation locally
```bash
mkdocs serve
```

Publishing the documentation to github pages
```bash
mkdocs gh-deploy
```
46 changes: 46 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ArmoniK Admin CLI.

This repository is part of the [ArmoniK](https://github.com/aneoconsulting/ArmoniK) project. It provides a command-line tool to monitor and manage ArmoniK clusters.

## Installation

### Requirements

The CLI requires Python version 3.8 or newer. In order to install the ArmoniK CLI in an isolated environment, you must have python3-venv installed on your machine.

```bash
sudo apt update && sudo apt install python3-venv
```

### Install from source

To install the CLI from source, first clone this repository.

```bash
git clone [email protected]/aneoconsulting/ArmoniK.Admin.CLI.git
```

Navigate in the root directory

```bash
cd ArmoniK.Admin.CLI
```

Create and activate the virtual environment

```bash
python -m venv ./venv
source ./venv/bin/activate
```

Install the CLI in the environment you just created.

```bash
pip install .
```

## Contributing

Contributions are always welcome!

See [CONTRIBUTING](CONTRIBUTING.md) for ways to get started.
1 change: 1 addition & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`armonik -h` is your friend.
30 changes: 30 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
site_name: Armonik Admin CLI
theme: material
nav:
- Home: index.md
- Usage : usage.md
- Development: development.md
- Code Documentation: code_docs_gen.md
repo_url: https://github.com/aneoconsulting/ArmoniK.Admin.CLI/
repo_name: ArmoniK.Admin.CLI
markdown_extensions:
- admonition
- codehilite
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.details
plugins:
- search
- mkdocstrings:
default_handler: python
handlers:
python:
options:
show_symbol_type_toc: true
show_root_full_path: true
show_root_heading: true
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ dev = [
'ruff',
'types-PyYAML',
]
docs = [
'mkdocs',
'mkdocs-material',
'mkdocstrings',
'mkdocstrings-python',
'mkdocs-autorefs',
'mkdocs-material'
]

[project.scripts]
armonik = "armonik_cli.cli:cli"

0 comments on commit 100a0e0

Please sign in to comment.