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

Feature: generate man pages #5605

Closed
Kixunil opened this issue Aug 4, 2021 · 5 comments · Fixed by #8525
Closed

Feature: generate man pages #5605

Kixunil opened this issue Aug 4, 2021 · 5 comments · Fixed by #8525
Assignees
Labels
enhancement Improvements to existing features / behaviour feature request Requests for new features good first issue Issues suitable for first time contributors to LND P4 low prio

Comments

@Kixunil
Copy link
Contributor

Kixunil commented Aug 4, 2021

It'd be really nice to be able to generate man page automatically. The flags library lnd is using already supports generating manpage although a bit awkwardly - by using same code that is used in runtime.

Possible approaches

  • Have an additional switch/command in lncli (and ideally also in lnd) that will save the man page in a file/stdout. This is somewhat weird in cross-compiling scenarios.
  • Have a very small binary that imports same config code and that binary writes manpage.
  • Separate binary as before + automatically run it in release script (never cross compile) and add manpage to the release - I like this the most.
@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour feature request Requests for new features labels Aug 5, 2021
@Roasbeef Roasbeef added the P4 low prio label Aug 31, 2021
@guggero guggero added the good first issue Issues suitable for first time contributors to LND label Feb 16, 2022
@lightningorb
Copy link

I'll take this as it's labelled good first issue.

@lightningorb
Copy link

paired with: @mauricepoirrier

man page for lncli generated successfully. Just needs a bit of formatting work else it's pretty much done.

@lightningorb
Copy link

Sharing early.

This is in cmd/lncli/main.go:

	docs := GenerateDocs(app);

        f, err := os.Create("program.1")
        if err != nil {
            panic(err)
        }
        defer f.Close()

	f.Write([]byte(docs))

The GenerateDocs function is literally copied from urfave/cli#340 (comment)

Currently we're converting from markdown to man using pandoc, but we're not yet set on the cleanest approach for generating man pages and integrating this with the rest of the codebase neatly. Ongoing.

@Kixunil
Copy link
Contributor Author

Kixunil commented Feb 17, 2023

@lightningorb This mentions some ToMan method, maybe you could use it instead?

@mauricepoirrier mauricepoirrier mentioned this issue Feb 19, 2023
7 tasks
@mohamedawnallah
Copy link
Contributor

I'm interested in taking on this issue. All seems good to me I've just put the comments in the closed PR where I have some doubts about when implementing this feature. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour feature request Requests for new features good first issue Issues suitable for first time contributors to LND P4 low prio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants