-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Cross Referencing Program Objects #880
Comments
It seems that cross-referencing an program directive is not possible, right? |
FYI, it seems to be possible just by doing
but I can't find documentation on this... |
I can't get this to work. At least not with commands containing dashes. |
The current implementation of |
Given the I'm probably missing something, but looking at the markup generated in our pinout -h documentation and the anchor being "cmdoption-pinout-h" which is obviously composed of the |
You may have multiple places in a document where you use |
Re-reading the docs for the program directive you're clearly correct, and I've obviously been under the mistaken impression that the That said, I'm struggling to imagine where/why one might wish to split up the options for a program in a set of documentation (again, I may be missing something obvious). Realizing that I'm proposing something that would potentially break backwards compatibility, might it be preferable to re-define the Alternatively, rather than breaking compatibility (and in keeping with the OP), perhaps introduce a Come to think of it, I'm not entirely sold on "binary" -- it's a bit too all-encompassing. Perhaps "executable" or "application" (or possibly "script", though that comes with its own implications) to make it clear that the binary in question is something intended to be run by the user? |
Just ran into this. Idea for a potential workaround that would not break backwards compatibility (?): Imaging having a page explaining your tool, .. _cli:
CLI
===
The command line usage of `git` ...
.. click:: git.cli:cli
:prog: git
:nested: full If I want to reference e.g. :ref:`git commit <cli>` This brings me to the top of the CLI page. However, looking at the output of :ref:`git commit <click-git-commit>` Maybe this is a less invasive change? |
I'm using Sphinx to document a software product that includes a number
of command line utilities. I've documented the utilities themselves
using the standard domain's "program" and "option" directive, but I
find myself often talking about these programs in the text of the
documentation itself, and I would like to be able to cross reference
the "manual page," when I mention the program's name.
The easiest/best way would be if the :program: role would link to the
page that has "program" directive.
In an attempt to find a work around for this I've encountered another
issue:
I attempted create a new "binary" role and directive combination in a
custom domain, inserted these "binary" directives with the name of the
utility on the same manual page that has a program directive and
discovered that cross-referencing would not work for these links, even
though the "binary" and the "program" directives exist in different
domains. At the same time cross-references work if when "binary"
directive holds a term that isn't duplicated by the value of a program
directive.
Is there a work around for this collision, or a recommended way of
referencing these kinds of objects.
The text was updated successfully, but these errors were encountered: