From 401d90ed9f087e43d7fa00213d50cffeb99ceef8 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 23 Aug 2025 21:20:39 +0200 Subject: g2h: basic program setup --- .gitignore | 2 ++ g2h/cli.py | 16 ++++++++++++++++ mise.toml | 12 ++++++++++++ requirements.txt | 1 + 4 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 g2h/cli.py create mode 100644 mise.toml create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f2e848 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +__pycache__/ diff --git a/g2h/cli.py b/g2h/cli.py new file mode 100644 index 0000000..e7c66fc --- /dev/null +++ b/g2h/cli.py @@ -0,0 +1,16 @@ +import argparse + +def parse_args(): + parser = argparse.ArgumentParser( + prog='g2h', + description='Convert a git repository into markdown files Hugo can understand.') + parser.add_argument('repo-path', help='Path to the root of git repository') + parser.add_argument('out-dir', help='Path to where the generated files should be stored') + + return parser.parse_args() + +def main(): + args = parse_args() + +if __name__ == '__main__': + main() diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..9358152 --- /dev/null +++ b/mise.toml @@ -0,0 +1,12 @@ +[env] +_.python.venv = { path = ".venv", create = true, python = "3.13.5" } + +[tasks.install] +description = "Install dependencies" +alias = "i" +run = "pip install -r requirements.txt" + +[tasks.run] +description = "Run g2h with the test repo" +alias = "r" +run = "python3 -m g2h.cli" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f7c9608 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Jinja2==3.1.6 -- cgit v1.2.3