markdown

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMultiLineText added in v0.6.0

func ConvertMultiLineText(s string, convertDoubleSpaces bool) string

ConvertMultiLineText converts a multi-line text into a suitable Markdown representation.

func EscapeIllegalCharacters added in v0.7.0

func EscapeIllegalCharacters(s string, settings *print.Settings) string

EscapeIllegalCharacters escapes characters which have special meaning in Markdown into their corresponding literal.

func GenerateIndentation added in v0.7.0

func GenerateIndentation(extra int, settings *print.Settings) string

GenerateIndentation generates indentation of Markdown headers with base level of provided 'settings.MarkdownIndent' plus any extra level needed for subsection (e.g. 'Required Inputs' which is a subsection of 'Inputs' section)

func NormalizeURLs added in v0.8.0

func NormalizeURLs(s string, settings *print.Settings) string

NormalizeURLs runs after escape function and normalizes URL back to the original state. For example any underscore in the URL which got escaped by 'EscapeIllegalCharacters' will be reverted back.

func PrintFencedCodeBlock added in v0.8.0

func PrintFencedCodeBlock(code string, language string) (string, bool)

PrintFencedCodeBlock prints codes in fences, it automatically detects if the input 'code' contains '\n' it will use multi line fence, otherwise it wraps the 'code' inside single-tick block. If the fenced is multi-line it also appens an extra '\n` at the end and returns true accordingly, otherwise returns false for non-carriage return.

func Sanitize added in v0.6.0

func Sanitize(markdown string) string

Sanitize cleans a Markdown document to soothe linters.

func SanitizeItemForDocument added in v0.8.0

func SanitizeItemForDocument(s string, settings *print.Settings) string

SanitizeItemForDocument converts passed 'string' to suitable Markdown representation for a document. (including line-break, illegal characters, code blocks etc)

func SanitizeItemForTable added in v0.8.0

func SanitizeItemForTable(s string, settings *print.Settings) string

SanitizeItemForTable converts passed 'string' to suitable Markdown representation for a table. (including line-break, illegal characters, code blocks etc)

func SanitizeName added in v0.7.0

func SanitizeName(name string, settings *print.Settings) string

SanitizeName escapes underscore character which have special meaning in 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