# Wikilink RFC

All parsers for MycorrhizaWiki provide hyperlink support. Usually, they follow HTML convention.

- `http://example.org/absolute-path`
- `/rooted-path`
- `same-folder-path`
- `../parent-folder-path`

This is not really convenient for wikis where most of links are either rooted or links to children!

All parsers of MycorrhizaWiki are expected to support these types of links and convert them to rooted paths.

- `http://example.org/absolute-path`
- `hypha in main mycelium`
- `::hypha in the same mycelium`
- `:mycelium/hypha in an explicit mycelium`
- `/subhypha`
- `./subhypha`
- `../sibling-hypha`

**TODO:** create a package that implements this thing. NB: to generate a correct link, it is required to know full name of hypha where the link is used.

## Markdown extension

> This is an extension to markdown's syntax that is used in MycorrhizaWiki and nowhere else.

Text wrapped in `[[` and `]]` is a link that has same text and url. *For some reason it's not possible in Markdown without duplicating url*

```
[[x]] == [x](x)
```

## Examples

All examples assume that `:example/test` is the current hypha.

```
wikilink              actual path
foo                   == /foo
::foo                 == /:example/foo
:bar/foo              == /:bar/foo
/baz                  == /:example/test/baz
./baz                 == /:example/test/baz
../qux                == /:example/qux
http://example.org    == http://example.org
gemini://example.org  == gemini://example.org
mailto:me@example.org == mailto:me@example.org
```
