2021-12-26 04:53:20 +00:00
|
|
|
// Package emdbed is for embedding "things" in your markdown
|
2021-12-23 05:48:19 +00:00
|
|
|
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!")
|
|
|
|
//}
|
2021-12-24 04:03:34 +00:00
|
|
|
//
|
2021-12-23 05:48:19 +00:00
|
|
|
// ```
|
|
|
|
//<!-- /emdbed -->
|
|
|
|
}
|