Skip to content

c-seeger/markdown2confluence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown2confluence

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 !!!

Supportet Features

  • 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

not yet supported

  • 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.

Installation

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.

Usage

Simple example

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)
}

Advanced examples

see examples for some more usage examples

basic macro support using the following syntax

Jira issue macro

[//]: "jira:<issue-key>"
e.g. [//]: "jira:JIRA-1234"

confluence page links

[//]: "confluence:<page-title>"
e.g. [//]: "confluence:some page title"

ToC macro

[//]: "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

Code Documentation

Releases

No releases published

Packages

No packages published

Languages