diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-08-23 21:20:39 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-08-23 21:20:39 +0200 |
| commit | 401d90ed9f087e43d7fa00213d50cffeb99ceef8 (patch) | |
| tree | d3212528fb14451b4008b4d74913954a7dd445c6 | |
| parent | e3269aa41fd9489ddc22ddc6d17d5832b99c5008 (diff) | |
| download | git2hugo-401d90ed9f087e43d7fa00213d50cffeb99ceef8.tar.gz | |
g2h: basic program setup
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | g2h/cli.py | 16 | ||||
| -rw-r--r-- | mise.toml | 12 | ||||
| -rw-r--r-- | requirements.txt | 1 |
4 files changed, 31 insertions, 0 deletions
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 |