ivy

package module
v0.0.0-...-72caf3e Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 16 Imported by: 0

README


Unit Tests Go Reference Releases Discord Discussion

ivy

ivy decodes, renders and encodes the file formats that a program shows as images, in pure Go:

  1. Ebooks: EPUB, MOBI, AZW3, FictionBook, CHM, DjVu, comic book archives and the other formats that calibre reads.
  2. Office documents: Word, Excel and PowerPoint, OpenDocument, RTF and CSV.
  3. Page descriptions: PDF, XPS, PostScript, EPS, Adobe Illustrator, EMF and WMF.
  4. Images with layers: Photoshop, OpenRaster and Krita.
  5. Containers that carry an icon or a preview: Apple disk images, applications and packages for macOS, iOS, Android, Windows and Linux, and camera RAW files.

ivy also opens a file that a password protects, where the format has a public method of encryption.

A program that imports ivy needs the Go toolchain and nothing else. ivy does not use cgo and does not run an outside program. Each format is a package of its own, so a program links only the formats that it imports.

ivy draws each page with okage, and a program finds the type of a file with magic before it calls ivy. A rendering is good enough for a person to review the document. It is not an exact copy of the rendering of the program that made the document.

Status

Phases 1 to 6 are done. These packages open a file and give its previews, its pages or both:

Package Formats
github.com/xo/ivy/odf OpenDocument, with a password: the pages of the texts, the spreadsheets, the presentations and the drawings, and the thumbnail
github.com/xo/ivy/docx Word, with a password: the pages, the thumbnail and the properties
github.com/xo/ivy/xlsx Excel, with a password: every sheet on pages, as printing does, the thumbnail and the properties. The cells show the values that the file holds, and no formula is computed
github.com/xo/ivy/pptx PowerPoint, with a password: one page for each slide that is not hidden, the thumbnail and the properties
github.com/xo/ivy/rtf RTF: the pages, and the title, the author and the dates of \info
github.com/xo/ivy/iwork Pages, Keynote and Numbers: the previews
github.com/xo/ivy/ora OpenRaster and Krita: the image and the thumbnail
github.com/xo/ivy/ps PostScript and EPS: the pages, through an interpreter of PostScript (D29), the TIFF and EPSI previews of EPS, and the title and the creator
github.com/xo/ivy/camera The RAW files of cameras: the JPEG images, the camera and the date
github.com/xo/ivy/comic CBZ and CBT: the pages and the cover
github.com/xo/ivy/psd Photoshop: the image and the thumbnail
github.com/xo/ivy/xps XPS and OpenXPS: the pages, the thumbnail, and the title and the authors
github.com/xo/ivy/pdf PDF, with its password, and Illustrator compatible with PDF: the pages, the thumbnails, and the document information
github.com/xo/ivy/epub EPUB 2, EPUB 3 and kepub: the pages, the cover, and the title and the authors
github.com/xo/ivy/mobi MOBI, PRC, AZW, AZW3 and AZW4: the pages, the cover, and the title and the authors
github.com/xo/ivy/fb2 FictionBook 2, also in a zip archive: the pages, the cover, and the title and the authors
github.com/xo/ivy/chm Compiled HTML Help: the pages, the title and the language
github.com/xo/ivy/html HTML and HTMLZ: the pages, the cover of an HTMLZ file, and the title
github.com/xo/ivy/text Text and TXTZ: the pages, the cover of a TXTZ file, and the metadata of a TXTZ file
github.com/xo/ivy/msdoc Word 97 to 2003, .doc and .dot, with a password: the pages, the thumbnail, and the title, the author and the dates
github.com/xo/ivy/msxls Excel 97 to 2003 and Excel 5, .xls and .xlt, with a password: every sheet on pages, the thumbnail and the properties
github.com/xo/ivy/msppt PowerPoint 97 to 2003, .ppt, .pps and .pot, with a password: one page for each slide, with its texts, the thumbnail and the properties
github.com/xo/ivy/vsdx Visio: the pages, the thumbnail and the properties of .vsdx, .vsdm, .vstx and .vstm. The thumbnail and the properties of .vsd, .vst, .vss and the stencils
github.com/xo/ivy/pub Publisher: the thumbnail and the properties
github.com/xo/ivy/csv CSV, TSV and TAB: the rows as one table on pages
github.com/xo/ivy/djvu DjVu, single and bundled: the pages, the thumbnails, and the title, the authors and the dates of the metadata
github.com/xo/ivy/emf EMF, EMF+ and WMF, also compressed as EMZ and WMZ: the page, and the program and the title of an EMF file
github.com/xo/ivy/markdown Markdown, with the extensions of GitHub: the pages and the title

The other formats come in the phases of docs/PLAN.md.

