#7124 closed enhancement (fixed)
TitleIndex (optionally) does not show pages shipped with Trac
Reported by: | Owned by: | ||
---|---|---|---|
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 |
||
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)
Change History (21)
by , 17 years ago
Attachment: | trac-0.11b-wiki-macros.diff added |
---|
comment:1 by , 17 years ago
Keywords: | consider added |
---|---|
Milestone: | 0.11 → 0.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 , 16 years ago
Milestone: | 0.11.2 → 0.12 |
---|---|
Owner: | changed from | to
'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 , 16 years ago
Milestone: | 0.13 → 0.12 |
---|
Hmm. Batch update of milestones? Moving back to 0.12.
comment:4 by , 16 years ago
Keywords: | newhelp added |
---|
comment:5 by , 16 years ago
Summary: | Improved TitleIndex macro: optionally ignores pages shipped with Trac → TitleIndex (optionally) does not show pages shipped with Trac |
---|
by , 16 years ago
Attachment: | trac-0.11.2-wiki-macros.patch added |
---|
Omit pages equals to or starting with world listed in colon separated list
comment:6 by , 16 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 , 16 years ago
Owner: | changed from | to
---|
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 , 15 years ago
Cc: | added |
---|
comment:9 by , 15 years ago
Milestone: | 0.12 → next-minor-0.12.x |
---|---|
Owner: | changed from | to
Nice ideas. I'll implement them, but after 0.12.
comment:10 by , 15 years ago
Keywords: | bitesized added |
---|
comment:11 by , 14 years ago
Milestone: | next-minor-0.12.x → next-major-0.1X |
---|
by , 14 years ago
Attachment: | trac-0.13.dev-wiki-macros.patch added |
---|
Patch to allow extra filtering in the TitleIndex macro
comment:12 by , 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 , 14 years ago
Milestone: | next-major-0.1X → 0.13 |
---|---|
Priority: | normal → high |
Nice patch, thanks!
comment:14 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Simplified patch committed in [10025]. The changes were the following:
- Changed the semantics so that a missing
include
argument means "all pages", andexclude
takes precedence overinclude
. 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 usedfnmatchcase()
instead, which is always case-sensitive. - Made the filtering use a more "functional" style.
comment:15 by , 14 years ago
Owner: | changed from | to
---|
comment:16 by , 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 , 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 , 14 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.
TitleIndex optionally ignores built-in pages