1
0
forked from clan/clan-core

api: clan Modules add readme content

This commit is contained in:
Johannes Kirschbauer 2024-07-02 11:45:48 +02:00
parent 58b9e5e66e
commit 5ab22d043d
Signed by: hsjobeki
SSH Key Fingerprint: SHA256:vX3utDqig7Ph5L0JPv87ZTPb/w7cMzREKVZzzLFg9qU
3 changed files with 13 additions and 7 deletions

View File

@ -1,4 +1,13 @@
---
description = "Efficient, deduplicating backup program with optional compression and secure encryption."
categories = ["backup"]
---
---
BorgBackup (short: Borg) gives you:
- Space efficient storage of backups.
- Secure, authenticated encryption.
- Compression: lz4, zstd, zlib, lzma or none.
- Mountable backups with FUSE.
- Easy installation on multiple platforms: Linux, macOS, BSD, ...
- Free software (BSD license).
- Backed by a large and active open source community.

View File

@ -1,4 +1,3 @@
import argparse
import json
import re
import tomllib
@ -81,6 +80,7 @@ class ModuleInfo:
description: str
categories: list[str] | None
roles: list[str] | None
readme: str | None = None
def get_modules(base_path: str) -> dict[str, str]:
@ -142,9 +142,5 @@ def show_module_info(base_path: str, module_name: str) -> ModuleInfo:
description=frontmatter.description,
categories=frontmatter.categories,
roles=get_roles(module_path),
readme=readme_content,
)
def command(args: argparse.Namespace) -> None:
res = show_module_info(args.flake, args.module_name)
print(res)

View File

@ -24,3 +24,4 @@ def test_modules_details(test_flake_with_core: FlakeForTest) -> None:
assert module_info.categories and "backup" in module_info.categories
assert module_info.roles
assert set(module_info.roles) == {"server", "client"}
assert module_info.readme is not None and module_info.readme != ""