-
Notifications
You must be signed in to change notification settings - Fork 34
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
Tracking issue: man pages #38
Comments
Note to self: the best way to approach this would be to work on the clap v3 branch, because it has an actual API intended to expose flags & stuff. |
Cool tool linked from Gitter: http://www.snake.net/software/troffcvt/tbl.html. Log16:35 <Screwtapello> @waywardmonkeys That's pretty much how roff works, for example. "mdoc" is a high-level, semantic markup for manpages, "man" is lower-level, presentational markup, and eventually it all gets ground up to individual PostScript (or whatever) instructinos.
16:35 <waywardmonkeys> @epage And that’s useful because at the highest level, you essentially have your data objects that you want to output .. so transitioning from that to the output is a lot like a Display trait or Debug trait, but instead of going directly to a stream, you’re going to the next level down of IR.
16:37 <Screwtapello> (for instance, roff itself doesn't support table layout; `tbl` takes a semantic description of a table and spits out low-level roff instructions to make it put text in the right places) |
Just some things I asked about in the gitter chat.
which can be consumed, produced or both by argument parsing crates and which is good enough for referencing it from manual page (or other documentation) generators.
|
Using data types to represent arguments is what ripgrep does, and then just reuses them in build.rs to generate a man page. It is considerably easier to do this in a more confined use case though. |
Some thoughts!
|
@BurntSushi, what problems do you see in general usage? FWIW, I could see both approaches working out (a) have the argument-parsing code produce/export the My main reservation regarding this approach is that you need to include what might be significantly extended text, with some kind of markup, interspersed with the code. I guess this will have to happen somewhere, but see below for an alternate route. (b) have the argument-parsing code consume Given that both the man and info formats have been around for quite some time now, I suppose it's safe to go with a "rich" argument (like |
@deg4uss3r, thanks for your comments! I'm not sure I follow re: 1. Are you talking about the documentation generation here? What distinction would
|
Just to avoid this getting lost, some considerations for the information that we'd want to have available for generating parts of the manpage:
|
Oh also worth mentioning: work on man page generation has started here https://github.com/rust-clique/man. |
It took me a while to dig this up, but for posterity: PR to add man page generation to clap is here: clap-rs/clap_generate#1 |
also cf. rust-lang/const-eval#25 |
This is a tracking issue for man page creation. The initial goal is to provide a flow to generate man pages from Structopt instances. This is a specialization of https://github.com/rust-lang-nursery/cli-wg/issues/23.
Example
The goal is to be able to use code similar to this.
Checklist
I think the following steps are required to make this happen.
Writer
).Writer
.The text was updated successfully, but these errors were encountered: