From 44c37f84e606cd00733502c049ce20610b96a041 Mon Sep 17 00:00:00 2001 From: SpookyDervish Date: Tue, 17 Mar 2026 21:48:17 +1100 Subject: [PATCH] bumped version number, fixed back button, build command struct docs --- dig/build.py | 15 ++++++++++++++- dig/docs.py | 5 ++++- dig/main.py | 2 +- setup.py | 2 +- test.grnd | 4 ---- 5 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 test.grnd diff --git a/dig/build.py b/dig/build.py index 8b15d86..b3b49af 100644 --- a/dig/build.py +++ b/dig/build.py @@ -105,11 +105,24 @@ def build(args): f.write("```\n") f.write("`Using \"python\" as the syntax highlighting language seems to work well with Ground.`") + with open(os.path.join(docs_folder, "myStruct_struct.md"), "w") as f: + f.write("# -myStruct\n") + f.write("Describe your struct briefly. (Comments are example values)\n\n") + f.write("```python\n") + f.write("struct -myStruct\n") + f.write("\tinit &myField -string # \"example value\"\n") + f.write("\tinit &myField2 -int # 1234\n") + f.write("\tinit &myField3 -bool # true\n") + f.write("endstruct\n") + f.write("```") + with open(os.path.join(build_dir, "SUMMARY.md"), "w") as f: f.write("# mylib\n") f.write("Introduce your module here!\n\nThis file will serve as an index page for all your docs.\n\n") - f.write("## Subtitle (use this for categories)\n") + f.write("## Functions\n") f.write("- [mylib_MyFunction](docs/my_function.md)\n\n") + f.write("## Structs\n") + f.write("- [-myStruct](docs/myStruct_struct.md)\n\n") f.write("## Changelog\n") f.write("### v0.0.1 (latest)\n") f.write("- Initial release.\n") diff --git a/dig/docs.py b/dig/docs.py index afdd5e6..c94355c 100644 --- a/dig/docs.py +++ b/dig/docs.py @@ -55,13 +55,16 @@ class DocsApp(App): async def on_button_pressed(self, event: Button.Pressed): if event.button.id == "back": await self.query_one(MarkdownViewer).back() + + async def on_ready(self): + await self.query_one(MarkdownViewer).go(self.inital_markdown_path) def compose(self) -> ComposeResult: with open(self.inital_markdown_path, "r") as f: markdown = f.read() yield Header() - yield MarkdownViewer(markdown) + yield MarkdownViewer("") with Horizontal(id="bottom"): yield Button(label="Back", id="back", flat=True, variant="error") diff --git a/dig/main.py b/dig/main.py index d7ec26e..efcb09a 100644 --- a/dig/main.py +++ b/dig/main.py @@ -12,7 +12,7 @@ from .build import build def parse_arguments(): # create our subcommands and args - arg_parser = argparse.ArgumentParser(prog="Digpkg", description="The package manager for the Ground programming language.") + arg_parser = argparse.ArgumentParser(prog="Digpkg", description="The package manager for the Ground programming language.", epilog="Version 1.2") sub_parsers = arg_parser.add_subparsers(dest="command") # install command diff --git a/setup.py b/setup.py index e977101..f9428e0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="digpkg", - version="1.1", + version="1.2", packages=find_packages(), install_requires=[ "textual>=7.3.0", diff --git a/test.grnd b/test.grnd deleted file mode 100644 index 7aeefc9..0000000 --- a/test.grnd +++ /dev/null @@ -1,4 +0,0 @@ -extern "math" - -call !math_RandomDouble 1.0 10.0 &var -println $var \ No newline at end of file