Using

f, err := os.Open("photo.psd")
if err != nil {
	return err
}
defer f.Close()
fi, err := f.Stat()
if err != nil {
	return err
}
doc, err := psd.Open(ctx, io.NewSectionReader(f, 0, fi.Size()))
if err != nil {
	return err
}
defer doc.Close()
page, err := doc.Page(ctx, 0)
if err != nil {
	return err
}
img, err := ivy.RenderImage(ctx, page, 72, color.White)

A program that renders Office documents can import the module github.com/xo/ivy/fonts and set ivy.Config{Fonts: fonts.FS()}. The module holds Liberation Sans, Serif and Mono, Carlito and Caladea, which have the metrics of Arial, Times New Roman, Courier New, Calibri and Cambria. Lines and pages then break as they do in Office. It also holds Droid Sans Fallback, under the Apache License 2.0, which draws the Chinese, Japanese and Korean characters that a document does not embed. The module adds about 10.9 MB to a program.

A document that has no pages, such as a camera RAW file, gives its preview:

img, err := ivy.BestPreview(ctx, doc, image.Pt(512, 512))

Formats

docs/FORMATS.md lists each format that ivy can support, the way to support it, its source and its cost. docs/PLAN.md gives the order.

Documents

Document What it holds
docs/PLAN.md the plan, the architecture, the testing plan, the phases and the open questions
docs/API.md the design of the public API and the expected layout of the packages
docs/FORMATS.md the survey of the formats, with the estimates of three outside models
docs/BACKLOG.md the work that is known and not done, and the work for okage, magic and iv
docs/UPSTREAM.md the rules for code that ivy copies or ports
docs/decisions/ every decision, one file each, with an index
CONTRIBUTING.md how to change ivy
AGENTS.md the rules for a coding agent, which also hold for a person

ivy is one of the xo projects. Several of them port a library of C or Rust to pure Go. Each one is a separate repository:

Project What it is
okage A Go port of tiny-skia and resvg, which draws 2D graphics and SVG images. ivy draws with it
magic A Go port of libmagic, which identifies the type of a file
transit A Go port of tree-sitter, a parser of source code
rline A readline package for Go, which reads a line of text that a person edits. It started as a port of isocline
zuzu Draws DOT graphs, Mermaid diagrams, and Vega and Vega-Lite charts
ox Parses the flags and arguments of a command line
usql A command line client for SQL and NoSQL databases

iv, an image viewer for the terminal, is the first program that uses ivy. ivy replaces the outside programs and the libraries that iv uses through cgo for ebooks, XPS, Office documents, PDF and HTML.

License

The code of ivy is under the MIT license, in LICENSE. A package that ivy copies or ports from another project keeps the license of that project, in a LICENSE file in its folder. psd/internal/oovpsd is a copy of github.com/oov/psd, under the MIT license.

Documentation

Overview

Package ivy holds the document API that every format of ivy shares (D11).

ivy decodes and renders the file formats that a program shows as images, in pure Go: documents, ebooks, page descriptions, images with layers, and containers that carry an icon or a preview. Each format is a package of its own, such as github.com/xo/ivy/psd, and this package imports none of them (D6). A program finds the type of a file with github.com/xo/magic, and opens the file with the package of that format.

A format returns its own type of document. A program finds what the document can do with a type assertion:

if pager, ok := doc.(ivy.Pager); ok {
	page, err := pager.Page(ctx, 0)
	if err != nil {
		return err
	}
	img, err := ivy.RenderImage(ctx, page, 144, color.White)
	...
}

A page draws onto an okage.Pixmap. A document that carries images of its content, such as a thumbnail or an icon, is a Previewer, and BestPreview decodes the one that is closest to a wanted size.

A rendering is good enough when a person can review the document with it (D5). It is not an exact copy of the rendering of the program that made the document.

Index

Constants

View Source
const (
	// DefaultMaxMemory is the default of Limits.MaxMemory: 512 MiB.
	DefaultMaxMemory = 512 << 20
	// DefaultMaxPixels is the default of Limits.MaxPixels: 256 million
	// pixels, such as an image of 16384 by 16384.
	DefaultMaxPixels = 1 << 28
	// DefaultMaxObjects is the default of Limits.MaxObjects.
	DefaultMaxObjects = 1 << 20
	// DefaultMaxDepth is the default of Limits.MaxDepth.
	DefaultMaxDepth = 64
)

The default limits.

Variables

View Source
var (
	Letter = Paper{Width: 612, Height: 792}
	Legal  = Paper{Width: 612, Height: 1008}
	A4     = Paper{Width: 595.28, Height: 841.89}
	A5     = Paper{Width: 419.53, Height: 595.28}
)

The common papers, in portrait.

