snippetgo

command module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 8 Imported by: 0

README

snippetgo: Generate packed go file with snippet code marked in source code

It is used for embed code blocks into your documentations. because code blocks are in your compilable source code, So you will never generate invalid code blocks in your docs.

Since I will write docs in go source code, So right now it generate to go source code as global variables.

Install

$ go get -u -v github.com/sunfmin/snippetgo

Mark your source code with these

// @snippet_begin(VariableName)
func Hello() {
    fmt.Println("Hello")
}
// @snippet_end

Then run

$ snippetgo -pkg=mypkg > ./mypkg/snippets_generated.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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