Adding "Mycomarkup" as a custom renderer
Author | Topic |
---|---|
mysh
|
Posted on
This markup language is used in the Mycorrhiza wiki engine. Documentation on Mycomarkup can be found here: https://mycorrhiza.wiki/help/en/mycomarkup ImplementationFirst import Mycomarkup v5: And then we can follow the process of creating a custom renderer as in adding Blackfriday markdown renderer. Let's create //go:build mycomarkup // +build mycomarkup package syntax import ( "git.sr.ht/~bouncepaw/mycomarkup/v5" "git.sr.ht/~bouncepaw/mycomarkup/v5/mycocontext" "git.sr.ht/~bouncepaw/mycomarkup/v5/options" "strings" ) var opts = options.Options{ HyphaName: "", WebSiteURL: "", TransclusionSupported: false, RedLinksSupported: false, InterwikiSupported: false, }.FillTheRest() func Convert(gmi string, wrap bool) string { clearedString := strings.ReplaceAll(gmi, "\r\n", "\n") ctx, _ := mycocontext.ContextFromStringInput(clearedString, opts) return mycomarkup.BlocksToHTML(ctx, mycomarkup.BlockTree(ctx)) } And then we can compile CaveatsSince mycomarkup has some special sauce called Last edited on |