Update README
- QOL for *.tape files
This commit is contained in:
parent
b7b16197f9
commit
51588e455b
68
README.md
68
README.md
@ -54,7 +54,7 @@ make
|
|||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
`lat` can, for the most part, be a direct drop in for `cat`. However it really shines when embedded into another program. For example, in `fzf`, `lat` makes an excellent viewer with the command `fzf --command lat -l {}`.
|
`lat` can, for the most part, be a direct drop in for `cat`. However it really shines when embedded into another program. For example, in `fzf`, `lat` makes an excellent viewer with the command `fzf --command lat -r {}`.
|
||||||
|
|
||||||
![Using lat in fzf](social/render/fzf_embed.gif)
|
![Using lat in fzf](social/render/fzf_embed.gif)
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ For example, this should be possible in a future version of `lat`
|
|||||||
|
|
||||||
```c
|
```c
|
||||||
int main(void) {
|
int main(void) {
|
||||||
FILE *st = popen("lat -l", "w");
|
FILE *st = popen("lat -r", "w");
|
||||||
if (st == NULL)
|
if (st == NULL)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
@ -77,37 +77,43 @@ int main(void) {
|
|||||||
|
|
||||||
### Features and Flags
|
### Features and Flags
|
||||||
|
|
||||||
#### `--color`
|
#### `-c` color
|
||||||
Completely disables or enables all colored output from `lat`.
|
Completely disables or enables all colored output from `lat`.
|
||||||
##### Example
|
##### Example
|
||||||
![Color in lat](social/render/color.gif)
|
![Color in lat](social/render/color.gif)
|
||||||
> `lat` also respects [NO_COLOR](https://no-color.org/), but `--color` overrides it
|
> `lat` also respects [NO_COLOR](https://no-color.org/), but `-c` overrides it
|
||||||
|
|
||||||
#### `--lines`
|
#### `-l` line numbers
|
||||||
Print numbers for each line of the file.
|
Print numbers for each line of the file.
|
||||||
##### Example
|
##### Example
|
||||||
![Line numbers in lat](social/render/line_numbers.gif)
|
![Line numbers in lat](social/render/line_numbers.gif)
|
||||||
|
|
||||||
#### `--headers`
|
#### `-t` file title
|
||||||
Shows or hides formatted file data headers.
|
Shows or hides formatted file data headers.
|
||||||
##### Example
|
##### Example
|
||||||
![Headers in lat](social/render/headers.gif)
|
![Headers in lat](social/render/headers.gif)
|
||||||
|
|
||||||
#### `--binary`
|
#### `-b` binary mode
|
||||||
By default, `lat` will attempt to detect if the file is printable or not. If the file isn't (e.g. you ran `lat file.pdf`) then lat will enter *`binary mode`*. In *`binary mode`*, `lat` will skip a lot of processing in favor of speed.
|
By default, `lat` will attempt to detect if the file is printable or not. If the file isn't (e.g. you ran `lat file.pdf`) then lat will enter *`binary mode`*. In *`binary mode`*, `lat` will skip a lot of processing in favor of speed.
|
||||||
You can force *`binary mode`* to be `on` or `off` with the flags `-b` and `-bb` respectively.
|
You can force *`binary mode`* to be `on` or `off` with the flags `-b` and `-bb` respectively.
|
||||||
##### Example
|
##### Example
|
||||||
![Binary Mode in lat](social/render/binary.gif)
|
![Binary Mode in lat](social/render/binary.gif)
|
||||||
|
|
||||||
#### `--literal`
|
#### `-r` raw output
|
||||||
`lat` is smart enough to print all non-file characters to a separate filestream. That way, the output of `lat` can be used to con**cat**enate files, the way it was originally meant to be.
|
`lat` is smart enough to print all non-file characters to a separate filestream. That way, the output of `lat` can be used to con**cat**enate files, the way it was originally meant to be (with `>` or `|`).
|
||||||
However, sometimes you want those extra symbols.
|
However, sometimes you want those extra symbols.
|
||||||
`--literal` prints everything out to the primary filestream (usually `stdout`)
|
`-r` prints everything out to the primary filestream (usually `stdout`)
|
||||||
##### Example
|
##### Example
|
||||||
![Literal output in lat](social/render/literal.gif)
|
![Literal output in lat](social/render/raw.gif)
|
||||||
|
|
||||||
#### `--pager`
|
#### `-p` pager
|
||||||
`lat` comes with out-of-the-box support for paging in `less`. If you don't want your file messing up your terminal, just `-p` it.
|
`lat` comes with out-of-the-box support for paging in `less`. If you don't want your file messing up your terminal, just `-p` it.
|
||||||
|
|
||||||
|
### `-n` name
|
||||||
|
`lat` allows you to customize the name of the file shown. This can be useful in demonstrations or when `lat` is embedded in another program.
|
||||||
|
#### Example
|
||||||
|
![Custom filename in lat](social/render/name.gif)
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
![Paging in lat](social/render/pager.gif)
|
![Paging in lat](social/render/pager.gif)
|
||||||
|
|
||||||
@ -115,42 +121,26 @@ However, sometimes you want those extra symbols.
|
|||||||
|
|
||||||
|
|
||||||
## Helptext
|
## Helptext
|
||||||
> `lat --help`
|
> `lat -h`
|
||||||
|
|
||||||
```text
|
```text
|
||||||
lat | lazy cat - a cat clone with some quality-of-life embellishments
|
lat | lazy cat - a cat clone with some quality-of-life embellishments
|
||||||
|
|
||||||
usage: lat [-cntblpVh] [file...]
|
usage: lat [-cltbrpnVh] [file...]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-c, --color toggle color
|
-c toggle color
|
||||||
-n, --lines toggle line numbers
|
-l toggle line numbers
|
||||||
-t, --headers toggle file info headers
|
-t toggle file info headers
|
||||||
-b, --binary toggle binary mode, -b forces binary and -bb forces NOT binary
|
-b toggle binary mode, -b forces binary and -bb forces NOT binary
|
||||||
-l, --literal print everything to stdout (or equivalent)
|
-r print everything to stdout (or equivalent)
|
||||||
-p, --pager print file with the pager (uses less)
|
-p print file with the pager (uses less)
|
||||||
-V, --version show program version
|
-n set the name of the file in the title
|
||||||
-h, --help display this help text (--help shows additional info)
|
-V show program version
|
||||||
|
-h display this help text
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
NO_COLOR, see https://no-color.org/
|
NO_COLOR, see https://no-color.org/
|
||||||
|
|
||||||
examples:
|
|
||||||
lat file1
|
|
||||||
print the contents of file1 with the default formatting
|
|
||||||
lat - file1
|
|
||||||
read from stdin (the '-' flag reads from stdin) and then print the contents of stdin and file1
|
|
||||||
lat -nc file1 file2
|
|
||||||
print the contents of file1 and file2 without printing line numbers or colors
|
|
||||||
lat --binary file.txt
|
|
||||||
force file.txt to be treated as a binary file
|
|
||||||
lat -bb --pager file.txt
|
|
||||||
force file.txt to NOT be treated as a binary file and print it in the pager
|
|
||||||
curl example.com | lat
|
|
||||||
pipe the results of 'curl example.com' into lat
|
|
||||||
fzf --preview 'lat -l {}'
|
|
||||||
use lat as the file viewer in fzf
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ Set FontSize 32
|
|||||||
Set Width 2400
|
Set Width 2400
|
||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
Set PlaybackSpeed 0.5
|
|
||||||
|
|
||||||
Type "lat src/main.c"
|
Type "lat src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
@ -10,7 +10,6 @@ Set FontSize 32
|
|||||||
Set Width 2400
|
Set Width 2400
|
||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
Set PlaybackSpeed 0.5
|
|
||||||
|
|
||||||
Type "lat src/main.c"
|
Type "lat src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
@ -24,7 +23,7 @@ Enter
|
|||||||
|
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
|
||||||
Type "lat --color src/main.c"
|
Type "lat -c src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
Enter
|
Enter
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ Set Width 2400
|
|||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
|
|
||||||
Type "fzf --preview 'lat -l {}'"
|
Type "fzf --preview 'lat -r {}'"
|
||||||
Sleep 1s
|
Sleep 1s
|
||||||
|
|
||||||
Enter
|
Enter
|
||||||
@ -32,49 +32,8 @@ Sleep 3s
|
|||||||
Backspace 7
|
Backspace 7
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
|
||||||
Up
|
Up@3s 15
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
|
||||||
|
|
||||||
Up
|
|
||||||
Sleep 3s
|
Sleep 3s
|
||||||
|
|
||||||
Enter
|
Enter
|
||||||
|
@ -10,7 +10,6 @@ Set FontSize 32
|
|||||||
Set Width 2400
|
Set Width 2400
|
||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
Set PlaybackSpeed 0.5
|
|
||||||
|
|
||||||
Type "lat src/main.c"
|
Type "lat src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
@ -24,7 +23,7 @@ Enter
|
|||||||
|
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
|
||||||
Type "lat --headers src/main.c"
|
Type "lat -t src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
Enter
|
Enter
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ Set FontSize 32
|
|||||||
Set Width 2400
|
Set Width 2400
|
||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
Set PlaybackSpeed 0.5
|
|
||||||
|
|
||||||
Type "lat src/main.c"
|
Type "lat src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
@ -10,7 +10,6 @@ Set FontSize 32
|
|||||||
Set Width 2400
|
Set Width 2400
|
||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
Set PlaybackSpeed 0.5
|
|
||||||
|
|
||||||
Type "lat src/main.c > example.c"
|
Type "lat src/main.c > example.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
@ -30,7 +29,7 @@ Enter
|
|||||||
|
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
|
||||||
Type "lat --literal src/main.c > example.c"
|
Type "lat -r src/main.c > example.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
Enter
|
Enter
|
||||||
|
|
||||||
|
37
social/name.tape
Normal file
37
social/name.tape
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
Require lat
|
||||||
|
Output social/render/name.gif
|
||||||
|
|
||||||
|
Set Theme "Gruvbox Dark"
|
||||||
|
Set WindowBar Rings
|
||||||
|
Set BorderRadius 10
|
||||||
|
Set Margin 10
|
||||||
|
|
||||||
|
Set FontSize 32
|
||||||
|
Set Width 2400
|
||||||
|
Set Height 1200
|
||||||
|
Set TypingSpeed 0.2
|
||||||
|
|
||||||
|
Type "lat"
|
||||||
|
Sleep 2s
|
||||||
|
Enter
|
||||||
|
|
||||||
|
Type "hello, world!"
|
||||||
|
Enter
|
||||||
|
Sleep 3s
|
||||||
|
|
||||||
|
Ctrl+d
|
||||||
|
|
||||||
|
Sleep 3s
|
||||||
|
|
||||||
|
Type "lat -n "custom name" src/main.c"
|
||||||
|
Sleep 2s
|
||||||
|
Enter
|
||||||
|
|
||||||
|
Type "hello, world!"
|
||||||
|
Enter
|
||||||
|
Sleep 3s
|
||||||
|
|
||||||
|
Ctrl+d
|
||||||
|
|
||||||
|
Sleep 4s
|
||||||
|
|
@ -10,7 +10,6 @@ Set FontSize 32
|
|||||||
Set Width 2400
|
Set Width 2400
|
||||||
Set Height 1200
|
Set Height 1200
|
||||||
Set TypingSpeed 0.2
|
Set TypingSpeed 0.2
|
||||||
Set PlaybackSpeed 0.5
|
|
||||||
|
|
||||||
Type "lat src/main.c"
|
Type "lat src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
@ -24,7 +23,7 @@ Enter
|
|||||||
|
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
|
|
||||||
Type "lat --pager src/main.c"
|
Type "lat -p src/main.c"
|
||||||
Sleep 2s
|
Sleep 2s
|
||||||
Enter
|
Enter
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user