On Wednesday, January 17, 2018 at 9:37:13 AM UTC-5, Komiya Takeshi wrote:
>
> >:numref: is apparently unable to resolve document names. 
>
> Since 1.5, you can refer using format strring. :numref:`{number} 
> {name} <section-label>`. 
> I know this is not easy to write. But there are no way to refer both 
> section number and title at same time.


...but this doesn't work on document names.

The "obvious" fix seems to be to extend the formatting options to :doc:. I 
did that in https://github.com/sphinx-doc/sphinx/pull/4445; the code change 
is pretty minor (only 5 lines of logic), but I haven't done doc yet. Please 
let me know if this seems like a reasonable approach.

> (Also, it requires numfig on, which is silly for sections; want a PR to 
> fix that?) 
>
> Indeed. PRs are always welcome. 
>
 
https://github.com/sphinx-doc/sphinx/pull/4444

>I also don't really want it to be a *link*, unless I can link to a 
> sub-section and get the basic-build full section number (which degenerates 
> into the section number of the parent section). 
>
> AFAIK, there are no way.


Would you consider a PR to add such a feature? And if so, any preference 
for what the role should be named? (My local implementation uses 
:secnumber`, which is a bit of a misnomer since it resolves document names, 
not sections. It's about 15 LOC... one of those is a minor tweak to 
DocReferenceMigrator that I'm not sure is actually needed. Even besides 
that, however, it leverages the guts of StandardDomain, and would likely be 
much, much more complicated to implement as an external feature.)

-- 
Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to