emdbed/emdbed_example_test.go

30 lines
443 B
Go

// Package emdbed is for embedding "things" in your markdown
package emdbed
import (
"fmt"
)
func Example() {
fi, err := testdata.Open("testdata/main.md")
defer fi.Close()
out, err := Convert("testdata", fi)
if err != nil {
panic(err)
}
fmt.Println(out)
// Output:
//<!-- emdbed: main.go -->
//```go
//package main
//
//import "fmt"
//
//func main() {
// fmt.Println("Hello, world!")
//}
//
// ```
//<!-- /emdbed -->
}