posener / goreadme

Generate readme file from Go doc. Now available as a Github action!
MIT License
213 stars 33 forks source link

Result contains '(MISSING)' text #115

Closed preaction closed 3 years ago

preaction commented 3 years ago

In the https://github.com/preaction/mojo.go repository, the README is generated from doc.go. However, the generated README.md contains some things that are not in the original:

    app := mojo.NewApplication()
-   app.Renderer.AddTemplate("greet", "Hello, <% .Stash.name %>!\n")
+   app.Renderer.AddTemplate("greet", "Hello, <%!.(MISSING)Stash.name %!>(MISSING)!\n")
    app.Routes.Get( "/:name", mojo.Stash{"name": "World"}).To( GreetHandler )
    app.Start()

How can I remove those changes? I'll be happy to develop a PR if needed.

posener commented 3 years ago

Thanks @preaction for reporting this issue. You can see #116 , I added a failing test in the first commit and fixed it in the second one. It was using printf instead of print in the markdown formatter. Thanks for proposing yourself for fixing the issue. Would love help if you find anything else! The easiest way is to try to reproduce in the the ./testdata directory, run tests with WRITE_READMES=1 go test ./... which generate the README.md files for all the testcases in ./testdata, and then figure out how to fix them.