Edgewall Software
Modify

Opened 16 years ago

Closed 14 years ago

Last modified 13 years ago

#7124 closed enhancement (fixed)

TitleIndex (optionally) does not show pages shipped with Trac

Reported by: TJ <support@…> Owned by: mark.m.mcmahon@…
Priority: high Milestone: 1.0
Component: wiki system Version: 0.11b2
Severity: normal Keywords: consider newhelp bitesized
Cc: ryano@… Branch:
Release Notes:

TitleIndex macro supports new exclude and include arguments

API Changes:
Internal Changes:

Description

I wanted to have TitleIndex on the front page of my Trac but didn't want the clutter of listing all the pages that are shipped with it.

I've created a patch for class TitleIndexMacro to achieve my aims. There's an additional parameter ignore. When set to 1 TitleIndex will not list the built-in pages. E.g.

[[TitleIndex(format=group,ignore=1)]]

If ignore=0 or is omitted then it lists all pages.

Attachments (3)

trac-0.11b-wiki-macros.diff (1.5 KB ) - added by TJ <support@…> 16 years ago.
TitleIndex optionally ignores built-in pages
trac-0.11.2-wiki-macros.patch (1.4 KB ) - added by marek.lukacs@… 15 years ago.
Omit pages equals to or starting with world listed in colon separated list
trac-0.13.dev-wiki-macros.patch (4.9 KB ) - added by mark.m.mcmahon@… 14 years ago.
Patch to allow extra filtering in the TitleIndex macro

Download all attachments as: .zip

Change History (21)

by TJ <support@…>, 16 years ago

Attachment: trac-0.11b-wiki-macros.diff added

TitleIndex optionally ignores built-in pages

comment:1 by Christian Boos, 16 years ago

Keywords: consider added
Milestone: 0.110.11.1

Well, that's an useful feature, but I don't think your current implementation is suitable (e.g. ignoring all 'Inter*' files). A better approach would be to explicitly ignore all pages in the list of known help pages.

But have a look at TracDev/Proposals/NewHelp branch. I think this won't even be necessary once we switch to this.

comment:2 by osimons, 16 years ago

Milestone: 0.11.20.12
Owner: changed from Christian Boos to osimons

'Cluttering' of the wiki by help pages is a major reason for NewHelp. Moving this to 0.12 - currently the target for this branch.

comment:3 by osimons, 16 years ago

Milestone: 0.130.12

Hmm. Batch update of milestones? Moving back to 0.12.

comment:4 by anonymous, 15 years ago

Keywords: newhelp added

comment:5 by anonymous, 15 years ago

Summary: Improved TitleIndex macro: optionally ignores pages shipped with TracTitleIndex (optionally) does not show pages shipped with Trac

by marek.lukacs@…, 15 years ago

Omit pages equals to or starting with world listed in colon separated list

comment:6 by marek.lukacs@…, 15 years ago

I did it in different way. I added new options to TitleIndex macro: omit=colon:separated:list:of:words and omitstartswith=colon:separated:list:of:words.

For omitting pages shipped with trac I use:

[[TitleIndex(omit=CamelCase:PageTemplates:RecentChanges:SandBox:TitleIndex,omitstartswith=Inter:Trac:Wiki)]]

comment:7 by Christian Boos, 15 years ago

Owner: changed from osimons to Christian Boos

Hm, why not just have include/exclude fnmatch patterns?

e.g. your example:

[[TitleIndex(include=*,exclude=Inter*:Trac*:Wiki*:CamelCase:PageTemplates:RecentChanges:SandBox:TitleIndex,)]]

Other examples:

  • replacing startswith (or is it prefix? I never know ;-))
    [[TitleIndex(include=TracDev/*)]]
    
  • listing only first sub-level:
    [[TitleIndex(include=TracDev/*,exclude=TracDev/*/*)]]
    

comment:8 by Ryan Ollos <ryano@…>, 15 years ago

Cc: ryano@… added

comment:9 by Remy Blank, 14 years ago

Milestone: 0.12next-minor-0.12.x
Owner: changed from Christian Boos to Remy Blank

Nice ideas. I'll implement them, but after 0.12.

comment:10 by Remy Blank, 14 years ago

Keywords: bitesized added

comment:11 by Christian Boos, 14 years ago

Milestone: next-minor-0.12.xnext-major-0.1X

by mark.m.mcmahon@…, 14 years ago

Patch to allow extra filtering in the TitleIndex macro

comment:12 by mark.m.mcmahon@…, 14 years ago

I also liked include and exclude more than omit as they seem more consistent.

I have coded it up, and it seems to work well - I added a few tests also (included in the patch).

comment:13 by Remy Blank, 14 years ago

Milestone: next-major-0.1X0.13
Priority: normalhigh

Nice patch, thanks!

comment:14 by Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Simplified patch committed in [10025]. The changes were the following:

  • Changed the semantics so that a missing include argument means "all pages", and exclude takes precedence over include. This is consistent with the examples in comment:7.
  • The case-sensitiveness of the fnmatch.filter() function depends on the OS, so two tests were failing here (on Linux). I used fnmatchcase() instead, which is always case-sensitive.
  • Made the filtering use a more "functional" style.

comment:15 by Remy Blank, 14 years ago

Owner: changed from Remy Blank to mark.m.mcmahon@…

comment:16 by Christian Boos, 14 years ago

Release Notes: modified (diff)

The TitleIndex page could use this, for example with an explicit list of the default wiki pages: first as exclude to show the site specific pages, then in a second call, with include, to show the help pages.

comment:17 by geroleinemann@…, 14 years ago

The parameters "include" and "exclude" are documented on "http://trac.edgewall.org/wiki/WikiMacros" for v.0.12, but not available in the tag/distribution v0.12 (but on the trunk, ready for v0.13).

comment:18 by mail@…, 13 years ago

I was hit by the issue mentioned in comment 17. It would be great to have r10025 applied to 0.12.3 it works without a problem on my installation.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain mark.m.mcmahon@….
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mark.m.mcmahon@… to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.