Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue generating markdown pages for commands when using vgo #805

Closed
rprakashg opened this issue Jan 7, 2019 · 6 comments · Fixed by #977
Closed

Issue generating markdown pages for commands when using vgo #805

rprakashg opened this issue Jan 7, 2019 · 6 comments · Fixed by #977

Comments

@rprakashg
Copy link

I'm using vgo and recently added ability to generate markdown pages for entire command tree per this doc https://github.com/spf13/cobra/blob/master/doc/md_docs.md. It doesn't seem to work with vgo. Getting following error when running vgo build

github.com/cpuguy83/go-md2man/md2man ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions) ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/roff.go:19:23: cannot use roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument: *roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method) ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED ../../../../pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/roff.go:102:11: too many errors

@benmcclelland
Copy link

Thought I would post my experience in case it helps others. I also ran into the errors previously stated when building my project with go module support. The build errors were:

$ go build
# github.com/cpuguy83/go-md2man/md2man
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions)
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/roff.go:19:9: cannot use roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument:
	*roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED
../../../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.8/md2man/roff.go:102:11: too many errors

looking at go.sum, it was trying to use the latest tag release of 1.0.8:

github.com/cpuguy83/go-md2man v1.0.8 h1:DwoNytLphI8hzS2Af4D0dfaEaiSq2bN05mEm4R6vf8M=
github.com/cpuguy83/go-md2man v1.0.8/go.mod h1:N6JayAiVKtlHSnuTCeuLSQVs75hb8q+dYQLjr7cDsKY=

I told go modules to use the latest master commit instead, and it seems to work:

go get github.com/cpuguy83/go-md2man@691ee98543af2f262f35fbb54bdd42f00b9b9cc5
go build
$ go mod why github.com/cpuguy83/go-md2man/md2man
# github.com/cpuguy83/go-md2man/md2man
github.com/benmcclelland/test/cmd
github.com/spf13/cobra/doc
github.com/cpuguy83/go-md2man/md2man

Looks like maybe this is making use of a not yet released interface?

@cameronwp
Copy link

Just ran into the same issue. Thanks for doing the legwork on straightening out the dependency version, @benmcclelland!

@kasvith
Copy link

kasvith commented Mar 9, 2019

thanks @benmcclelland

@cpuguy83
Copy link

go mod should work now.

@bep
Copy link
Collaborator

bep commented Jun 8, 2019

I ran to this wall today, and I don't understand it.

▶ go mod graph | grep md2
github.com/spf13/cobra github.com/cpuguy83/go-md2man@v1.0.10
github.com/cpuguy83/go-md2man@v1.0.10 github.com/russross/blackfriday@v1.5.2

And there is no other Blackfriday reference, yet when I do go get -u from Cobra of from Hugo, it insists about pulling in BF v2 which does not make much sense. Sounds like a Go bug.

@pdf
Copy link
Contributor

pdf commented Oct 8, 2019

If my understanding is correct, I believe this project needs to be updated to use github.com/cpuguy83/go-md2man/v2 in order to avoid the broken v2.0.0 release of blackfriday.

pdf added a commit to pdf/cobra that referenced this issue Oct 8, 2019
pdf added a commit to pdf/cobra that referenced this issue Oct 8, 2019
pdf added a commit to pdf/cobra that referenced this issue Oct 14, 2019
jharshman pushed a commit that referenced this issue Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants