converter

package
v0.0.0-...-4d6ee93 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonHtml2MdConverter

type CommonHtml2MdConverter struct {
	Option *Option
}

func (*CommonHtml2MdConverter) Convert

func (hc *CommonHtml2MdConverter) Convert(data []byte) (markdown []byte, err error)

Convert 采用三方库 https://github.com/JohannesKaufmann/html-to-markdown 进行转换

type ContentType

type ContentType int
const (
	HTML ContentType = iota
)

func GetContentTypeByString

func GetContentTypeByString(contentType string) ContentType

type Html2MdConverter

type Html2MdConverter interface {
	// Convert 将指定的数据转换为markdown并返回,
	// 如果转换中出错,则会返回error
	Convert(data []byte) ([]byte, error)
}

Html2MdConverter 数据转换器,会将指定的数据转换为markdown字节流

func NewConverter

func NewConverter(contentType ContentType, option *Option) Html2MdConverter

type Option

type Option struct {
	SaveImgToLocal  bool
	MarkdownPath    string
	ImgRelativePath string
}

Jump to

Keyboard shortcuts

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