Documentation
¶
Overview ¶
Package lean is a lightweight document rendering engine.
It provides parsing, layout, rendering, and export of documents through a clean internal intermediate representation (IR).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidMarkdown = errors.New("lean: Markdown must contain valid UTF-8 text")
View Source
var ErrUnsupportedDocument = errors.New("lean: document contains unsupported features")
Functions ¶
Types ¶
type FidelityReport ¶
type MarkdownDialect ¶
type MarkdownDialect string
const ( CommonMark MarkdownDialect = "commonmark" GitHubFlavoredMarkdown MarkdownDialect = "gfm" )
type MarkdownSource ¶
type MarkdownSource struct {
// contains filtered or unexported fields
}
func OpenMarkdownSource ¶
func OpenMarkdownSource(source []byte) (*MarkdownSource, error)
func (*MarkdownSource) Bytes ¶
func (document *MarkdownSource) Bytes() []byte
func (*MarkdownSource) RenderHTML ¶
func (document *MarkdownSource) RenderHTML() ([]byte, error)
func (*MarkdownSource) RenderSyntaxHTML ¶
func (document *MarkdownSource) RenderSyntaxHTML(dialect MarkdownDialect) ([]byte, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
lean
command
lean is a CLI for the lean document rendering engine.
|
lean is a CLI for the lean document rendering engine. |
|
pkg
|
|
|
export/ooxml
Package ooxml exports an IR document to .docx (OOXML) format.
|
Package ooxml exports an IR document to .docx (OOXML) format. |
|
font
Package font handles font loading, metrics, and subsetting.
|
Package font handles font loading, metrics, and subsetting. |
|
hittest
Package hittest maps pixel coordinates to IR document positions.
|
Package hittest maps pixel coordinates to IR document positions. |
|
ir
Package ir defines the internal document representation.
|
Package ir defines the internal document representation. |
|
layout
Package layout computes page layout from an IR document.
|
Package layout computes page layout from an IR document. |
|
numbering
Package numbering provides OOXML list numbering state and marker helpers.
|
Package numbering provides OOXML list numbering state and marker helpers. |
|
parser/ooxml
Package ooxml parses .docx files into Lean's intermediate representation.
|
Package ooxml parses .docx files into Lean's intermediate representation. |
|
render/pdf
Package pdf renders laid-out pages to PDF format.
|
Package pdf renders laid-out pages to PDF format. |
|
render/png
Package png renders laid-out pages to PNG format.
|
Package png renders laid-out pages to PNG format. |
|
selection
Package selection computes selection geometry from IR positions.
|
Package selection computes selection geometry from IR positions. |
|
units
Package units converts between OOXML and layout measurement units.
|
Package units converts between OOXML and layout measurement units. |
|
wasm
Package wasm provides WebAssembly bindings for the lean engine.
|
Package wasm provides WebAssembly bindings for the lean engine. |
Click to show internal directories.
Click to hide internal directories.