Feature #17455
openEasier anchor linking / Textile anchor links
0%
Description
I would like to be able to link to other sections of the current page more easily.
Currently, this requires linking to the page and adding the hashtag for the anchor name by substituting spaces for dashes and whatnot.
An example I just set up on a fresh copy of Redmine 2.5.2 for the default wiki page:
h1. Wiki See [[wiki#Helpful-links|Helpful links]] {{macro_list}} h2. Helpful links [[wiki#Wiki|Back to top]]
This style of linking can get quite unwieldy for longer page names and header names. It's also not possible to preview this style of linking in an external Textile-aware editor, so if I'm away from the Redmine installation (internal network), I can't get a rough idea of how the document will look and work.
At least the headers can be given shorter links by the (#ID) tag. But there's no shortcut for just linking to an anchor appearing on the same page, unless I'm missing something, so the best it can currently be is this:
h1(#top). Wiki See [[wiki#Links|Helpful links]] {{macro_list}} h2(#Links). Helpful links [[wiki#top|Back to top]]
If this were a wiki named "Extremely Long and Descriptive Wiki Name", and the section header were so long that even the custom shortened one is something like (#ChapterSectionSubsectionItem) , the linking process looks like this:
See also [[Extremely_Long_and_Descriptive_Wiki_Name#ChapterSectionSubsectionItem|something]] or [[Extremely_Long_and_Descriptive_Wiki_Name#AnotherChapterSectionSubsectionItem|something else]]
As you can imagine, for a larger document with much cross-referencing (see this message, see that message, jump back to such and such message) it gets tedious and almost unmaintainable. What if the wiki page gets renamed?
There is a syntax in textile for linking to anchors on the current page, but currently doesn't work in Redmine:
"Helpful text":#AnchorID
This would yield a much simpler same-page linking style, compatible with external Textile editing/previewing (aside from the use of any Redmine-specific macros or links of course)
e.g.
h1(#top). Wiki See "Helpful links":#Links {{macro_list}} h2(#Links). Helpful links "Back to top":#top
or
See also "something":#ChapterSectionSubsectionItem or "something else":#AnotherChapterSectionSubsectionItem
Related issues
Updated by Jean-Philippe Lang over 10 years ago
- Tracker changed from Defect to Feature
- Subject changed from Easier anchor linking / Textile anchor links not supported to Easier anchor linking / Textile anchor links
Updated by Marc Mengel almost 7 years ago
Note that this used to work back in 2.6.
It appears to have been broken in commit:4f2c5a9945d0a1d83620f5cfb7eb8d19056edc34
https://github.com/redmine/redmine/commit/4f2c5a9945d0a1d83620f5cfb7eb8d19056edc34
There is now a plugin for this:
https://github.com/neopoly/redmine-support_direct_textile_classes_and_ids
This change breaks lots of pages on my formerly 2.6 instance recently upgraded; I'm considering adding the plugin.
Updated by Go MAEDA over 6 years ago
- Related to Patch #16313: Allow to link to an anchor of the current wikipage added
Updated by Go MAEDA almost 6 years ago
You can use [[#Helpful-links]]
instead of [[wiki#Helpful-links]]
to link to a section in the current page since Redmine 4.0.
Updated by Stefan Lindner over 5 years ago
Thats not totally what I would expect. [[#Helpful-links]]
displays #Helpful-links
as link text. I would expect to see Helpful-links
.
Of cource I can write [[#Helpful-links|Helpful-links]]
.
BTW there is no hint for this on the current wiki syntax page