#3225 closed enhancement (fixed)
[PATCH] Configurable shortening of headings in wiki
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.10 |
Component: | wiki system | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Little patch to configure (via trac.ini) the shortening of headings in wiki formatting.
usage
If you don't want headings to be shortened, apply this patch and add the following line in your trac.ini in the wiki section :
[wiki] shorten_headings = false
rationale
We tend to use [wiki:PathToPage Some more descriptive text here], and discovered that when doing this in a heading, the heading text was shortened - before wiki links were resolved. This somewhat screw up our nice page headings !-), so I choose the shortest path : making this configurable. Thanks to you guys, this took me no more than 5 minutes - which is a sure proof that you did a pretty good work.
Attachments (3)
Change History (13)
by , 18 years ago
Attachment: | shorten_headings.diff added |
---|
comment:1 by , 18 years ago
Summary: | Configurable shortening of headings in wiki → [PATCH] Configurable shortening of headings in wiki |
---|
added [PATCH] in the summary.
comment:2 by , 18 years ago
Milestone: | → 0.10 |
---|---|
Owner: | changed from | to
Well, I'd rather say we should never shorten headings. Why should we?
by , 18 years ago
Attachment: | shorten_headings.2.diff added |
---|
configurable shortening of headings (with correct support in PageOutline)
comment:3 by , 18 years ago
Well, I'd rather say we should never shorten headings. Why should we?
Well, at least, this patch leaves the choice to the user. I made it so the default was to keep existing behaviour, but it's quite easy to change this too !-)
comment:4 by , 18 years ago
I think there's no reason to shorten a heading, and I actually introduced the shortening in r3353 by mistake… So r3365 fixed this.
The only place where this would make sense is in the outliner formatter (the one used to produce a clickable index of the page). There, if the heading is split at the wrong place, it's less important than having a compact view of the document's structure.
See also related #2064, for the problem of splitting in the middle of a link with alias.
comment:5 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r3365 (forgot to close it in previous comment)
comment:6 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I believe there's been a regression on this issue. The current OutlineFormatter
hardcodes to "shorten" on line 1403 of formatter.py. I've hardcoded my own installation to not do this (over at http://www.sqlalchemy.org/trac/wiki/FAQ , these headings were being chopped before), attached is a patch (not tested) that sets it based on whether or not the 'inline' flag is set on PageOutlineMacro
.
by , 14 years ago
Attachment: | page_outline_shortening.patch added |
---|
restore "dont shorten lines in PageOutline inline"
follow-up: 8 comment:7 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:8 by , 14 years ago
Replying to rblank:
I believe that this was left on purpose (according to comment:4). There are other tickets about avoiding cutting through e.g. links (#7792, #2064), so these should solve the "ugliness" issue.
its not clear here, or from those referenced tickets, if there are plans to maintain the behavior that "inline" outline links are not truncated at all. this is not the same as a global "truncate" setting like that suggested in #7792. The issue is that it makes no sense at all to truncate the text when using the "outline" setting. As you can see from my linked FAQ page, the outline is totally useless if the links are truncated, people can't read the full text of the questions.
Do I need to write my own trac plugin for this purpose ?
comment:9 by , 14 years ago
Oh, sorry, I misunderstood. Your patch only prevents shortening on inline page outlines. That makes sense, yes. Or maybe we could add a separate option shorten=False
to control the shortening behavior.
Would you mind opening a separate ticket for this? Re-using a 4-year old ticket closed against a milestone makes it a bit difficult to track. You can target it to 0.12.1 and assign it to me. Thanks.
comment:10 by , 14 years ago
i created #9391.
this ticket seemed like a good first start as this does seem to be a regression.
patch to trac/wiki/formatter.py