Opened 8 years ago

Closed 7 years ago

#6954 enhancement closed invalid (invalid)

Allow anchors in apilinks

Reported by: Adi Roiban Owned by: Adi Roiban
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

Right now, apilinks extension for sphinx does not allow adding a anchor/hash in the URL.

anchors are useful for linking to a specific method.

Attachments (1)

6954-1.diff (1.1 KB) - added by Adi Roiban 8 years ago.
https://github.com/chevah/twisted/compare/6954-apilinks-anchor

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by Adi Roiban

Keywords: review added
Owner: Adi Roiban deleted

This patch add support for adding anchors to apilinks, basically for linking to methods.

With the current code:

:api:`twisted.web.iweb.IRequest#getSession <IRequest.getSession()>`.

would generate

twisted.web.iweb.IRequest#getSession.html

with the patch it will generate

twisted.web.iweb.IRequest.html#getSession

It also updates the gitignore file to not include documentation build files.

There are no tests or topfiles.

I did not add the topfile since this should only be useful for developers.

I did not add tests since I was lazy.

Thanks!

comment:2 Changed 8 years ago by Glyph

Keywords: review removed
Owner: set to Adi Roiban

All branches must contain a topfile; the trunk commit hook will reject anything that doesn't, so it's not a matter of what your feelings are regarding a change :-). .misc topfiles are supposed to be empty, so if it's not relevant to mention in NEWS, that's how you explicitly omit it.

Also, the only reason I've previously allowed changes to this file without tests is that it's not really supposed to be part of Twisted. It should move into pydoctor, and it can have testing in there somehow.

If you'd really like to make this change in Twisted, we should bite the bullet and add some tests somehow. Otherwise can you figure out how to move it into pydoctor (since it is to generate links from sphinx to pydoctor-generated stuff) and fix it there?

comment:3 Changed 8 years ago by Adi Roiban

Keywords: review added
Owner: Adi Roiban deleted

Hi,

Thanks. I agree that file should go into pydoctor.

I am still new to Twisted and I don't know all external tools used in Twisted.

Then, should I rename this ticket into:

Update to latest PyDoctor and remove duplicated apilinks.py 

or should I just close this ticket and open a new one?

comment:5 Changed 8 years ago by Adi Roiban

I have also submitted the patch upstream... with tests.

Please comment on the merge request regarding how would you like to see this extension distributed so that we don't have to keep duplicate copies in twisted repo.

https://code.launchpad.net/~adiroiban/pydoctor/1282458-apilinks-anchor/+merge/207392

Thanks!

comment:6 Changed 7 years ago by Glyph

Keywords: review removed
Owner: set to Adi Roiban

I don't think that there's anything to do on the Twisted side with this bug right now; since it's not actionable, I'm going to close it. When the code has been merged into pydoctor, please open a new ticket, or re-open this one with the re-naming that you suggest (remove duplicated apilinks.py)

comment:7 Changed 7 years ago by Glyph

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.