robertkrimen / godocdown

Format package documentation (godoc) as GitHub friendly Markdown
526 stars 56 forks source link

Wrap inline code with ```go #7

Open raphael opened 9 years ago

raphael commented 9 years ago

Would be nice if the tool wrapped code snippets that appear in header comments with code blocks so that go formatting is applied, so for example

// Foo is an awesome function
//     fmt.Printf("Foo: %v\n", foo())
// produces
//     Foo: 42
// Note that this never changes.
func foo() int { 
    return 42
}

Would get generated as:

Foo is an awesome function

     fmt.Printf("Foo: %v\n", foo())

produces

    Foo: 42

Note that this never changes.

func foo() int { 
    return 42
}