-
Notifications
You must be signed in to change notification settings - Fork 343
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
demos: automate running demos and update them #2231
Conversation
75bf460
to
a87b949
Compare
I think you could reference some external, like a google one or something, it would be stable (and probably would fall back to system font in unlikely case github is accessible and google cdn is not?). Ideally there could be some svg processor to convert text to paths so that it's a stable drawing and does not depend on anything. |
@necauqua This would be great, but after spending some time on it, I couldn't find a good way to do it. No Google font seems to support all these symbols. A simpler problem to solve would be to make the graphs at https://martinvonz.github.io/jj/prerelease/tutorial.html#the-operation-log look equally good on all computers. It looks good on my Linux computer, but not on my Chromebook1, in a way that seems very similar to SVGs. It's easy to switch the "MkDocs Material" theme to use any Google Font there, but no choice seemed to help. If we could solve that, maybe we could solve the SVG issue in the same way. There's some more discussion of related issues in #1467 and https://github.com/slowli/term-transcript/issues?q=is%3Aissue+author%3Ailyagr (both open and closed, there might also be something interesting in issues that aren't mine). Footnotes
|
Oh, and re converting text to paths: that works with Inkscape, but the result seems to be as big as the png file, more or less (though maybe it compresses better?), and certainly the diffs stop being human readable. |
@necauqua , I discovered a weird thing about Google fonts. If you follow this link, it seems like some monospace fonts do support all the symbols we need. However, if you click through to those fonts, they no longer seem to support the relevant symbols. Moreover, they didn't work when I experimented with changing the font for documentation website theme's code block font. The webfont world seems dark and mysterious. |
20cd7c3
to
130cae6
Compare
e380d32
to
e7780b2
Compare
Feel free to merge this as is, with or without the unused function for ignoring exit code 3. Thanks again for working on this! |
cb01998
to
fbdddcb
Compare
I think this is hopefully the final version. I'll look it over before merging. In other news, it seems that without installing Inkscape, PNG generation didn't work properly on Debian Linux. I'm not sure whether ImageMagick uses Inkscape itself or one of its dependencies. |
I think it's clearer if only the actual demos started with `demo_`, so I renamed `demo_helpers.sh` to just `helpers.sh`. `demo_resolve_conflict.sh` should match `resolve_conflicts.png` (with an s).
Previously, we needed to remove this manually from screenshots.
`jj | head` exits with non-zero code since `head` breaks the pipe. Also, removed `--color=always` from that command as it will shortly become unnecessary. Previosly, this caused the script to stop since it's run with `set -o pipefail`. Also, the operation id recovery code stopped working. We can use `jj debug operation` for this purpose now.
…ript Currently, there is no way provided to merely run scripts in a fixed environment (without recording). Short-term TODOs (done in descendant commits): - Fix the terminal width - Document the script
Previously, `jj` couldn't determine the terminal widths inside demos.
PNGs are updated in a descendant commit
This is mainly to account for the fact that most commands now report more information about the state of the repo.
We remove some branches that would be shown by default and remove `-r 'all()'` where it's no longer necessary.
The changes to SVGs would be trivial, so they got pushed to the previous commit.
The shell scripts here are a bit messy, but are quite functional for me.
The PR also includes some changes to the demos to make them flow better (IMO), given
the intervening changes to
jj
output.The font that ended up being used seems to take up more space than the font we had
previously. I also find it more readable, and it could take some effort to experiment
with different fonts.
The scripts also generate SVGs. It would be very cheap to store them in the repo, but we could also remove them. The pro of SVGs is that they are perfectly crisp, and the con is that some of the curves and postioning in
jj log
's Unicode are slightly off (in my browser, this depends on what fonts you have installed).Here's what the
README
looks like with these changes.TODO:
jj
to wrap to 80 symbols, notterm-transcript
.