1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-13 05:50:27 +00:00

Add some RFCs

This commit is contained in:
Timur Ismagilov 2020-07-04 01:26:26 +05:00
parent 283dd49d8d
commit e2e25a05e7
4 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# Plugin system RFC
MycorrhizaWiki engine does not provide all the functionality a wiki may need and not need. Instead, it relies on the system of plugins.
## Types of plugins
- **Parser.** They add support for displaying different MIME-types.
- **Utilities.** They add hyphae to the `:spec` mycelium. These hyphae provide administrative functionality.
- **Macros.** Something like [moinmoin ones](http://moinmo.in/HelpOnMacros), I guess.
## Default plugins
Default MycorrhizaWiki distributive is shipped with several plugins installed.
- **parser/markdown.** Support for `text/markdown`.
- **parser/gemini.** Support for `text/gemini`.
- *what other markups to ship? I don't want to have markdown as the main one. Textile? ReST? Asciidoc is too complex, so let's not choose it.*
- **utility/rename.** Renaming of non-user hyphae.
- *what else?*
- **macro/toc.** Table of contents.
- *what else?*
## Plugin implementation
All plugins are written in Go and are compiled together with MycorrhizaWiki. If a wiki's admin decides to add a plugin, they shall recompile the engine with the plugin.
> Reminds of [something](http://suckless.org/), right?
*But compiling the engine just to add a plugin is stupid!!* Not really. Also, it makes the architecture more simple and secure.
*What if an admin doesn't know how to program?* Plugin installation is basically limited to putting some files into a folder, editing the config and running a shell command. No programming required to install a plugin.

View File

@ -0,0 +1,19 @@
{
"views": 0,
"deleted": false,
"revisions": {
"1": {
"tags": [
""
],
"name": "Plugin",
"comment": "Update :Main/Help/Plugin",
"author": "",
"time": 1593806875,
"text_mime": "text/markdown",
"binary_mime": "",
"text_name": "1.markdown",
"binary_name": ""
}
}
}

View File

@ -0,0 +1,46 @@
# 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/baz
./baz == /:example/baz
../qux == /:example/qux
```

View File

@ -0,0 +1,19 @@
{
"views": 0,
"deleted": false,
"revisions": {
"1": {
"tags": [
""
],
"name": "Wikilink",
"comment": "Update :Main/Help/Wikilink",
"author": "",
"time": 1593807908,
"text_mime": "text/markdown",
"binary_mime": "",
"text_name": "1.markdown",
"binary_name": ""
}
}
}