markdown

package
v0.0.0-...-0fba574 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 13 Imported by: 0

README

markdown-to-confluence/markdown readme

the markdown package is to enable working with and parsing markdown documents

The package contains one exported struct:
// FileContents contains information from a file after being parsed from markdown.
FileContents{}
The package contains one exported function:
// ParseMarkdown is a function that uses external parsing library to grab markdown contents
// and return a filecontents object (a page to be uploaded to confluence wiki)
ParseMarkdown(rootID int, content []byte) (*FileContents, error)

Documentation

Overview

Package markdown provides a method for working with and parsing markdown documents

Index

Constants

This section is empty.

Variables

View Source
var (
	GrabAuthors bool
)

GrabAuthors - do we want to collect authors?

Functions

func Paragraphify

func Paragraphify(content string) string

Paragraphify takes in a .puml file contents and returns a formatted HTML page as a string currently unused

func URLConverter

func URLConverter(page map[string]string, item string, isindex bool, abs string) string

URLConverter function for images to be loaded in to confluence page (they must be in same directory as markdown to work) this function replaces local url paths in html img links with a confluence path for folder page attachments on parent page

Types

type FileContents

type FileContents struct {
	MetaData map[string]interface{}
	Body     []byte
}

FileContents contains information from a file after being parsed from markdown. `Metadata` in the format of a `map[string]interface{}` this can contain title, description, slug etc. `Body` a `[]byte` that contains the resulting HTML after parsing the markdown and converting to HTML using Goldmark.

func ParseMarkdown

func ParseMarkdown(rootID int, content []byte, isIndex bool,
	pages map[string]string, path, abs, fileName string) (*FileContents, error)

ParseMarkdown function uses external parsing library to grab markdown contents and return a filecontents object

Jump to

Keyboard shortcuts

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