Documentation
¶
Overview ¶
Package adapters contains source-format codecs for rich text documents.
Index ¶
- Constants
- func RegisterCommon(reg *vfs.ContentRegistry) error
- type DOCX
- type HTML
- type XLSX
- func (XLSX) Decode(ctx context.Context, virtualPath, mediaType string, data []byte) (vfs.Document, error)
- func (XLSX) DecodeSheets(ctx context.Context, _, _ string, data []byte) ([]vfs.Sheet, []vfs.NamedRange, error)
- func (XLSX) Encode(ctx context.Context, doc vfs.Document) ([]byte, error)
- func (XLSX) EncodeSheets(ctx context.Context, sheets []vfs.Sheet, _ []vfs.NamedRange) ([]byte, error)
- func (XLSX) MediaTypes() []string
Constants ¶
const DOCXMediaType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
const HTMLMediaType = "text/html"
const XLSXMediaType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Variables ¶
This section is empty.
Functions ¶
func RegisterCommon ¶
func RegisterCommon(reg *vfs.ContentRegistry) error
RegisterCommon registers Word and Excel. HTML stays a TextCodec type unless a host registers adapters.HTML itself — stealing text/html makes .html EROFS. Safe to call more than once on the same registry: existing DOCX/XLSX bindings are left in place (first registration wins).
Types ¶
type DOCX ¶
type DOCX struct{}
DOCX converts the main document part of a Word document. It intentionally operates on the portable WordprocessingML subset used by common editors.
func (DOCX) DecodeBlocks ¶
type HTML ¶
type HTML struct{}
HTML encodes and decodes the pretty HTML dialect used for Docs/Word agent buffers. It is not registered as the text/html file codec (FUSE would steal .html). One heading, paragraph, list item, or table per line.
func (HTML) DecodeBlocks ¶
type XLSX ¶
type XLSX struct{}
XLSX maps workbook.xml / sheetN.xml / sharedStrings.xml / styles.xml to TabularDocument.