Modify

Opened 6 years ago

Last modified 6 years ago

#13379 new enhancement

Suggest anchors of wiki pages

Reported by: anonymous Owned by: Peter Suter
Priority: normal Component: WikiAutoCompletePlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

Trac allows linking to anchors of wiki page titles: wiki:TracLinks#Linkanchors. It would be nice to suggest the available anchors (like #Linkanchors etc.) after typing wiki:PageName#.

Attachments (3)

T13379_suggest_wikipage_anchors.patch (2.4 KB) - added by Peter Suter 6 years ago.
Screen Shot 2018-03-13 at 10.18.52.png (30.2 KB) - added by Ryan J Ollos 6 years ago.
Screen Shot 2018-03-13 at 10.20.17.png (23.0 KB) - added by Ryan J Ollos 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Peter Suter

comment:1 Changed 6 years ago by Ryan J Ollos

Suggesting the valid page versions would also be useful. That is, after typing wiki:PageName@. A shortened page comment could be included in the suggestion.

Changed 6 years ago by Ryan J Ollos

Changed 6 years ago by Ryan J Ollos

comment:2 Changed 6 years ago by Ryan J Ollos

Minor issue with T13379_suggest_wikipage_anchors.patch, the anchors aren't filtered the way wiki page names are. For example, type C and get a list of pages starting with C:

Type, A, and the list of anchors is not filtered to those starting with A:

comment:3 Changed 6 years ago by Peter Suter

Suggesting the valid page versions would also be useful.

Agreed, good idea.

the anchors aren't filtered

Good point, I forgot we need something like ... if anchor.startswith(term) because "cache": False.

comment:4 Changed 6 years ago by Jun Omae

In the patch, it uses Formatter class to extract header anchors but Formatter class expands macros in wiki text. So that it is slow. I think we should create subclass of Formatter which doesn't expand macros.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Peter Suter.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.