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

Split help into individual man pages #1087

Merged
merged 20 commits into from
Jan 25, 2016
Merged

Split help into individual man pages #1087

merged 20 commits into from
Jan 25, 2016

Conversation

mislav
Copy link
Owner

@mislav mislav commented Jan 24, 2016

  • The canonical version of documentation for each command is now maintained inside the *.go implementation file for that command. Duplicate documentation is removed from README and the main hub(1) man page.

    var cmdCiStatus = &Command{
      Run:   ciStatus,
      Usage: "ci-status [-v] [<COMMIT>]",
      Long: `Display GitHub Status information for a commit.
    
      ## Options:
        -v
          Print detailed report of all status checks and their URLs.
    
        <COMMIT>
          A commit SHA or branch name (default: "HEAD").
    
      Exits with one of: success (0), error (1), failure (1), pending (2), no status (3).
    
      ## See also:
    
      hub-pull-request(1), hub(1)
      `,
    }
  • Add make man-pages that generates individual man pages for each command. Generated pages are not kept in version control; instead, they will be bundled with each release.

  • hub help pull-request will now show hub-pull-request(1) man page on systems that support man. On Windows, plain text help will be displayed.

  • hub help hub-clone (note the hub- prefix) now looks up hub-clone(1) man page. As before, hub help clone displays ordinary git-clone(1) documentation for compatibility with git.

  • The HTML representation of man pages now has cross-reference links:

    screen shot 2016-01-25 at 1 59 54 am

- No more `c.Short` property. Instead, the first line of `c.Long`
  property is considered a short command description.

- The `c.Usage` text can now contain multiple lines.

- The new `c.Synopsis()` method renders usage synopsis for humans:

    Usage: hub my-command --arg
           hub my-command --alternative-arg

- The new `c.HelpText()` method renders synopsis + full help text.
mislav added 11 commits January 25, 2016 02:30
For compatibility with git, `hub help checkout` will display the help
for git-checkout and there will be no information about hub extensions
to this command.

Now with `hub help hub-checkout`, hub will print the help text from
hub's extension to git-checkout.
Instead of displaying plain text help, `hub help <command>` will now
search for man pages to display.

* If `man` is available, hub first tries to locate the local
  `../man/hub-<command>.1` file relative to the `hub` executable. If
  found, open it with `man`. If not, execute `man 1 hub-<command>`.

* Otherwise, resort to displaying plain text help.
In the future, individual man pages will be generated prior to release.
Man pages should be the canonical source of hub documentation. People
should use `man help hub` instead of viewing the README, which might not
even correspond to the version they have installed.

This ends the confusing man page build system in which parts of the
README are injected into `hub.1.ronn` source file, deletes the Rakefile
and removes rake from gem bundle.

The examples are deleted because they are now inlined with individual
command documentation. So did the documentation for all hub commands get
deleted from main man page in favor of individual man pages.

However, this makes main man page have absolutely no listing of which
commands are available. This will get addressed as we go forward.
@mislav
Copy link
Owner Author

mislav commented Jan 25, 2016

New man pages are gorgeous! ✨ 💄

screen shot 2016-01-25 at 2 32 58 am

mislav added a commit that referenced this pull request Jan 25, 2016
Split help into individual man pages
@mislav mislav merged commit 35905f7 into master Jan 25, 2016
@mislav mislav deleted the help-restructure branch January 25, 2016 11:57
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.

1 participant