Skip to content

Wrapper of Go implementation `gat` (🐱 cat alternative written in Go.) for Julian

License

Notifications You must be signed in to change notification settings

AtelierArith/TerminalGat.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TL;DR

Typing SVG

Description

This package TerminalGat.jl provides Julia interface for gat. It allows to display files and images in the Julia's REPL.

Setup

  • 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")

How to use

Screen.Recording.2024-12-08.at.7.51.28.mov

Our Julia package TerminalGat.jl exports

  • gat
  • gess
  • @gess
  • @code
  • @gode
  • @search
  • @gearch

gat

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

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.

@gess, @code, @gode

The @gess macro works like InteractiveUtils.@less, but highlights Julia code.

image

The @code extracts a method definition from the source code that defines the method.

The @gode macro works like @code, but highlights Julia code.

image

@search, @gearch

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.

Screen.Recording.2024-12-20.at.14.10.35.mov

About

Wrapper of Go implementation `gat` (🐱 cat alternative written in Go.) for Julian

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages