1 # Creating an anchor in Markdown
3 Is it a native Markdown "tag" for creating an anchor? Unfortunately,
4 I haven't any information about it at
5 [Markdown syntax](http://daringfireball.net/projects/markdown/syntax) page.
7 Of course, I know that I can use HTML tag to do it,
8 for example <a name="foo" />, but I don't want to mix Markdown
9 and HTML code if it's not necessary.
11 BTW, ikiwiki doesn't displays the #foo anchor in the example
12 ("To link to an anchor inside a page...") at [[WikiLink]] page...
16 > No such syntax exists in markdown. ikiwiki could certainly have a
17 > [[preprocessor_directive|preprocessordirective]] for it, though.
21 >> I'd like to implement such a thing. Joey, what is this supposed to look like?
22 >> `\[[anchor WHATEVER]]`? --[[tschwinge]]
24 >>> Why would you want to use a preprocessor directive for something that can
25 >>> be more shortly and clearly done with plain HTML? Markdown is *designed*
26 >>> to be intermixed with HTML. --[[Joey]]
28 >>>> I tend to disagree.
29 >>>> It just doesn't feel right for me to put HTML code straight into Markdown files.
31 >>>> Quoting <http://daringfireball.net/projects/markdown/>:
33 >>>>> The idea is that a Markdown-formatted document should be publishable as-is, as plain text, *without looking like it’s been marked up with tags or formatting instructions*.
35 >>>> Also, in theorie at least, Markdown might also support other output formats than HTML.
36 >>>> Those wouldn't know about how to deal with the intermingled HTML code.
39 >>>>>Not sure \[[anchor WHATEVER]] looks any better than <a name="WHATEVER">...? --[[sabr]]
41 > The lack of the `#foo` anchor in the anchor example on [[wikilink]]
42 > definitely looks like a bug. --[[JoshTriplett]]
44 >> Fixed that --[[Joey]]
48 Considering a hierarchy like `foo/bar/bar`, I had the need to link from the
49 `foo/bar/bar` page to the `foo/bar` one. It would have been convenient to
50 simply write [[wikilink]]s like `\[[../bar]]` (or even just `\[[..]]`?), but
51 this doesn't work, so I had to resort to using `\[[foo/bar]]` instead.
56 How do I make images clickable? The obvious guess, \[[foo.png|/index]], doesn't work. --[[sabr]]
58 > You can do it using the img plugin. The syntax you suggested would be ambiguous,
59 > as there's no way to tell if the text is meant to be an image or displayed as-is.