Edgewall Software

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 — at Version 16

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.

Change History (19)

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, 15 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.

Note: See TracTickets for help on using tickets.