md2conf

package module
v0.0.0-...-b48412f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2018 License: MIT Imports: 5 Imported by: 0

README

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.

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/cseeger-epages/markdown2confluence

If not follow these instructions.

Usage

Simple example
package main

import (
        "fmt"
        "log"

        "github.com/cseeger-epages/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-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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(markdown string) (string, error)

Render creates confluence xhtml code from markdown

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL