gistsnip

command module
v0.0.0-...-5a1f590 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2019 License: MIT Imports: 20 Imported by: 0

README

gistsnip

Create multiple gists from code based on annotations.

As an example you may have main.go:

func main() {
    //gistsnip:start:loop
    for i := 0; i < 100; i++ {
        fmt.Println(i)
    }
    //gistsnip:end:loop

    //gistsnip:start:example
    fmt.Println("hello world")
    //gistsnip:end:example
}

gistsnip will create two gists:

for i := 0; i < 100; i++ {
    fmt.Println(i)
}

and

fmt.Println("hello world")

For multiple see https://github.com/egonelbre/db-demo/

Usage

  1. Create a Github Personal Access token at https://github.com/settings/tokens.
  2. Either set it as GISTSNIP_TOKEN environment variable or pass it in as a command-line argument.
  3. Run gistsnip in the target folder.

To update the gists, simply rerun gistsnip. gistsnip will cache the last gist state and update things as needed.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL