move CompileMarkdown to package

This commit is contained in:
Egor Kovetskiy
2019-04-14 13:53:44 +03:00
parent ada6f828ff
commit 5f582e51e6
4 changed files with 83 additions and 84 deletions

View File

@@ -1,19 +1 @@
package main
import "fmt"
type MacroCode struct {
lang string
code []byte
}
func (code MacroCode) Render() string {
return fmt.Sprintf(
`<ac:structured-macro ac:name="code">`+
`<ac:parameter ac:name="language">%s</ac:parameter>`+
`<ac:parameter ac:name="collapse">false</ac:parameter>`+
`<ac:plain-text-body><![CDATA[%s]]></ac:plain-text-body>`+
`</ac:structured-macro>`,
code.lang, code.code,
)
}