Skip to content

Generate beautiful syntax highlighted code snippets!

Notifications You must be signed in to change notification settings

juliusmh/snippit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✂️ snippit

creates images of code snippets .

Installation

like any other go program:

go install github.com/juliusmh/snippit@latest

General

The font used is RobotoMono. Currently, this is fixed. The default render resolution is pretty low, given the default line height of 17. In order to increase resolution use the -scale X flag (default X=1). To see all available options use the -help flag.

Syntax highlighting is performed by chroma. For a list of all styles I recommend xyproto/splash's demo page. For a list of all lexers checkout chroma/lexers.

Configuration

snippit -l -w testdata/test.go 
  • -l To show line numbers
  • -w To show window

test.go

snippit -l -w -bw 0 -style solarized-light testdata/test.yaml 
  • -bw Border Width zero (hide border)
  • -style Apply stylesheet solarized-light

test.yaml

snippit -br 0 -style xcode-dark testdata/test.py
  • -br Border Radius zero

test.yaml

Upcoming

  • Filename in window header (decoration)
  • SVG output option

About

Generate beautiful syntax highlighted code snippets!

Resources

Stars

Watchers

Forks

Languages