Zim-desktop-wiki: Allow to create link inside the current page

Created on 26 Nov 2019  路  8Comments  路  Source: zim-desktop-wiki/zim-desktop-wiki

I think link inside a page could be useful sometimes. When the page is rather long, with many titles, it would be nice to be able to add a link in the text to a section of the page.
The Table of Content can scroll the page to a given point, but if there are many titles, it's much easier to just click on the text you are reading rather than search for the title in the ToC. Also, a link allows to have a text different from the title.
Using a # as first character of the link would indicate it's an anchor, like in HTML.

enhancement

Most helpful comment

If we could treat headings as anchors and link to them like [[foo:bar#heading]], that would be fantastic.

All 8 comments

But what about link to certain title in TOC ?

I don't understand what you mean... Maybe you mean the same as I meant in my initial post...?

Then I do not understand - what it is " link inside a page" - link from ??? to ???

It's like in HTML : <a href="#anchor"> a link inside the page. The ToC already provides this, I think it would be nice to be able to create the same links inside the page, wherever we need it.

If we could treat headings as anchors and link to them like [[foo:bar#heading]], that would be fantastic.

Simple but neat feature...

I've wondered about this a bit, too - does Markdown have this feature?

Markdown itself does not have this feature, because it's just a formatting syntax. Some converters extensions allow this, like https://github.com/webuni/commonmark-attributes-extension for example.
Most of the time, you need to manipulate the AST produced by the markdown parser, to add IDs on headings, for example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CharlesNepote picture CharlesNepote  路  6Comments

markfink picture markfink  路  6Comments

ppsilva picture ppsilva  路  7Comments

neokeld picture neokeld  路  6Comments

muguu picture muguu  路  6Comments