This package TerminalGat.jl provides Julia interface for gat
. It allows to display files and images in the Julia's REPL.
- Install Julia. Once you've done, you can use
julia
command in your terminal.
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.10.3 (2024-04-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Pkg; Pkg.add("TerminalGat")
Screen.Recording.2024-12-08.at.7.51.28.mov
Our Julia package TerminalGat.jl
exports
gat
gess
@gess
@code
@gode
@search
@gearch
julia> using TerminalGat
julia> gat("Project.toml")
Internally, our package uses JuliaDocs/IOCapture.jl to capture the standard output generated by the go binary gat
.
If your terminal supports Sixel, you can print images.
julia> using TerminalGat
julia> using Plots; plot(sin); savefig("sin.png")
julia> gat("sin.png")
gess
works something like gat
+ less
:
julia> using TerminalGat
julia> gess("Project.toml")
Internally, our package uses ronisbr/TerminalPager.jl
to scroll through content that does not fit in the screen.
The @gess
macro works like InteractiveUtils.@less
, but highlights Julia code.
The @code
extracts a method definition from the source code that defines the method.
The @gode
macro works like @code
, but highlights Julia code.
The @search
works like tkf/InteractiveCodeSearch.jl allowing us to choose the code we want to read.
The @gearch
macro works @seach
with gat
feature; allowing us to read syntax highlighted code by gat.