agora-server icon indicating copy to clipboard operation
agora-server copied to clipboard

Heading anchoring

Open bouncepaw opened this issue 3 years ago • 4 comments

As of https://anagora.org/flancia-meet-2022-01-29, we agreed that we need common anchoring rules.

Let's define them here

bouncepaw avatar Jan 29 '22 10:01 bouncepaw

Mycomarkup does it like that: https://github.com/bouncepaw/mycomarkup/blob/742e8e254ff82f0f51ee8ee0b27daf25245dc96d/util/utils.go#L10

bouncepaw avatar Jan 29 '22 10:01 bouncepaw

example from MediaWiki https://www.mediawiki.org/wiki/Help:Links#Internal_links

[[Help:Editing pages#Preview|previewing]]

My logic on this (and most things) is let's not get caught by [[not invented here]] syndrome

If existing paradigms exists, it seems somewhat hostile to not reuse them

codegod100 avatar Jan 29 '22 12:01 codegod100

It looks like DokuWiki uses same syntax https://forum.dokuwiki.org/d/38-internal-links-syntax/4

codegod100 avatar Jan 29 '22 12:01 codegod100

Seems like MediaWiki simply replaces whitespace with _ and uses it as an id for headings, it even saves punctuation marks.

So, a heading with the text Special:Not so special would render with id Special:Not_so_special.

That makes sense.

I propose dropping all octothorps from the heading as well. Issue #1 -> Issue_1. Some bugs related to URL parsing will be avoided this way.

What do we do with markup in headings? I guess we only take their content. So, a Mycomarkup like this:

= A heading with a [[link]]

Would result with a heading with this id: A heading with a link.

bouncepaw avatar Feb 01 '22 17:02 bouncepaw