Functions

func BestPreview

func BestPreview(ctx context.Context, d Document, want image.Point) (image.Image, error)

BestPreview decodes the preview of d that is closest in size to want, and prefers one that is larger. A zero want asks for the largest preview. If the decode of a preview fails, BestPreview tries the next one. It returns ErrNoPreview if d is not a Previewer or lists no preview.

func Pages

func Pages(ctx context.Context, p Pager) iter.Seq2[Page, error]

Pages iterates over the pages of p, in order, until the last page. It stops after the first error.

func RenderImage

func RenderImage(ctx context.Context, p Page, dpi float32, bg color.Color) (image.Image, error)

RenderImage renders p at dpi dots per inch over bg, and returns the image (D11). A nil bg leaves the background transparent. A page of a raster image renders at its own size at 72 dots per inch.

A large page renders in bands of rows, on up to one goroutine for each CPU and at most 8 (D47). Each band calls Render with a pixmap of its own, so Render must be safe for concurrent use, as D11 says. The pixels do not depend on the number of CPUs.

If the page is drawn only in part, RenderImage returns the image and a *PartialError.

func RenderPages

func RenderPages(ctx context.Context, p Pager, pages []int, dpi float32, bg color.Color) iter.Seq2[image.Image, error]

RenderPages renders the pages of p whose numbers are in pages, from 0, at dpi over bg, as RenderImage does, and yields the image and the error of each in the order of pages (D47). It renders up to one page for each CPU at the same time, and the bands of each page one after the other, so the pixels are the same as those of RenderImage. It renders at most as many pages ahead of the page that it yields as it has goroutines. A page past the last page yields an error that wraps ErrPageRange. When the loop stops early, RenderPages stops its goroutines before it returns.

Types

type Cache

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

Cache holds the fonts of the system, the fonts that documents embed, and the transforms of ICC profiles, and shares them between documents. It is safe for concurrent use. There is no global cache.

The formats of phase 1 hold no fonts and no ICC profiles, so the cache is empty until the fonts of phase 2.

func NewCache

func NewCache() *Cache

NewCache returns an empty cache.

type Config

type Config struct {
	// Password opens a file that a password protects (D12).
	Password string
	// PasswordFunc asks for a password. ivy calls it once for each attempt,
	// from attempt 1, while the password is wrong. It stops when the function
	// returns an error.
	PasswordFunc func(ctx context.Context, attempt int) (string, error)
	// Decrypt decodes a resource that DRM with a key protects. Only the
	// module drm gives such a function (D12). The format passes the resource
	// and its license, and it never decodes the DRM itself.
	Decrypt func(ctx context.Context, scheme string, license, data []byte) ([]byte, error)
	// Logger receives the log of the format. A nil Logger logs nothing.
	Logger *slog.Logger
	// Limits bound the work on one document.
	Limits Limits
	// Cache shares the fonts and the ICC profiles between documents. A nil
	// Cache gives each document a cache of its own.
	Cache *Cache
	// SystemFonts lets a format that lays out text, such as an ebook, use
	// the fonts of the system, after the fonts that the document embeds and
	// the fonts that ivy bundles. Without it, ivy reads no font of the
	// system, and a page looks the same on each machine (D23).
	SystemFonts bool
	// Fonts holds font files that a format that lays out text uses after
	// the fonts that the document embeds, and before the fonts of the
	// system, such as fonts.FS of the module github.com/xo/ivy/fonts. A
	// font of Fonts also replaces a font of Microsoft Office with the same
	// metrics that the document names and does not embed, such as Carlito
	// for Calibri (D24). The format reads TrueType, OpenType, WOFF and
	// WOFF2 files within Limits, and ignores the other files.
	Fonts fs.FS
	// Paper is the page of a document whose file gives none, such as a
	// text file, an HTML file or an ebook. The zero Paper keeps the default
	// of the format, US Letter in portrait (D32).
	Paper Paper
}

Config is the configuration that every format shares. A program gives it to a format with the option WithConfig of the format. The zero Config is valid.

func (Config) Log

func (cfg Config) Log() *slog.Logger

Log returns the logger of the configuration. It returns a logger that discards each record when Logger is nil.

type Describer

type Describer interface {
	Describe(ctx context.Context) (Info, error)
}

Describer is a document that says what it is: its title, its authors and its dates.

type Document

type Document interface {
	// Close releases the caches of the document. It does not close the
	// source. A second call does nothing.
	Close() error
}

Document is an open file. Each format returns its own type, and the type also satisfies the capabilities that the format has: Pager, Previewer and Describer. A Document is safe for concurrent use.

type Error

type Error string

Error is a sentinel error of ivy. Every format returns these errors, or wraps them with %w, and declares no sentinel error of its own (D11). A program tests for one with errors.Is.

