Skip to content

Commit

Permalink
More editor GIF into docs/ and re-enable print mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Jan 2, 2025
1 parent 1f5c96f commit e2a5bca
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
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.
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

0 comments on commit e2a5bca

Please sign in to comment.