Documentation
¶
Index ¶
- func Default() *convert.Registry
- func RegisterPlugins(reg *convert.Registry) (plugins []plugin.Plugin, discoverErrs []error, err error)
- type Archive
- type CSV
- type DOCX
- type EML
- type EPUB
- type Feed
- type Fenced
- type HTML
- type Image
- type Ipynb
- type JSON
- type Media
- type ODF
- type PDF
- type PPTX
- type PlainText
- type XLSX
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Default ¶
Default returns a Registry wired with the built-in converters. Lower priority values are tried first: specific structured parsers (0) beat markup/fenced converters (5), which beat the plain-text catch-all (10).
func RegisterPlugins ¶ added in v0.1.1
func RegisterPlugins(reg *convert.Registry) (plugins []plugin.Plugin, discoverErrs []error, err error)
RegisterPlugins loads configured plugin manifests, discovers their capabilities, and registers each ahead of the built-in converters (priority -10, so a plugin can override a built-in format). It returns the discovered plugins and any per-plugin discovery errors (non-fatal). A fatal config-load error is returned separately.
Types ¶
type Archive ¶
Archive converts the entries of a ZIP or TAR archive. Each supported entry is converted via Reg and emitted under a heading. Nested archives are noted but not recursed into, and entry count/byte totals are capped (zip-bomb guard).
type DOCX ¶
type DOCX struct{}
DOCX converts a Word document to Markdown, preserving heading levels (Heading1..N → # ..######), bullet lists (numPr → -), and tables (w:tbl).
type EML ¶
type EML struct{}
EML converts an RFC 822 e-mail: key headers become a small block, then the body. For multipart messages, text/plain is preferred, falling back to text/html (converted to Markdown). Base64 / quoted-printable parts are decoded.
type EPUB ¶
type EPUB struct{}
EPUB converts an e-book by reading its OPF spine order and converting each XHTML document to Markdown via the HTML pipeline.
type Feed ¶
type Feed struct{}
Feed converts an RSS or Atom feed into a title heading plus a list of dated, linked items. Non-feed input returns errNotFeed so the dispatcher falls through to the generic XML converter.
type Fenced ¶
Fenced wraps input verbatim in a language-tagged code fence. Used for config and markup formats whose most faithful Markdown form is the original text (parsing then re-serializing would lose comments and ordering).
type HTML ¶
type HTML struct{}
HTML converts HTML to Markdown via html-to-markdown/v2 (CommonMark output with ATX headings; scripts and styles are dropped by the library).
type Image ¶
type Image struct{}
Image emits format + pixel dimensions for common raster images, and appends OCR text when Tesseract is available.
type Ipynb ¶
type Ipynb struct{}
Ipynb converts a Jupyter notebook (.ipynb) to Markdown: markdown cells are emitted verbatim, code cells as fenced blocks, and text outputs included.
type Media ¶
type Media struct{}
Media converts audio/video files to a Markdown metadata block via ffprobe, optionally appending a transcript when the `whisper` CLI is available.
type ODF ¶
type ODF struct{}
ODF converts ODT/ODS/ODP files by reading content.xml, mapping text:h outline-level → #..######, text:p → paragraphs (or list items inside text:list), and table:table → Markdown tables.
type PDF ¶
type PDF struct{}
PDF extracts text from a PDF. It prefers poppler's `pdftotext -layout` when available (better spacing/layout), falls back to a pure-Go reader, and as a last resort OCRs scanned PDFs when Tesseract + pdftoppm are present.
type PPTX ¶
type PPTX struct{}
PPTX converts a PowerPoint deck to Markdown: each slide becomes "## Slide N" (or "## Slide N: <title>" with a title placeholder), with body text emitted as bullets honoring lvl, and embedded tables (a:tbl in a graphicFrame) rendered as Markdown tables.
type PlainText ¶
type PlainText struct{}
PlainText is the generic catch-all converter (priority 10). It treats the input as text and passes it through unchanged.