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

More gifs again #441

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ renderer = ["html"]
[output.html]
edit-url-template = "https://github.com/LucasPickering/slumber/edit/master/docs/{path}"
git-repository-url = "https://github.com/LucasPickering/slumber"

[output.html.print]
# Print seems to have a bug with absolute links to static assets, which causes
# the link check CI step to fail. I don't see much value in this anyway
enable = false
Binary file added docs/src/images/editor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/images/filter_full.png
Binary file not shown.
Binary file removed docs/src/images/filter_small.png
Binary file not shown.
Binary file added docs/src/images/query.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions docs/src/user_guide/filter_query.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ You can use this capability to manipulate responses via `grep`, `awk`, or any ot

## Querying Response in TUI

You can visually query a response body using the filter box at the bottom. Here is a full response, with no query applied:
You can visually query a response body using the filter box at the bottom:

![Unfiltered response](../images/filter_full.png)

And here it is with the query `$.data` applied:

![Filtered response](../images/filter_small.png)
![Querying response via JSONPath](../images/query.gif)
2 changes: 1 addition & 1 deletion docs/src/user_guide/tui/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Editing

![Open collection file in vim](/static/editor.gif)
![Open collection file in vim](../../images/editor.gif)

Slumber supports editing your collection file without leaving the app. To do so, open the actions menu (`x` by default), then select `Edit Collection`. Slumber will open an external editor to modify the file. To determine which editor to use, Slumber checks these places in the following order:

Expand Down
12 changes: 8 additions & 4 deletions gifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import argparse
import glob
import os
import re
import shutil
import subprocess

TAPE_DIR = "tapes/"
GIF_DIR = "static/"
OUTPUT_REGEX = re.compile(r"^Output \"(?P<path>.*)\"$")


def main() -> None:
Expand Down Expand Up @@ -83,9 +84,12 @@ def get_tape_path(tape_name: str) -> str:


def get_gif_path(tape_path: str) -> str:
file_name = os.path.basename(tape_path)
(name, _) = os.path.splitext(file_name)
return os.path.join(GIF_DIR, f"{name}.gif")
with open(tape_path) as f:
for line in f:
m = OUTPUT_REGEX.match(line)
if m:
return m.group("path")
raise ValueError(f"Tape file {tape_path} missing Output declaration")


def run(command: list[str]) -> str:
Expand Down
3 changes: 0 additions & 3 deletions static/editor.gif

This file was deleted.

2 changes: 1 addition & 1 deletion tapes/editor.tape
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Output "static/editor.gif"
Output "docs/src/images/editor.gif"
Set Shell bash
Set Width 1200
Set Height 800
Expand Down
28 changes: 28 additions & 0 deletions tapes/query.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Output "docs/src/images/query.gif"
Set Shell bash
Set Width 1200
Set Height 800
Set FontSize 18
Set Framerate 24
Set Margin 0
Set Padding 10
Set Theme "MaterialDark"

Hide
Type "cargo run"
Enter
Sleep 2s
Enter # Send login request
Type "hunter2"
Enter
Sleep 2s
Type "rf" # Fullscreen response pane
Show

Sleep 1s
Type "/"
Sleep 1s
Type "$.args"
Sleep 2s
Type ".fast"
Sleep 2s
Loading