In MycorrhizaWiki **mycelia** are used to organize [hyphae](hyphae) in related namespaces. ## Mycelium traits - Every mycelium has any number (0..∞) of hyphae. - Every hypha is part of one mycelium. - Every mycelium has one canonical name and any number of synonyms. - Every wiki has one main mycelium. - They are named by the same scheme as hyphae but they have a colon prefix. ## Mycelium URL - Address a hypha in a particular mycelium: `/:sys/about`. - Address subpage of the hypha above: `/:sys/about/more` - Address a hypha in the main mycelium: `/How/does it work`. - Address a hypha in the main mycelium explicitly: `/:main/How/does it work`. ## Mycelium configuration In your `config.json`, in `"mycelia"` field there is an array of objects. ``` { ... "mycelia": [ { "names": ["main"], "type": "main" }, { "names": ["sys", "system"], "type": "system" }, { "names": ["spec", "special"], "type": "special" }, { "names": ["user","u"], "type": "user" }, { "names": ["tag", "t"], "type": "tag" } ] ... } ``` Each object reprents a mycelium. You can set all their names there. First name in each `"names"` array is a canonical name for the mycelium. Field `"type"` sets the mycelium's type. There are such types: | **Type** | **Description** | | `main` | The main mycelium. There must be exactly one such mycelium in a wiki. | | `system` | Things like scripts, styles and templates go here. There must be exactly one such mycelium in a wiki. | | `special` | Things like utility hyphae and plugin pages go here. It is optional because there are no hyphae or plugins now. | | `user` | Userpages. It is optional because there are no users now. | | `tag` | Pages describing tags. It is optional because there are no tags now. | | `other` | Mycelia without any additional meaning added by the engine. There can be any number of them. | ## How are they stored in the filesystem. For example, `wiki` is your wiki directory and you have configured the mycelia like in the example above. You should have structure like that: ``` wiki/ config.json ← your configuration favicon.ico ← your site icon main/ ← :main, ...most of content goes here sys/ ← :sys ...themes go here spec/ ← :spec ...something goes here user/ ← :user, :u ...user pages go here tag/ ← :tag, :t ...pages describing tags go here ``` There are usual hypha directories inside those mycelial directories. ## Code - Things related to reading the `config.json` go to the `cfg` module. - Most of code related to mycelia is in the `fs` module. - And also check out `handlers.go` and `main.go` for routing of mycelia.