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

Finish writing the Mycomarkup doc

I hope...
This commit is contained in:
Timur Ismagilov 2021-07-31 17:27:35 +05:00
parent 448eec3d6f
commit 6313cff4c6
4 changed files with 62 additions and 7 deletions

4
go.mod
View File

@ -3,7 +3,7 @@ module github.com/bouncepaw/mycorrhiza
go 1.16 go 1.16
require ( require (
github.com/bouncepaw/mycomarkup v0.5.9 github.com/bouncepaw/mycomarkup v0.5.10
github.com/go-ini/ini v1.62.0 github.com/go-ini/ini v1.62.0
github.com/gorilla/feeds v1.1.1 github.com/gorilla/feeds v1.1.1
github.com/gorilla/mux v1.8.0 github.com/gorilla/mux v1.8.0
@ -16,4 +16,4 @@ require (
) )
// Use this trick for testing of mycomarkup: // Use this trick for testing of mycomarkup:
// replace github.com/bouncepaw/mycomarkup v0.5.9 => "/Users/bouncepaw/GolandProjects/mycomarkup" // replace github.com/bouncepaw/mycomarkup v0.5.10 => "/Users/bouncepaw/GolandProjects/mycomarkup"

4
go.sum
View File

@ -1,6 +1,6 @@
github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
github.com/bouncepaw/mycomarkup v0.5.9 h1:yzGP4fPxblEwY96BLiyVIuIr+eTMplcDOkWMt3bajuQ= github.com/bouncepaw/mycomarkup v0.5.10 h1:vtq4cU8Cv9y34jO/MpRPIL291CciBxwhFwyy+vxnOmU=
github.com/bouncepaw/mycomarkup v0.5.9/go.mod h1:0n6thlGGgrx2Y/2NaaUH4qHW4v1xJ+EpW7yMFUxNRIg= github.com/bouncepaw/mycomarkup v0.5.10/go.mod h1:0n6thlGGgrx2Y/2NaaUH4qHW4v1xJ+EpW7yMFUxNRIg=
github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU= github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU=
github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=

View File

@ -16,6 +16,7 @@ A Mycomarkup document (which is most often a hypha's text part) consists of //bl
=> /help/en/mycomarkup#List List => /help/en/mycomarkup#List List
=> /help/en/mycomarkup#Quote Quote => /help/en/mycomarkup#Quote Quote
=> /help/en/mycomarkup#Table Table => /help/en/mycomarkup#Table Table
=> /help/en/mycomarkup#Transclusion Transclusion
## Paragraph ## Paragraph
**Paragraphs** are the most ubiquitous blocks. You will use them a lot. **Paragraphs** are the most ubiquitous blocks. You will use them a lot.
@ -63,7 +64,10 @@ Just a paragraph with a couple of [[https://example.org | links]] leading [[nowh
```} ```}
* Just a paragraph with a couple of [[https://example.org | links]] leading [[nowhere]]. * Just a paragraph with a couple of [[https://example.org | links]] leading [[nowhere]].
## Link
### Inline link ### Inline link
**Inline links** are part of a paragraph.
External links can be placed verbatim if they have protocol specified. These links are called autolinks. It may not work as expected sometimes. Supported protocols for autolinks are https, http, gemini, gopher, ftp. External links can be placed verbatim if they have protocol specified. These links are called autolinks. It may not work as expected sometimes. Supported protocols for autolinks are https, http, gemini, gopher, ftp.
* {``` * {```
https://example.org https://example.org
@ -84,8 +88,8 @@ Links to [[hypha | a Hypha]] and [[https://example.org | some website]].
Since hypha names are case-insensitive, these links are basically the same: `[[hypha]]`, `[[Hypha]]`, `[[HYPHA]]`. Since hypha names are case-insensitive, these links are basically the same: `[[hypha]]`, `[[Hypha]]`, `[[HYPHA]]`.
## Rocket link ### Rocket link
**Rocket links** are special links. They take up a whole line. They are not consistent with usual inline links. **Rocket links** are special links. They take up a whole line. They are not consistent with usual inline links. They were taken from [[https://gemini.circumlunar.space/docs/gemtext.gmi | gemtext]].
The display text is written after the first space, not `|`. If you want to link a hypha with spaces in it, replace the spaces with _. The display text is written after the first space, not `|`. If you want to link a hypha with spaces in it, replace the spaces with _.
@ -102,6 +106,20 @@ The display text is written after the first space, not `|`. If you want to link
=> https://example.org Display text => https://example.org Display text
} }
### Relative link addressing
You don't have to write the full hypha name in every link, you can use **relative** links.
Consider you are editing a hypha called //fruit/apple//.
To link //fruit/pear// (a sister hypha) you can write `[\[../pear]]`. To link //fruit/apple/red// (a subhypha) you can write `[\[./red]]`. You can do the same in rocket links, image galleries, transclusion and everywhere else you write hypha names.
There is also a way to link the wiki's non-hypha pages. For example, to link the Recent changes page, you can write `[\[/recent-changes]]`. You should use that rather than write the site's full URL because it may change in the future.
### Link colors
Links come in several colors. Blue links are links to //existing// resources, while red links are links to //non-existent// resources. All external links are considered existing, therefore they are blue. Internal hypha links are always checked for existence.
Note that visited blue links are colored purple but are still called blue links. Moreover, blue links are yellow in the default dark theme.
## Heading ## Heading
There are six levels of **headings**. They consist of some hash signs followed by a space and the heading itself. You can format the heading like a paragraph. You should probably not use level 1 because the hypha name title is already level 1. There are six levels of **headings**. They consist of some hash signs followed by a space and the heading itself. You can format the heading like a paragraph. You should probably not use level 1 because the hypha name title is already level 1.
@ -339,5 +357,41 @@ a | b
c | d c | d
} }
## Transclusion
**Transclusion** is the mechanism of including contents of other hyphae into one hypha.
To include a hypha named `yoghurt`, write a line like that:
```
<= yoghurt
```
In 1,2, the transclusion semantics and syntax were changed. If you were using transclusion before that release, please update your hyphae. For time being, the engine will report transclusion using the old syntax with colon.
Transclusion lines start with a reverse-rocket symbol (`<=`) followed by zero or more spaces. The text on the line before a line break or a pipe character (`|`) is called //target// or //target hypha//. If there is a pipe, the text after it is called //selector//. If there is no pipe, the //selector// is empty. Both //target// and //selector// are stripped of left-side and right-side whitespace before further processing.
```
<= target hypha
<= target hypha |
<= target hypha | selector
```
### Selector
The //selector// specifies what part of the //target// to transclude. The parser checks for these words:
* **full.** Transclude the whole document.
* **text.** Transclude all text.
* **attachment.** Transclude attachment only.
* **description.** Transclude first paragraph only.
* **overview.** Short for both **attachment** and **description**.
If only one of them is found, the corresponding part is transcluded. If several are found, the bigger transclusion is done. If none are found, **overview** is implicitly considered.
Additionally, if the word **blend** is present, the transclusion is rendered without the gray box and the link to the //target// by default.
This is an actual transclusion of a hypha below. It will fail if your wiki does not have this hypha.
<= u
Recursive transclusion is also supported but it is limited to three iterations.
## See also ## See also
=> https://mycorrhiza.wiki/hypha/essay/why_mycomarkup Why it was created => https://mycorrhiza.wiki/hypha/essay/why_mycomarkup Why it was created

View File

@ -600,7 +600,8 @@ kbd {
padding-left: .5rem; padding-left: .5rem;
} }
.help-topics__list ul { .help-topics__list ul {
padding-left: 1rem; padding-left: 1.5rem;
line-height: 1.6rem;
} }
/* /*