convert

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: MIT Imports: 14 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 struct {
	LinkFormatter           LinkFormatter
	CustomComponentHandlers []CustomComponentHandler
}

func (*Converter) ConvertUrlToAnf

func (c *Converter) ConvertUrlToAnf(url string, siteConfig *SiteConversionConfig) (*article.Article, error)

func (*Converter) HTMLToANF

func (c *Converter) HTMLToANF(url string, htmlBytes []byte, siteConfig *SiteConversionConfig) (*article.Article, error)

func (*Converter) HTMLToANFComponents

func (c *Converter) HTMLToANFComponents(htmlBytes []byte, siteConfig *SiteConversionConfig) ([]components.Component, error)

type CustomComponentHandler

type CustomComponentHandler interface {
	Handle(*goquery.Selection) ([]components.Component, error)
	Matches(*goquery.Selection) bool
}

type DefaultLinkFormatter

type DefaultLinkFormatter struct{}

func (*DefaultLinkFormatter) Format

func (df *DefaultLinkFormatter) Format(inHREF string) string

type LinkFormatter

type LinkFormatter interface {
	Format(string) string
}

type SiteConversionConfig

type SiteConversionConfig struct {
	SectionConversionSelectors []string `json:"sectionConversionSelectors,omitempty"`
	TitleSelector              string   `json:"titleSelector"`
}

func GetSiteConfig

func GetSiteConfig(conversionConfigFilePath string) (*SiteConversionConfig, error)

Jump to

Keyboard shortcuts

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