#87 Merged
Repository
pepijndevos pepijndevos
Branch
default
Repository
birkenfeld birkenfeld
Branch
default

Hyperlink names to definitions using ctags

Author
  1. Pepijn de Vos avatarPepijn de Vos
Reviewers
Description

Adds an option to the HTML formatter to hyperlink names to the places they are defined. Definitions are found using python-ctags.

See http://wtf.tw/etc/pygments for an example.

Comments (4)

  1. Tim Hatch

    Sorry for the review delay.

    No major objections. I'd prefer setting CTags = None instead of passing after the ImportError, and keying off that later. I think asking for ctags mode and not having ctags installed is a fatal error, so instead of writing to stderr I think an exception is more appropriate (as you have it now, you output the warning, then call _lookup_ctag which now wants to reference TagEntry, which will raise). Fix those and add a test, then I'll take another look.

  2. Pepijn de Vos author

    Great!

    I just started playing with it, and I found one minor issue.

    If you set the tagurlpath to "/somedir/%(path)s/%(fname)s%(fext)s" you get into trouble when path is "", giving "/somedir//file.c". Note the double slash.

    I think the correct solution is to end path with a slash if it is not empty.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.