Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(examples): Add examples readme with gifs #303

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

joshka
Copy link
Member

@joshka joshka commented Jul 9, 2023

This commit adds a readme to the examples directory with gifs of each
example. This should make it easier to see what each example does
without having to run it.

I modified the examples to fit better in the gifs. Mostly this was just
removing the margins, but for the block example I cleaned up the code a
bit to make it more readable.

NOTE!!!!

There are some problems with rendering over ssh, which are not yet resolved. These are noted in the README file. It's possible that these problems are related to #298.

There is a github action that can automatically run VHS as part of a CI process - which would be possibly useful to keep things up to date. https://github.com/charmbracelet/vhs-action

@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Merging #303 (d2b11b1) into main (13fb11a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #303   +/-   ##
=======================================
  Coverage   85.05%   85.05%           
=======================================
  Files          40       40           
  Lines        8590     8590           
=======================================
  Hits         7306     7306           
  Misses       1284     1284           

@orhun
Copy link
Member

orhun commented Jul 15, 2023

Hey, what else is needed to be done here? Do you want me to update the workflow to add vhs-action maybe?

@joshka
Copy link
Member Author

joshka commented Jul 15, 2023

Note the TODOs in the doc. I haven't had a chance to dig into why some of the problems are happening (our side vs vhs side)

examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
@joshka
Copy link
Member Author

joshka commented Jul 15, 2023

In Block.rs, the entire block background should be green and the top two blocks should render similar widths:
image
vs
image

Popup has an issue rendering the background:
Terminal:
image
VHS:
image

Perhaps it would be sufficient to just note that there are rendering issues with VHS (or rewrite the examples to avoid the issues). @orhun given that you are not seeing the same issues, It's possible that there's some sort of difference in rendering on a mac vs on a linux machine due to tty differences and installed fonts - so I'll check there to compare.

@orhun
Copy link
Member

orhun commented Jul 16, 2023

Yeah, it is likely that those problems are mostly about vhs itself so nothing that would be a good idea.

@joshka
Copy link
Member Author

joshka commented Jul 18, 2023

Fixed block, layout and table by changing the examples a bit and updated the README with the new gifs.
Direct link to README

image

image

image

@joshka joshka marked this pull request as ready for review July 18, 2023 11:39
@joshka joshka force-pushed the docs-examples branch 2 times, most recently from 6fda2b8 to d2b11b1 Compare July 19, 2023 03:04
@joshka
Copy link
Member Author

joshka commented Jul 19, 2023

  • Updated the output to point at target/xxx.gif to avoid having to ignore the files.
  • Updated the gauge example to have a border around the last gauge (it doesn't address the issue, just makes it look a little nicer)
  • Fixed the table example
  • Updated the README
  • Added instructions for updating the examples in a comment in the README

@orhun
Copy link
Member

orhun commented Jul 23, 2023

@joshka Should I add the vhs-action in this PR or a separate one? Which one do you prefer?

@joshka
Copy link
Member Author

joshka commented Jul 24, 2023

@joshka Should I add the vhs-action in this PR or a separate one? Which one do you prefer?

Let's hold off on that for now. It only handles the generate part, not the publishing part, so if we wanted to fully automate the updating of the readme that might be a little difficult.

@joshka joshka requested a review from kdheepak as a code owner July 24, 2023 18:22
@joshka
Copy link
Member Author

joshka commented Jul 24, 2023

  • Braille dots are fixed in VHS 0.6.0.
    • Removed notes about the dots in the README
    • Regenerated all images
  • Updated calendar.tape to wait a little longer as the sleep was catching the last of the cargo build command

examples/user_input.tape Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
This commit adds a readme to the examples directory with gifs of each
example. This should make it easier to see what each example does
without having to run it.

I modified the examples to fit better in the gifs. Mostly this was just
removing the margins, but for the block example I cleaned up the code a
bit to make it more readable and changed it so the background bug is not
triggered.

For the table example, the combination of Min, Length, and Percent
constraints was causing the table to panic when the terminal was too
small. I changed the example to use the Max constraint instead of the
Length constraint.

The layout example now shows information about how the layout is
constrained on each block (which is now a paragraph with a block).
@joshka joshka added this pull request to the merge queue Jul 24, 2023
Merged via the queue into ratatui:main with commit add578a Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants