transformer

package
v0.0.0-...-a740060 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DocToJSON

func DocToJSON(doc *docs.Document, imageFolder string, supportCodeBlock bool, breakPages bool) ([]Page, []*TocHeading)

DocToJSON Convert docs api response to json

func JSONToMD

func JSONToMD(json []Tag) string

JSONToMD convert json to markdown

func ReplaceImage

func ReplaceImage(fullURLFile string) (string, []byte)

ReplaceImage fetch image from the link

Types

type CodeBlock

type CodeBlock struct {
	Lang    string
	Content []string
}

type ImageObject

type ImageObject struct {
	Source      string
	Title       string
	Description string
}

type Page

type Page struct {
	Title    string
	Contents []Tag
}

type Table

type Table struct {
	Header []string
	Rows   [][]string
}

type Tag

type Tag struct {
	Name    string
	Content TagContent
}

type TagContent

type TagContent struct {
	Text  string
	Image ImageObject
	Table
	CodeBlock
	List []string
}

type TocHeading

type TocHeading struct {
	HeadingID string        `json:"headingId"`
	Text      string        `json:"text"`
	Indent    float64       `json:"indent"`
	Items     []*TocHeading `json:"items"`
}

Jump to

Keyboard shortcuts

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