Tags:
archive_me1Add my vote for this tag create new tag
, view all tags
It would be nice to have an automatic way to specify links within the same page. Currently it needs to be done manually using HTML. Example:
  • HTML "target anchor":
    <A HREF="#jumpA">This is the link</A>
  • HTML "named anchor":
    <A NAME="jumpA">This is where it jumps to</A>

Any ideas of automating this? The point is to find a syntax for specifying named anchors and targets that:

  • is easy to remember,
  • fits the current Wiki Syntax.

-- PeterThoeny - 05 Jul 2000

How about adding to the WikiNamespace? Something along the lines of:

This.AnchorName, Parent.This.AnchorName or WikiWebName.This.AnchorName

or instead of This use Anchor.

-- NicholasLee - 05 Jul 2000
-- PeterThoeny - 15 Jul 2000 (restored from backup)

Relative links in documents are not supported by TWiki. For example it should be possible to write

WikiName#RelLinkName
to link a previously defined mark RelLinkName in the document WikiName. The marks could either be:
  • HTML names: <A NAME="RelLinkName"></A> or
  • WikiStyle short syntax: e.g. #RelLinkName

-- GeraldCzech - 03 Jan 2001 (added by PeterThoeny)

At work we have a need for named anchor jumps. The big question is (as always) to find a syntax that is intuitive, easy to remember and easy to type.

Take one: "The HTML way"

  • Link to named anchor:
    • WebHome#MySection
    • Otherweb.WebHome#MySection
    • [[#MySection]] (link on same topic)
    • [[web home#MySection]]
    • [[Otherweb.web home#MySection]]
  • Define named anchor:
    • #MySection (typed at the beginning of a line)
  • Pros and cons:

Take two: "at some place in a topic"

  • Link to named anchor:
    • WebHome@MySection
    • Otherweb.WebHome@MySection
    • [[@MySection]] (link on same topic)
    • [[web home@MySection]]
    • [[Otherweb.web home@MySection]]
  • Define named anchor:
    • @MySection (typed at the beginning of a line)
  • Pros and cons:
    • [ PeterThoeny ] Pro: Easier to remember, I vote for this.

Take three: "Anchor name space", or "This name space"

  • Link to named anchor:
    • WebHome.Anchor.MySection
    • Otherweb.WebHome.Anchor.MySection
    • [[Anchor.MySection]] (link on same topic)
    • [[web home.Anchor.MySection]]
    • [[Otherweb.web home.Anchor.MySection]]
  • Define named anchor:
    • Anchor.MySection (typed at the beginning of a line)
  • Pros and cons:
    • [ PeterThoeny ] Pro/Con: The OO way
    • [ PeterThoeny ] Con: "Anchor.MySection" looks like a link to a different web.

Questions:

  • Should the anchor jump be hidden or shown? I presume shown.
    • Type:
      Link to SomeTopic@MyAnchor and Otherweb.SomeWhere@AnAnchor.
    • Show:
      Link to SomeTopic@MyAnchor and SomeWhere@AnAnchor.
  • Should the anchor definition be hidden or shown? I presume hidden.
    • Type:
      @MyAnchor and some text.
    • Show:
      and some text.
  • How restrictive should the anchor name be? A WikiName, or any [a-zA-Z0-9_] or something else? If it is not restrictive enough it could have unwanted side-effects when defining an anchor, like in
    @myanchor, or
    #anchor that looks like a comment

Thoughs? (Add new syntax idea; add your opinion regarding existing proposals to the "Pros and cons" bullets.)

-- PeterThoeny - 23 Feb 2001

How about defining an anchor: #WikiName#, or @WikiName@. Then #WikiName# would not be an anchor.

Furthermore, we should keep anchor names in WikiName form as that follows the general WikiWiki way.

If we have something like Section#Anchor, we can spilt on the # boundary and have a link to the Section on the left side of the # and a link to the anchor on the right.

-- NicholasLee - 23 Feb 2001

Implemented the following syntax and commited to TWikiAlphaRelease:

  • Link to named anchor:
    • WebHome#MySection
    • Otherweb.WebHome#MySection
    • [[#MySection]] (link on same topic)
    • [[web home#MySection]]
    • [[Otherweb.web home#MySection]]
    • [[go home][WebHome#MySection]] (See ArbitraryTextForWikiWordLinks)
  • Define named anchor:
    • #MySection (Needs to be a WikiWord; typed at the beginning of a line)

Limitation: The current [[#MySection]] rule fails in included topics! FIXME: Need to add topicName parameter to getRenderedVersion().

-- PeterThoeny - 23 Feb 2001

Due to good feeback I changed the anchor syntax from "@MyAnchor" to "#MyAnchor, e.g. the normal HTML way. Above text is fixed, and commited the change to the TWikiAlphaRelease.

Note: You do not need to create an anchor for each heading; headings have their anchor name automatically built. SectionTitles has more.

-- PeterThoeny - 28 Feb 2001

TopicClassification:
FeatureDone
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2001-03-01 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.