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

Add manpage-specific output mode #14

Merged
merged 11 commits into from
Jul 22, 2014
Merged

Conversation

zyga
Copy link
Contributor

@zyga zyga commented Jul 21, 2014

This branch adds a whole new way to generate man pages. It's not fully complete (see commit logs before) but it is a new, optional mode, that has to be explicitly enabled. I've been testing it with PlainBox see https://code.launchpad.net/~zkrynicki/checkbox/manpages/+merge/227535 with promising results.

Some known issues (but equally broken for current generator) are positional argument names not showing up correctly and lack of support for @before, @after and @replace.

zyga added 11 commits July 21, 2014 15:13
More of the same changes, just with more recent version of pep8+flake8

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
The metavar is the name of the "value" available for arguments and
for some options. Typical example would be --output FILE. FILE is the
metavar string.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
==SUPPRESS== is the magic value used by argparse to hide command line
options. We should follow the same behavior.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
The :prog: argument to the .. argparse:: directive allows programmers
to override the program name but prog is typically correctly inferred
by argparse, and in some situations, it is already provided to argparse
explicitly. To keep code DRY, we should not override it without
having an explicit value

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
This mode is changing the way the directive is impacting the resulting
document. The layout changes to traditional manpage SYNOPSIS, DESCRIPTION,
etc sections. Most of the content is expected to be provided either
inline in the nested definitions (indented text below .. argparse::)
and immediately after that (for sections other than DESCRIPTION).

A number of existing sphinxarg features are not supported yet.
Specifically none of the @before @after and @replace pseudo-decorators
are handled.

Some of the new private methods are re-implementations of similar methods
from the generic code path but they could not be reused at this time.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@alex-rudakov
Copy link
Owner

Lot of changes :)
Is there any backward-incompatible changes?

It's not fully complete
Should we merge it into master (stable code only), or it's better to create separate branch?

We need to mention in docs how to use this with manpages, or it just works without any changes needed?

@zyga
Copy link
Contributor Author

zyga commented Jul 21, 2014

No, everything is backwards compatible. I've specifically made sure to make everything new an opt-in experience.

@alex-rudakov
Copy link
Owner

Ok. Will check this tomorrow morning and merge.
Is there anything to add into documentation? (Some usage notes, info that we have extended support for man-pages)

@zyga
Copy link
Contributor Author

zyga commented Jul 21, 2014

I'm still working on this so it's not really complete yet. I'll definitely write more tests and documentation updates. If you want to hold off until that happens that's fine but I believe in early and often approach :-)

@alex-rudakov
Copy link
Owner

No no. No problemo :) I will merge this. But before, want to check how well it works on my other projects that use this extension.

alex-rudakov added a commit that referenced this pull request Jul 22, 2014
Add manpage-specific output mode
@alex-rudakov alex-rudakov merged commit 04113ff into alex-rudakov:master Jul 22, 2014
@alex-rudakov
Copy link
Owner

Seems to be working as it was before, with my project docs. So, merged.

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 this pull request may close these issues.

2 participants