Skip to content

Commit

Permalink
docs(readme): update programmatic usage example (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: bastantoine <[email protected]>
  • Loading branch information
bastantoine authored Jun 12, 2021
1 parent 14797b3 commit da13949
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ import (
"github.com/princjef/gomarkdoc"
"github.com/princjef/gomarkdoc/lang"
"github.com/princjef/gomarkdoc/logger"
)
func main() {
Expand All @@ -173,14 +174,15 @@ func main() {
// handle error
}
buildPkg, err := build.ImportDir(".", wd, build.ImportComment)
buildPkg, err := build.ImportDir(wd, build.ImportComment)
if err != nil {
// handle error
}
// Create a documentation package from the build representation of our
// package.
pkg, err := lang.NewPackageFromBuild(buildPkg)
log := logger.New(logger.DebugLevel)
pkg, err := lang.NewPackageFromBuild(log, buildPkg)
if err != nil {
// handle error
}
Expand Down
6 changes: 4 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
//
// "github.com/princjef/gomarkdoc"
// "github.com/princjef/gomarkdoc/lang"
// "github.com/princjef/gomarkdoc/logger"
// )
//
// func main() {
Expand All @@ -194,14 +195,15 @@
// // handle error
// }
//
// buildPkg, err := build.ImportDir(".", wd, build.ImportComment)
// buildPkg, err := build.ImportDir(wd, build.ImportComment)
// if err != nil {
// // handle error
// }
//
// // Create a documentation package from the build representation of our
// // package.
// pkg, err := lang.NewPackageFromBuild(buildPkg)
// log := logger.New(logger.DebugLevel)
// pkg, err := lang.NewPackageFromBuild(log, buildPkg)
// if err != nil {
// // handle error
// }
Expand Down

0 comments on commit da13949

Please sign in to comment.