internal

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTagTemplate = "`{{tag}}`"

DefaultTagTemplate format if none specified

View Source
const FrontMatterTemplate = `` /* 477-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Code added in v0.15.0

type Code struct{}

Code replaces div tag stylized to look like code blocks with an actual <pre> tag

func (*Code) ReplaceTag added in v0.15.0

func (r *Code) ReplaceTag(n *html.Node)

ReplaceTag implements the TagReplacer interface

type Converter

type Converter struct {
	TagTemplate         string
	EnableHighlights    bool
	EscapeSpecialChars  bool
	EnableFrontMatter   bool
	FrontMatterTemplate string
	// contains filtered or unexported fields
}

Converter holds configuration options to control conversion

func NewConverter added in v0.15.0

func NewConverter(tagTemplate string, enableFrontMatter, enableHighlights, escapeSpecialChars bool) (*Converter, error)

NewConverter creates a Converter with valid tagTemplate

func (*Converter) Convert

func (c *Converter) Convert(note *enex.Note) (*markdown.Note, error)

Convert an Evernote file to markdown

type EmptyAnchor added in v0.15.0

type EmptyAnchor struct{}

EmptyAnchor removes anchor tags without text

func (*EmptyAnchor) ReplaceTag added in v0.15.0

func (*EmptyAnchor) ReplaceTag(n *html.Node)

ReplaceTag implements the TagReplacer interface

type ExtraDiv added in v0.15.0

type ExtraDiv struct{}

ExtraDiv removes extra line break in tables and lists

func (*ExtraDiv) ReplaceTag added in v0.15.0

func (*ExtraDiv) ReplaceTag(n *html.Node)

ReplaceTag implements the TagReplacer interface

type Media added in v0.15.0

type Media struct {
	// contains filtered or unexported fields
}

Media tag replacer puts a standard HTML <img> tag instead of custom <en-media> tag if it is an image and <a> tag for everything else to be able to download it as a file

func NewReplacerMedia added in v0.15.0

func NewReplacerMedia(resources map[string]markdown.Resource) *Media

NewReplacerMedia creates a Media TagReplacer using resources as a data source

func (*Media) ReplaceTag added in v0.15.0

func (r *Media) ReplaceTag(n *html.Node)

ReplaceTag implements the TagReplacer interface

type NormalizeTodo added in v0.20.0

type NormalizeTodo struct{}

NormalizeTodo replaces style-based checkboxes with tag-based checkboxes.

func (*NormalizeTodo) ReplaceTag added in v0.20.0

func (*NormalizeTodo) ReplaceTag(n *html.Node)

ReplaceTag implements the TagReplacer interface

type TagReplacer added in v0.15.0

type TagReplacer interface {
	ReplaceTag(node *html.Node)
}

TagReplacer allows manipulating HTML nodes in order to present custom tags correctly in Markdown format after conversion

type TextFormatter added in v0.15.0

type TextFormatter struct{}

TextFormatter catches bold and italic, bold takes precedence

func (*TextFormatter) ReplaceTag added in v0.15.0

func (*TextFormatter) ReplaceTag(n *html.Node)

ReplaceTag implements the TagReplacer interface

Jump to

Keyboard shortcuts

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