Documentation
¶
Overview ¶
Package converter provides bookmark export/converter tooling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WithAtomStylesheet, _ = ctxr.WithChecker[string](ctxAtomStylesheetKey{})
WithAtomStylesheet sets an XSL stylesheet URL to the context.
var (
WithEnableEPUBNotes, _ = ctxr.WithChecker[bool](ctxEnableEPUBNotesKey{})
)
Context helpers.
Functions ¶
This section is empty.
Types ¶
type AtomExporter ¶
type AtomExporter struct {
dataset.HTMLConverter
}
AtomExporter is an Exporter that produces an Atom feed.
func NewAtomExporter ¶
func NewAtomExporter() AtomExporter
NewAtomExporter return a new AtomExporter instance.
type BrowserExporter ¶
type BrowserExporter struct{}
BrowserExporter is an IterExporter that produces a browser bookmark file.
func (BrowserExporter) IterExport ¶
func (e BrowserExporter) IterExport(_ context.Context, w io.Writer, r *http.Request, bookmarkSeq *dataset.BookmarkIterator) error
IterExport implements IterExporter.
type CSVExporter ¶
type CSVExporter struct{}
CSVExporter is an IterExporter that produces a CSV file.
func (CSVExporter) IterExport ¶
func (e CSVExporter) IterExport(_ context.Context, w io.Writer, _ *http.Request, bookmarkSeq *dataset.BookmarkIterator) error
IterExport implements IterExporter.
type EPUBEmailExporter ¶
type EPUBEmailExporter struct {
// contains filtered or unexported fields
}
EPUBEmailExporter is a content exporter that send converted bookmarks as EPUB attachment by emails.
func NewEPUBEmailExporter ¶
func NewEPUBEmailExporter(to string, options ...email.MessageOption) EPUBEmailExporter
NewEPUBEmailExporter returns an NewEPUBEmailExporter instance.
type EPUBExporter ¶
type EPUBExporter struct {
dataset.HTMLConverter
Collection *bookmarks.Collection
}
EPUBExporter is a content exporter that produces EPUB files.
func NewEPUBExporter ¶
func NewEPUBExporter() EPUBExporter
NewEPUBExporter returns a new EPUBExporter instance.
func (EPUBExporter) IterExport ¶
func (e EPUBExporter) IterExport(ctx context.Context, w io.Writer, r *http.Request, bookmarkSeq *dataset.BookmarkIterator) error
IterExport implements IterExporter. It writes an EPUB file on the provided io.Writer.
type Exporter ¶
type Exporter interface {
Export(ctx context.Context, w io.Writer, r *http.Request, bookmarkList *dataset.BookmarkList) error
}
Exporter describes a bookmarks exporter.
type HTMLEmailExporter ¶
type HTMLEmailExporter struct {
dataset.HTMLConverter
// contains filtered or unexported fields
}
HTMLEmailExporter is a content exporter that send bookmarks by emails.
func NewHTMLEmailExporter ¶
func NewHTMLEmailExporter(to string, options ...email.MessageOption) HTMLEmailExporter
NewHTMLEmailExporter returns a new HTMLEmailExporter instance.
type IterExporter ¶
type IterExporter interface {
IterExport(ctx context.Context, w io.Writer, r *http.Request, bookmarkSeq *dataset.BookmarkIterator) error
}
IterExporter describes a bookmarks exporter that works with an iterator.
type MarkdownExporter ¶
type MarkdownExporter struct {
dataset.HTMLConverter
}
MarkdownExporter is a content exporter that produces markdown.
func NewMarkdownExporter ¶
func NewMarkdownExporter() MarkdownExporter
NewMarkdownExporter returns a new MarkdownExporter instance.
func (MarkdownExporter) IterExport ¶
func (e MarkdownExporter) IterExport(ctx context.Context, w io.Writer, r *http.Request, bookmarkSeq *dataset.BookmarkIterator) error
IterExport implement IterExporter. It can write text only articles (the default) separated by an horizontal rule. If the request contains "Accept: multipart/alternative", it returns a multipart response that contains images for the exported bookmarks.
type SyncExporter ¶
type SyncExporter struct {
dataset.HTMLConverter
// contains filtered or unexported fields
}
SyncExporter is a content exporter for content sync. It exports every item from the select dataset as a multipart/alternative response into a writer.
func NewSyncExporter ¶
func NewSyncExporter(options ...SyncOption) SyncExporter
NewSyncExporter returns a new SyncExporter.
func (SyncExporter) IterExport ¶
func (e SyncExporter) IterExport(ctx context.Context, w io.Writer, _ *http.Request, bookmarkSeq *dataset.BookmarkIterator) error
IterExport implements IterExporter. It writes parts to a multipart/mixed response.
type SyncOption ¶
type SyncOption func(*SyncExporter)
SyncOption is a SyncExporter option.
func WithSyncHTML ¶
func WithSyncHTML(v bool) SyncOption
WithSyncHTML enables or disables HTML (articles) export.
func WithSyncJSON ¶
func WithSyncJSON(v bool) SyncOption
WithSyncJSON enables or disables JSON information export.
func WithSyncMarkdown ¶
func WithSyncMarkdown(v bool) SyncOption
WithSyncMarkdown enables or disables markdown export.
func WithSyncResourcePrefix ¶
func WithSyncResourcePrefix(v string) SyncOption
WithSyncResourcePrefix set the resource prefix put in front of every bookmark's resource. It also triggers a replacement in the bookmark's article when there is one. "%" is placeholder for the bookmark's ID.
func WithSyncResources ¶
func WithSyncResources(v bool) SyncOption
WithSyncResources enables or disables exporting images.