elements

package
v0.0.0-...-1df7839 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanElement

func CleanElement(elem *colly.HTMLElement) string

Returns element preserving inner tags (strong, a, ...)

Types

type Article

type Article struct {
	Title     string
	Published string
	ReadTime  string
	Content   []Element
	Tags      []string
}

func (Article) ToHTML

func (a Article) ToHTML() string

func (Article) ToHtmlFile

func (a Article) ToHtmlFile(path string)

func (Article) ToMarkdown

func (a Article) ToMarkdown() string

func (Article) ToMarkdownFile

func (a Article) ToMarkdownFile(path string)

type Blockquote

type Blockquote struct {
	Name    string
	Content string
}

func (*Blockquote) GetName

func (elem *Blockquote) GetName() string

func (Blockquote) ToHTML

func (b Blockquote) ToHTML() string

func (Blockquote) ToMarkdown

func (b Blockquote) ToMarkdown() string

type CodeBlock

type CodeBlock struct {
	Name    string
	Content string
}

func (*CodeBlock) GetName

func (elem *CodeBlock) GetName() string

func (CodeBlock) ToHTML

func (cb CodeBlock) ToHTML() string

func (CodeBlock) ToMarkdown

func (cb CodeBlock) ToMarkdown() string

type Element

type Element interface {
	GetName() string
	ToMarkdown() string
	ToHTML() string
}

func ExtractDataArticle

func ExtractDataArticle(elem *colly.HTMLElement) Element

type Image

type Image struct {
	Name string
	Id   string
	Base string
	Alt  string
}

func (*Image) GetName

func (elem *Image) GetName() string

func (Image) ToHTML

func (i Image) ToHTML() string

func (Image) ToMarkdown

func (i Image) ToMarkdown() string

type List

type List struct {
	Name   string
	Compts []string
}

func (*List) GetName

func (elem *List) GetName() string

func (List) ToHTML

func (l List) ToHTML() string

func (List) ToMarkdown

func (l List) ToMarkdown() string

type P

type P struct {
	Name    string
	Content string
}

func (*P) GetName

func (elem *P) GetName() string

func (P) ToHTML

func (p P) ToHTML() string

func (P) ToMarkdown

func (p P) ToMarkdown() string

type PlaceHolder

type PlaceHolder struct {
	Name string
	Elem colly.HTMLElement
}

func (*PlaceHolder) GetName

func (elem *PlaceHolder) GetName() string

func (PlaceHolder) ToHTML

func (p PlaceHolder) ToHTML() string

func (PlaceHolder) ToMarkdown

func (p PlaceHolder) ToMarkdown() string

type Title

type Title struct {
	Name    string
	Content string
}

func (*Title) GetName

func (elem *Title) GetName() string

func (Title) ToHTML

func (t Title) ToHTML() string

func (Title) ToMarkdown

func (t Title) ToMarkdown() string

Jump to

Keyboard shortcuts

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