const (
	// ErrPassword is returned when a password is missing or wrong.
	ErrPassword Error = "password is missing or wrong"
	// ErrDRM is returned when a file holds DRM that ivy does not decode.
	ErrDRM Error = "file holds drm that ivy does not decode"
	// ErrNoPreview is returned when a file holds no preview.
	ErrNoPreview Error = "file holds no preview"
	// ErrPageRange is returned for a page past the last page.
	ErrPageRange Error = "page out of range"
	// ErrFormat is returned for a malformed file.
	ErrFormat Error = "malformed file"
	// ErrUnsupported is returned for a feature that ivy does not support.
	ErrUnsupported Error = "feature not supported"
	// ErrLimit is returned when a file exceeds a limit of its configuration.
	ErrLimit Error = "limit exceeded"
)

The sentinel errors.

func (Error) Error

func (err Error) Error() string

Error satisfies the error interface.

type Format

type Format struct {
	// Name is the name of the format, such as "psd".
	Name string
	// Mimes are the mime types of the format.
	Mimes []string
	// Exts are the extensions of the format, without the leading dot.
	Exts []string
	// Open opens a document with the default options of the format and the
	// configuration cfg.
	Open func(ctx context.Context, src Source, cfg Config) (Document, error)
}

Format describes a format package for the registry of a program. ivy holds no registry (D6). Each format package exports a Format value, and a program builds its own registry from the values of the packages that it imports.

type Info

type Info struct {
	Title    string
	Authors  []string
	Subject  string
	Language string
	Created  time.Time
	Modified time.Time
	// Producer is the program or the device that made the document.
	Producer string
	// Publisher is the publisher of the document, such as the publisher of
	// a book.
	Publisher string
	// Identifier is an identifier of the document that its file gives, such
	// as an ISBN, a UUID or an ASIN, as the file writes it.
	Identifier string
}

Info is what a document says about itself. A field is empty when the document does not say it.

type Limits

type Limits struct {
	// MaxMemory is the number of bytes that the document can allocate for
	// one decoded part, such as one image or one entry of an archive.
	MaxMemory int64
	// MaxPixels is the number of pixels of the largest image that the
	// document decodes.
	MaxPixels int64
	// MaxObjects is the number of objects, entries or records that the
	// document reads.
	MaxObjects int
	// MaxDepth is the depth of nesting that the document follows.
	MaxDepth int
}

Limits bound the work on one document, because each file is input from a stranger (D5). A field that is zero or less takes its default. The context bounds the time.

func (Limits) WithDefaults

func (lim Limits) WithDefaults() Limits

WithDefaults returns the limits, with the default in each field that is zero or less.

type Page

type Page interface {
	// Size returns the size of the page in points, 1/72 of an inch, after
	// its rotation. A page of a raster image has one point for each pixel.
	Size() (width, height float32)
	// Render draws the page onto dst. t maps the points of the page onto the
	// pixels of dst. Render draws over what dst holds, so a program fills
	// the background first. If Render draws the page only in part, it
	// returns a *PartialError, and dst holds the part.
	Render(ctx context.Context, dst *okage.Pixmap, t okage.Transform) error
}

Page is one page of a document. Render is safe for concurrent use when each call has its own pixmap.

type Pager

type Pager interface {
	// PageCount returns the number of pages. For a flow of text, such as an
	// EPUB, it lays out the whole document on its first call.
	PageCount(ctx context.Context) (int, error)
	// Page returns page n, from 0. It returns ErrPageRange past the last
	// page. For a flow of text, it lays out only as far as page n.
	Page(ctx context.Context, n int) (Page, error)
}

Pager is a document with pages.

type Paper

type Paper struct {
	Width, Height float32
}

Paper is the size of a page in points, 1/72 inch. The zero Paper is the default of the format.

func (Paper) Landscape

func (p Paper) Landscape() Paper

Landscape returns p with its longer side across.

func (Paper) Portrait

func (p Paper) Portrait() Paper

Portrait returns p with its longer side down.

type PartialError

type PartialError struct {
	Err error
}

PartialError reports a page that Render drew only in part. The pixmap holds the part. Err is the cause.

func (*PartialError) Error

func (err *PartialError) Error() string

Error satisfies the error interface.

func (*PartialError) Unwrap

func (err *PartialError) Unwrap() error

Unwrap returns the cause.

type Preview

type Preview struct {
	// Kind is the kind of the preview.
	Kind PreviewKind
	// Size is the size in pixels, or zero if the file does not say it before
	// the decode.
	Size image.Point
	// Decode decodes the image.
	Decode func(ctx context.Context) (image.Image, error)
}

Preview is one image that a document carries.

type PreviewKind

