is a markdown to Confluence xhtml converter library using mark library
The implementation is just a markdown parser with some markdown comment syntax to add macro support.
!!! Currently untested !!!
- markdown 2 xhtml
- xhtml fixed for confluence
- additional syntax via markdown comments to use macros
- jira macro implemented
- confluence page macro implemented
- table of contents macro
- attachments, comments, picture upload + xhtml code generation
If you miss some feature implementation, feel free to open an issue or send pull requests. I will take look as soon as possible.
If you already installed GO on your system and configured it properly than its simply:
go get github.com/c-seeger/markdown2confluence
If not follow these instructions.
package main
import (
"fmt"
"log"
"github.com/c-seeger/markdown2confluence"
)
func main() {
markdown := "#some markdown"
// Render xhtml
xhtml, err := md2conf.Render(markdown)
if err != nil {
log.Fatal(err)
}
// confluence xhtml code
fmt.Println(xhtml)
}
see examples for some more usage examples
basic macro support using the following syntax
[//]: "jira:<issue-key>"
e.g. [//]: "jira:JIRA-1234"
[//]: "confluence:<page-title>"
e.g. [//]: "confluence:some page title"
[//]: "toc:<max-level>:<type>:<outlined(true/false)>"
e.g: [//]: "toc:3:list:false"
markdown2confluence can also be used in combination with confluence-go-api see confluence example