Documentation
¶
Index ¶
- func FilesToHtmls(rootDir, styleSheet string, enexFiles []string, webClipOnly bool, ...) error
- func FilesToMarkdowns(rootDir string, htmlToMarkdown func(io.Writer, io.Reader) error, ...) error
- func ToHtmls(rootDir, enexName string, source []byte, styleSheet string, webClipOnly bool, ...) error
- func ToMarkdowns(rootDir, enexName string, source []byte, ...) error
- type Bundle
- type Note
- type Option
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilesToHtmls ¶ added in v0.4.0
func FilesToHtmls(rootDir, styleSheet string, enexFiles []string, webClipOnly bool, wDebug, wLog io.Writer) error
FilesToHtmls converts multiple ENEX files into HTML format. The output HTML files are saved under the directory specified by rootDir, with each ENEX file being processed. The styleSheet is applied to the HTML, and debug and log information are written to wDebug and wLog, respectively. If webClipOnly is true, only the web-clip content will be output without Evernote styling.
func FilesToMarkdowns ¶ added in v0.4.0
func FilesToMarkdowns(rootDir string, htmlToMarkdown func(io.Writer, io.Reader) error, enexFiles []string, wDebug, wLog io.Writer) error
FilesToMarkdowns processes multiple enex files, converts each to markdown, and saves the output in the specified rootDir. The htmlToMarkdown function is used to convert HTML content to markdown. Debug and log information are written to wDebug and wLog, respectively.
func ToHtmls ¶ added in v0.4.0
func ToHtmls(rootDir, enexName string, source []byte, styleSheet string, webClipOnly bool, wDebug, wLog io.Writer) error
ToHtmls converts a single ENEX file into HTML format. The output HTML is saved under the directory specified by rootDir, with enexName as the note name. The content is read from source, the styleSheet is applied to the HTML, and debug and log information is written to wDebug and wLog, respectively. If webClipOnly is true, only the web-clip content will be output without Evernote styling.
func ToMarkdowns ¶ added in v0.4.0
func ToMarkdowns(rootDir, enexName string, source []byte, htmlToMarkdown func(io.Writer, io.Reader) error, wDebug, wLog io.Writer) error
ToMarkdowns converts an ENEX file to markdown format. The output markdown is saved under the directory specified by rootDir, with the file named enexName. The source contains the ENEX data, and the htmlToMarkdown function is used to convert HTML to markdown. Debug and log information are written to wDebug and wLog, respectively.
Types ¶
type Bundle ¶ added in v0.4.1
type Bundle struct { Resource map[string]*Resource BaseName string Dir string // contains filtered or unexported fields }
Bundle is a type that contains information about attachments.
type Note ¶ added in v0.4.0
type Note struct { Title string Content string Resource map[string][]*Resource // filename to the multi resources Hash map[string]*Resource // hash to the one resource }
Note is a type that contains information about note.
type Option ¶ added in v0.4.0
type Option struct { ExHeader string Sanitizer func(string) string WebClipOnly bool // If true, only output the web-clip content without Evernote styling }
Option represents the sanitization method and additional headers, and may store other relevant information for HTML conversion in the future.
type Resource ¶
type Resource struct { Mime string SourceUrl string Hash string FileName string Width int Height int NewFileName string // contains filtered or unexported fields }
Resource represents information about an attachment.