converter

package
v0.0.0-...-3300c06 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	Convert(localPath string, opt Options) (result DocumentConvertResult, err error)
}

type DocumentConvertResult

type DocumentConvertResult struct {
	Title   string
	Content string
}

type DocxConverter

type DocxConverter struct {
}

func GetDocxConverter

func GetDocxConverter() *DocxConverter

func (*DocxConverter) Convert

func (c *DocxConverter) Convert(localPath string, opt Options) (result DocumentConvertResult, err error)

type HTMLConverter

type HTMLConverter struct {
}

func GetHTMLConverter

func GetHTMLConverter() *HTMLConverter

func (*HTMLConverter) Convert

func (c *HTMLConverter) Convert(localPath string, opt Options) (result DocumentConvertResult, err error)

type Node

type Node struct {
	XMLName xml.Name
	Attrs   []xml.Attr `xml:"-"`
	Content []byte     `xml:",innerxml"`
	Nodes   []Node     `xml:",any"`
}

Node is

func (*Node) UnmarshalXML

func (n *Node) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML is

type Numbering

type Numbering struct {
	XMLName     xml.Name `xml:"numbering"`
	Text        string   `xml:",chardata"`
	Wpc         string   `xml:"wpc,attr"`
	Cx          string   `xml:"cx,attr"`
	Cx1         string   `xml:"cx1,attr"`
	Mc          string   `xml:"mc,attr"`
	O           string   `xml:"o,attr"`
	R           string   `xml:"r,attr"`
	M           string   `xml:"m,attr"`
	V           string   `xml:"v,attr"`
	Wp14        string   `xml:"wp14,attr"`
	Wp          string   `xml:"wp,attr"`
	W10         string   `xml:"w10,attr"`
	W           string   `xml:"w,attr"`
	W14         string   `xml:"w14,attr"`
	W15         string   `xml:"w15,attr"`
	W16se       string   `xml:"w16se,attr"`
	Wpg         string   `xml:"wpg,attr"`
	Wpi         string   `xml:"wpi,attr"`
	Wne         string   `xml:"wne,attr"`
	Wps         string   `xml:"wps,attr"`
	Ignorable   string   `xml:"Ignorable,attr"`
	AbstractNum []struct {
		Text                       string         `xml:",chardata"`
		AbstractNumID              string         `xml:"abstractNumId,attr"`
		RestartNumberingAfterBreak string         `xml:"restartNumberingAfterBreak,attr"`
		Nsid                       TextVal        `xml:"nsid"`
		MultiLevelType             TextVal        `xml:"multiLevelType"`
		Tmpl                       TextVal        `xml:"tmpl"`
		Lvl                        []NumberingLvl `xml:"lvl"`
	} `xml:"abstractNum"`
	Num []struct {
		Text          string  `xml:",chardata"`
		NumID         string  `xml:"numId,attr"`
		AbstractNumID TextVal `xml:"abstractNumId"`
	} `xml:"num"`
}

Numbering is

type NumberingLvl

type NumberingLvl struct {
	Text      string  `xml:",chardata"`
	Ilvl      string  `xml:"ilvl,attr"`
	Tplc      string  `xml:"tplc,attr"`
	Tentative string  `xml:"tentative,attr"`
	Start     TextVal `xml:"start"`
	NumFmt    TextVal `xml:"numFmt"`
	LvlText   TextVal `xml:"lvlText"`
	LvlJc     TextVal `xml:"lvlJc"`
	PPr       struct {
		Text string `xml:",chardata"`
		Ind  struct {
			Text    string `xml:",chardata"`
			Left    string `xml:"left,attr"`
			Hanging string `xml:"hanging,attr"`
		} `xml:"ind"`
	} `xml:"pPr"`
	RPr struct {
		Text string `xml:",chardata"`
		U    struct {
			Text string `xml:",chardata"`
			Val  string `xml:"val,attr"`
		} `xml:"u"`
		RFonts struct {
			Text string `xml:",chardata"`
			Hint string `xml:"hint,attr"`
		} `xml:"rFonts"`
	} `xml:"rPr"`
}

NumberingLvl is

type Options

type Options struct {
	FileExtention string
	Url           string
	OutputPath    string
}

type PDFConverter

type PDFConverter struct {
}

func GetPDFConverter

func GetPDFConverter() *PDFConverter

func (*PDFConverter) Convert

func (c *PDFConverter) Convert(localPath string, opt Options) (result DocumentConvertResult, err error)

type Relationship

type Relationship struct {
	Text       string `xml:",chardata"`
	ID         string `xml:"Id,attr"`
	Type       string `xml:"Type,attr"`
	Target     string `xml:"Target,attr"`
	TargetMode string `xml:"TargetMode,attr"`
}

Relationship is

type Relationships

type Relationships struct {
	XMLName      xml.Name       `xml:"Relationships"`
	Text         string         `xml:",chardata"`
	Xmlns        string         `xml:"xmlns,attr"`
	Relationship []Relationship `xml:"Relationship"`
}

Relationships is

type SourceContentType

type SourceContentType string
const (
	PDF   SourceContentType = "pdf"
	HTML  SourceContentType = "html"
	DOCX  SourceContentType = "docx"
	EXCEL SourceContentType = "excel"
)

type TextVal

type TextVal struct {
	Text string `xml:",chardata"`
	Val  string `xml:"val,attr"`
}

TextVal is

type XlsxConverter

type XlsxConverter struct {
}

func GetXlsxConverter

func GetXlsxConverter() *XlsxConverter

func (*XlsxConverter) Convert

func (c *XlsxConverter) Convert(localPath string, opt Options) (result DocumentConvertResult, err error)

Jump to

Keyboard shortcuts

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