automatically generate screenshots #101

Open
opened 2023-12-02 08:25:40 +00:00 by jessebot · 2 comments
jessebot commented 2023-12-02 08:25:40 +00:00 (Migrated from github.com)

Describe the feature you'd like, and why

I'd like a way to automatically generate screenshots for the CLI help, as well as all the TUI screens here:
https://github.com/small-hack/smol-k8s-lab/tree/main/docs/images/screenshots

We can generate the screenshots with rich and textual. We have a hidden feature in smol-k8s-lab for rich here:
small-hack/smol-k8s-lab@f753dda743/smol_k8s_lab/utils/rich_cli/help_text.py (L16)

and here:
small-hack/smol-k8s-lab@f753dda743/smol_k8s_lab/utils/rich_cli/help_text.py (L130-L132)

We should expose that via the cli, and also add textual screenshots in there as well, as right now, I actually manually generate each of those screenshots and with the amount of screens we support, this is getting a bit too time consuming.

## Describe the feature you'd like, and why I'd like a way to automatically generate screenshots for the CLI help, as well as all the TUI screens here: https://github.com/small-hack/smol-k8s-lab/tree/main/docs/images/screenshots We can generate the screenshots with rich and textual. We have a hidden feature in smol-k8s-lab for rich here: https://github.com/small-hack/smol-k8s-lab/blob/f753dda743178b716875cfd00996ba598607a85a/smol_k8s_lab/utils/rich_cli/help_text.py#L16 and here: https://github.com/small-hack/smol-k8s-lab/blob/f753dda743178b716875cfd00996ba598607a85a/smol_k8s_lab/utils/rich_cli/help_text.py#L130-L132 We should expose that via the cli, and also add textual screenshots in there as well, as right now, I actually manually generate each of those screenshots and with the amount of screens we support, this is getting a bit too time consuming.
jessebot commented 2023-12-02 12:50:27 +00:00 (Migrated from github.com)

Ran into a minor snag where the screenshot file name is not predictable, so I've opened https://github.com/Textualize/textual/issues/3795 to kindly ask if this is a feature that can be implemented. In the meantime, I think I can only automate the smol-k8s-lab --help screenshot since rich already provides a way to name the screenshot.

Ran into a minor snag where the screenshot file name is not predictable, so I've opened https://github.com/Textualize/textual/issues/3795 to kindly ask if this is a feature that can be implemented. In the meantime, I think I can only automate the `smol-k8s-lab --help` screenshot since rich already provides a way to name the screenshot.
jessebot commented 2023-12-03 18:12:33 +00:00 (Migrated from github.com)

Created an env var to set to generate the --help docs:
small-hack/smol-k8s-lab@f61a92d51a/smol_k8s_lab/utils/rich_cli/help_text.py (L18)

davep linked me their useful blog post:
https://blog.davep.org/2023/07/03/making-my-github-banner.html

I've been using it to write a script for our ci jobs:
https://github.com/small-hack/smol-k8s-lab/blob/main/smol_k8s_lab/tui/make_screenshots.py

Also learned about the testing guide 🤯 very useful and makes testing less scary :
https://textual.textualize.io/guide/testing/#snapshot-testing

Created an env var to set to generate the `--help` docs: https://github.com/small-hack/smol-k8s-lab/blob/f61a92d51a453c65f2ae3c9119644d90f53c3fe2/smol_k8s_lab/utils/rich_cli/help_text.py#L18 davep linked me their useful blog post: https://blog.davep.org/2023/07/03/making-my-github-banner.html I've been using it to write a script for our ci jobs: https://github.com/small-hack/smol-k8s-lab/blob/main/smol_k8s_lab/tui/make_screenshots.py Also learned about the testing guide 🤯 very useful and makes testing less scary : https://textual.textualize.io/guide/testing/#snapshot-testing
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
small-hack/smol-k8s-lab#101
No description provided.