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
Start to generate man pages automatically #1342
Conversation
Thanks for your pull request, @wilzbach! |
Nice! Is there anything left in the manual work that we should get in somehow? The only thing is that this should be put in the "scripts" folder instead of creating its own top-level one. |
ef4ab10
to
aba2e64
Compare
BTW the CLI output for a command lists the common option too. I left them out for now as #1143 didn't add them either, but thinking about it, we should probably add them too
Done. Other changes:
Well, this doesn't aim to be perfect on the first try. I am pretty sure that some small modifications will be needed, but I think this brings us to 95% of the solution. |
6e9dec1
to
0ca2277
Compare
Copyright (c) 1999-%s by The D Language Foundation | ||
.SH "ONLINE DOCUMENTATION" | ||
.UR http://code.dlang.org/docs/commandline | ||
.UE http://code.dlang.org/docs/commandline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this. In the preview this doesn't generate a URL, but it's the way DMD documented it's ONLINE DOCUMENTATION.
auto manFile = File(config.cwd.buildPath(fileName), "w"); | ||
auto manName = format("DUB-%s", command.name).toUpper; | ||
manFile.writeHeader(manName, config); | ||
static immutable seeAlso = ["dmd(1)".br, "dub(1)"].joiner("\n").to!string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be more sophisticated.
Sounds like a good start! |
Turns out that generating man pages automatically isn't hard.
See also: #1143 (manual approch).
This is far from ideal, but it does generate man pages for all commands and
thus should get us started.