type PreviewKind int

PreviewKind is the kind of a preview.

const (
	// Thumbnail is a small image of a page.
	Thumbnail PreviewKind = iota
	// Icon is the icon of an application or of a volume.
	Icon
	// Cover is the cover of a book.
	Cover
	// Background is the background of a disk image.
	Background
)

The kinds of preview.

func (PreviewKind) String

func (kind PreviewKind) String() string

String satisfies the fmt.Stringer interface.

type Previewer

type Previewer interface {
	// Previews lists the previews. Each one decodes only on demand.
	Previews(ctx context.Context) iter.Seq2[Preview, error]
}

Previewer is a document that carries images of its content (D11).

type Source

type Source interface {
	io.ReaderAt
	Size() int64
}

Source is the input of a document. *bytes.Reader, *strings.Reader and *io.SectionReader satisfy it. For an *os.File, use io.NewSectionReader.

The caller owns the source. A document reads it until Close, and Close does not close it. A document reads the source from more than one goroutine, so ReadAt must be safe for concurrent use, as the contract of io.ReaderAt says.

Directories

Path Synopsis
Package camera opens the RAW files of digital cameras.
Package camera opens the RAW files of digital cameras.
Package chm opens the help files of Microsoft, Compiled HTML Help, whose extension is .chm.
Package chm opens the help files of Microsoft, Compiled HTML Help, whose extension is .chm.
Package comic opens comic book archives: CBZ, a zip archive of images, and CBT, a tar archive of images.
Package comic opens comic book archives: CBZ, a zip archive of images, and CBT, a tar archive of images.
Package csv opens files of values separated by commas, semicolons, tabs or vertical bars: .csv, .tsv and .tab.
Package csv opens files of values separated by commas, semicolons, tabs or vertical bars: .csv, .tsv and .tab.
Package djvu opens DjVu documents, and renders their pages.
Package djvu opens DjVu documents, and renders their pages.
internal/bzz
Package bzz implements the DjVu BZZ decompressor (ZP-coded Burrows-Wheeler).
Package bzz implements the DjVu BZZ decompressor (ZP-coded Burrows-Wheeler).
internal/doc
Package doc provides the DjVu document model: pages, layers, annotations.
Package doc provides the DjVu document model: pages, layers, annotations.
internal/iff
Package iff parses the IFF85 chunk structure of DjVu files.
Package iff parses the IFF85 chunk structure of DjVu files.
internal/iw44
Package iw44 decodes IW44 wavelet images (BG44, FG44).
Package iw44 decodes IW44 wavelet images (BG44, FG44).
internal/jb2
Package jb2 decodes JB2 bilevel images (DjVu v3 spec, appendix 2) into their structure: shape dictionaries and blits.
Package jb2 decodes JB2 bilevel images (DjVu v3 spec, appendix 2) into their structure: shape dictionaries and blits.
internal/zp
Package zp implements the DjVu ZP-coder (adaptive binary arithmetic decoder), following the DjVu v3 spec, appendix 3.
Package zp implements the DjVu ZP-coder (adaptive binary arithmetic decoder), following the DjVu v3 spec, appendix 3.
Package docx opens Word files in Office Open XML: docx, dotx, docm and dotm.
Package docx opens Word files in Office Open XML: docx, dotx, docm and dotm.
Package emf opens Windows metafiles: EMF, EMF+ and WMF, and their compressed forms EMZ and WMZ.
Package emf opens Windows metafiles: EMF, EMF+ and WMF, and their compressed forms EMZ and WMZ.
Package epub opens EPUB 2 and EPUB 3 files, and the kepub files of Kobo, which are EPUB files.
Package epub opens EPUB 2 and EPUB 3 files, and the kepub files of Kobo, which are EPUB files.
Package fb2 opens FictionBook 2 files: an .fb2 file, which is XML, and a zip archive that holds one, such as .fb2.zip or .fbz.
Package fb2 opens FictionBook 2 files: an .fb2 file, which is XML, and a zip archive that holds one, such as .fb2.zip or .fbz.
Package html opens HTML files and HTMLZ files.
Package html opens HTML files and HTMLZ files.
internal
ccitt
Package ccitt decodes images of CCITT fax data.
Package ccitt decodes images of CCITT fax data.
charset
Package charset decodes text in the encodings that the WHATWG Encoding Standard names, such as windows-1251, KOI8-R, Shift_JIS and GBK.
Package charset decodes text in the encodings that the WHATWG Encoding Standard names, such as windows-1251, KOI8-R, Shift_JIS and GBK.
chart
Package chart reads the charts of the Office formats and draws them onto the display list of D10.
Package chart reads the charts of the Office formats and draws them onto the display list of D10.
display
Package display is the display list of D10.
Package display is the display list of D10.
drawingml
Package drawingml holds the code that the formats share to draw DrawingML and the shapes of the slides: PowerPoint, Word, Excel, and the presentations and the drawings of OpenDocument.
Package drawingml holds the code that the formats share to draw DrawingML and the shapes of the slides: PowerPoint, Word, Excel, and the presentations and the drawings of OpenDocument.
ebook
Package ebook holds the code that the formats of ebooks share: the OPF package of EPUB, HTMLZ and TXTZ, the style sheets that give the size of the page and the default fonts, the decode of text, the language of a plain text, the head and the first image of an HTML document, and the page that shows a cover image.
Package ebook holds the code that the formats of ebooks share: the OPF package of EPUB, HTMLZ and TXTZ, the style sheets that give the size of the page and the default fonts, the decode of text, the language of a plain text, the head and the first image of an HTML document, and the page that shows a cover image.
ebook/ebooktest
Package ebooktest holds the helpers that the tests of the formats of ebooks share: the ink of a rendered page, the size of the pages on the paper of a program, and the rendering of the first page of a document in a fuzz test.
Package ebooktest holds the helpers that the tests of the formats of ebooks share: the ink of a rendered page, the size of the pages on the paper of a program, and the rendering of the first page of a document in a fuzz test.
fixture
Package fixture builds small files in memory for the tests of ivy: images, zip archives and tar archives.
Package fixture builds small files in memory for the tests of ivy: images, zip archives and tar archives.
font
Package font is the font layer of D10.
Package font is the font layer of D10.
fontdb
Package fontdb gives the font database of a program: the fonts that a format draws the text with when the document does not embed them.
Package fontdb gives the font database of a program: the fonts that a format draws the text with when the document does not embed them.
goldmark
Package goldmark implements functions to convert markdown text to a desired format.
Package goldmark implements functions to convert markdown text to a desired format.
goldmark/ast
Package ast defines AST nodes that represent markdown elements.
Package ast defines AST nodes that represent markdown elements.
goldmark/extension
Package extension is a collection of builtin extensions.
Package extension is a collection of builtin extensions.
goldmark/extension/ast
Package ast defines AST nodes that represents extension's elements
Package ast defines AST nodes that represents extension's elements
goldmark/parser
Package parser contains stuff that are related to parsing a Markdown text.
Package parser contains stuff that are related to parsing a Markdown text.
goldmark/renderer
Package renderer renders the given AST to certain formats.
Package renderer renders the given AST to certain formats.
goldmark/renderer/html
Package html implements renderer that outputs HTMLs.
Package html implements renderer that outputs HTMLs.
goldmark/testutil
Package testutil provides utilities for unit tests.
Package testutil provides utilities for unit tests.
goldmark/text
Package text provides functionalities to manipulate texts.
Package text provides functionalities to manipulate texts.
goldmark/util
Package util provides utility functions for the goldmark.
Package util provides utility functions for the goldmark.
gowemf
Package gowemf parses WMF, EMF and embedded EMF+ containers, decodes supported record families, and streams typed commands with object/state checks.
Package gowemf parses WMF, EMF and embedded EMF+ containers, decodes supported record families, and streams typed commands with object/state checks.
gowemf/internal/bidi
Package bidi implements the Unicode Bidirectional Algorithm (UAX #9) for one line of text: resolving embedding levels (rules P2–P3, X1–X10, W1–W7, N0–N2, I1–I2), resetting trailing whitespace (L1) and reordering (L2).
Package bidi implements the Unicode Bidirectional Algorithm (UAX #9) for one line of text: resolving embedding levels (rules P2–P3, X1–X10, W1–W7, N0–N2, I1–I2), resetting trailing whitespace (L1) and reordering (L2).
gowemf/internal/raster
Package raster is the reference rasterizer used only by tests and render oracles.
Package raster is the reference rasterizer used only by tests and render oracles.
hayro/cmap
Package cmap is a port of the Rust crate hayro-cmap, a parser of the CMap files that PDF files hold.
Package cmap is a port of the Rust crate hayro-cmap, a parser of the CMap files that PDF files hold.
hayro/interpret
Package interpret is a port of the crate hayro-interpret, which interprets the content of the pages of PDF files.
Package interpret is a port of the crate hayro-interpret, which interprets the content of the pages of PDF files.
hayro/kurboext
Package kurboext holds the items of the Rust crate kurbo that the port of hayro needs, and that the subset of kurbo in okage does not hold.
Package kurboext holds the items of the Rust crate kurbo that the port of hayro needs, and that the subset of kurbo in okage does not hold.
hayro/pdffont
Package pdffont is a port of the Rust crate hayro-font, which reads the fonts of PDF files.
Package pdffont is a port of the Rust crate hayro-font, which reads the fonts of PDF files.
hayro/postscript
Package postscript is a port of the Rust crate hayro-postscript, a small scanner of PostScript.
Package postscript is a port of the Rust crate hayro-postscript, a small scanner of PostScript.
hayro/render
Package render is a port of the crate hayro of hayro (D14, D16).
Package render is a port of the crate hayro of hayro (D14, D16).
hayro/syntax
Package syntax is a port of the crate hayro-syntax, a library that reads PDF files at a low level.
Package syntax is a port of the crate hayro-syntax, a library that reads PDF files at a low level.
jbig2
Package jbig2 decodes JBIG2 images, as ITU-T T.88 (ISO/IEC 14492) defines them.
Package jbig2 decodes JBIG2 images, as ITU-T T.88 (ISO/IEC 14492) defines them.
jpeg2000
Package jpeg2000 decodes JPEG 2000 images: raw codestreams (.j2c) and images in the JP2 container format.
Package jpeg2000 decodes JPEG 2000 images: raw codestreams (.j2c) and images in the JP2 container format.
layout
Package layout is the layout of D10: a port of the layout of WeasyPrint (D15, D21).
Package layout is the layout of D10: a port of the layout of WeasyPrint (D15, D21).
memfs
Package memfs holds files in memory as an fs.FS.
Package memfs holds files in memory as an fs.FS.
metafile
Package metafile draws a Windows metafile onto the display list of D10.
Package metafile draws a Windows metafile onto the display list of D10.
moxcms
Package moxcms is a port of a subset of the Rust crate moxcms, a color management system for ICC profiles.
Package moxcms is a port of a subset of the Rust crate moxcms, a color management system for ICC profiles.
msole
Package msole holds the code that the binary formats of Microsoft Office share: Word, Excel and PowerPoint before 2007, Visio and Publisher.
Package msole holds the code that the binary formats of Microsoft Office share: Word, Excel and PowerPoint before 2007, Visio and Publisher.
numfmt
Package numfmt formats numbers with the number format codes of Excel (ECMA-376 Part 1, 18.8.31), at the quality of a review (D5).
Package numfmt formats numbers with the number format codes of Excel (ECMA-376 Part 1, 18.8.31), at the quality of a review (D5).
odraw
Package odraw reads the shapes and the pictures of Office Drawing (MS-ODRAW), which the binary Office formats share: the records, the properties of a shape, the store of pictures, the groups of shapes, and the figures of internal/drawingml that draw them.
Package odraw reads the shapes and the pictures of Office Drawing (MS-ODRAW), which the binary Office formats share: the records, the properties of a shape, the store of pictures, the groups of shapes, and the figures of internal/drawingml that draw them.
offcrypto
Package offcrypto decrypts the Office files that a password protects, as MS-OFFCRYPTO describes.
Package offcrypto decrypts the Office files that a password protects, as MS-OFFCRYPTO describes.
ooxml
Package ooxml opens the Office Open XML packages of Word, Excel, PowerPoint and Visio, for the packages docx, xlsx, pptx and vsdx.
Package ooxml opens the Office Open XML packages of Word, Excel, PowerPoint and Visio, for the packages docx, xlsx, pptx and vsdx.
pict
Package pict reads the pictures of QuickDraw, PICT version 1 and version 2, as Inside Macintosh: Imaging With QuickDraw, Appendix A, gives them.
Package pict reads the pictures of QuickDraw, PICT version 1 and version 2, as Inside Macintosh: Imaging With QuickDraw, Appendix A, gives them.
raster
Package raster decodes raster images within the limits of a configuration, and turns a raster image into an ivy.Page.
Package raster decodes raster images within the limits of a configuration, and turns a raster image into an ivy.Page.
sheet
Package sheet puts the sheets of a spreadsheet on pages.
Package sheet puts the sheets of a spreadsheet on pages.
zipdoc
Package zipdoc reads the formats that are zip archives, such as OpenDocument, Office Open XML, iWork and OpenRaster, within the limits of a configuration.
Package zipdoc reads the formats that are zip archives, such as OpenDocument, Office Open XML, iWork and OpenRaster, within the limits of a configuration.
Package iwork opens the files of Apple Pages, Keynote and Numbers.
Package iwork opens the files of Apple Pages, Keynote and Numbers.
Package markdown opens Markdown files.
Package markdown opens Markdown files.
Package mobi opens the ebooks of Mobipocket and of the Kindle: MOBI and PRC files, AZW files, which are MOBI files with the extensions of the Kindle, AZW3 files, also called KF8, and AZW4 files, also called Print Replica.
Package mobi opens the ebooks of Mobipocket and of the Kindle: MOBI and PRC files, AZW files, which are MOBI files with the extensions of the Kindle, AZW3 files, also called KF8, and AZW4 files, also called Print Replica.
Package msdoc opens the Word documents of Word 97 to Word 2003: .doc files and .dot templates (MS-DOC).
Package msdoc opens the Word documents of Word 97 to Word 2003: .doc files and .dot templates (MS-DOC).
Package msppt opens the presentations of PowerPoint 97 to PowerPoint 2003: .ppt files, .pps shows and .pot templates (MS-PPT).
Package msppt opens the presentations of PowerPoint 97 to PowerPoint 2003: .ppt files, .pps shows and .pot templates (MS-PPT).
Package msxls opens the workbooks of Excel 97 to Excel 2003: .xls files and .xlt templates, in BIFF8 (MS-XLS), and the workbooks of Excel 5 and Excel 95 in BIFF5.
Package msxls opens the workbooks of Excel 97 to Excel 2003: .xls files and .xlt templates, in BIFF8 (MS-XLS), and the workbooks of Excel 5 and Excel 95 in BIFF5.
odf
Package odf opens OpenDocument files, such as the documents of LibreOffice Writer, Calc, Impress and Draw.
Package odf opens OpenDocument files, such as the documents of LibreOffice Writer, Calc, Impress and Draw.
internal/drawpage
Package drawpage puts the pages of the presentations and the drawings of OpenDocument on pages: Impress and Draw, odp, otp, odg and otg.
Package drawpage puts the pages of the presentations and the drawings of OpenDocument on pages: Impress and Draw, odp, otp, odg and otg.
internal/odfcrypt
Package odfcrypt reads the manifest of an OpenDocument file, and decrypts the entries that a password protects, as part 3 of ODF 1.2 describes in section 3.4 and as OpenOffice wrote them before ODF 1.2:
Package odfcrypt reads the manifest of an OpenDocument file, and decrypts the entries that a password protects, as part 3 of ODF 1.2 describes in section 3.4 and as OpenOffice wrote them before ODF 1.2:
Package ora opens OpenRaster and Krita files.
Package ora opens OpenRaster and Krita files.
Package pdf opens PDF files, and renders their pages.
Package pdf opens PDF files, and renders their pages.
Package pptx opens PowerPoint files in Office Open XML: pptx, pptm, potx, ppsx and ppsm.
Package pptx opens PowerPoint files in Office Open XML: pptx, pptm, potx, ppsx and ppsm.
ps
Package ps opens PostScript and EPS files.
Package ps opens PostScript and EPS files.
internal/graphics
Package graphics is the imaging model of PostScript (D29): the graphics state, the paths, the painting, the colors, the images, the patterns, the shadings, the fonts and the pages.
Package graphics is the imaging model of PostScript (D29): the graphics state, the paths, the painting, the colors, the images, the patterns, the shadings, the fonts and the pages.
internal/interp
Package interp is the language of PostScript: the scanner, the objects, the stacks, the virtual memory, and the operators that do not draw (D29).
Package interp is the language of PostScript: the scanner, the objects, the stacks, the virtual memory, and the operators that do not draw (D29).
psd
Package psd opens Photoshop files, PSD and PSB.
Package psd opens Photoshop files, PSD and PSB.
internal/oovpsd
ivy: the package is named oovpsd, after the folder of the copy.
ivy: the package is named oovpsd, after the folder of the copy.
Package pub opens the publications of Microsoft Publisher, .pub files, for their previews.
Package pub opens the publications of Microsoft Publisher, .pub files, for their previews.
Package rtf opens files in the Rich Text Format, as RTF 1.9.1 of Microsoft describes it.
Package rtf opens files in the Rich Text Format, as RTF 1.9.1 of Microsoft describes it.
Package text opens text files and TXTZ files.
Package text opens text files and TXTZ files.
Package vsdx opens the drawings of Visio: the files of Office Open XML of Visio 2013 and later, .vsdx, .vsdm, .vstx, .vstm, .vssx and .vssm, and the binary files of Visio 2003 to 2010, .vsd, .vst and .vss.
Package vsdx opens the drawings of Visio: the files of Office Open XML of Visio 2013 and later, .vsdx, .vsdm, .vstx, .vstm, .vssx and .vssm, and the binary files of Visio 2003 to 2010, .vsd, .vst and .vss.
Package xlsx opens Excel files in Office Open XML: .xlsx, .xltx, .xlsm and .xltm.
Package xlsx opens Excel files in Office Open XML: .xlsx, .xltx, .xlsm and .xltm.
Package xps opens XPS and OpenXPS documents, and renders their pages.
Package xps opens XPS and OpenXPS documents, and renders their pages.

Jump to

Keyboard shortcuts

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