export

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package export serializes a blocks.Document into the output formats gitrakz exposes to callers: raw JSON, CSV, and PDF.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownBlockType = errors.New("unknown block type")

ErrUnknownBlockType is returned when a blocks.Block carries a BlockType this package has no serializer for.

Functions

func ToCSV

func ToCSV(doc blocks.Document) ([]byte, error)

ToCSV walks doc and serializes every tabular block (table, list, keyvalue, metric, chart) into a single CSV document. Prose blocks (heading, text, code) carry no tabular data and are skipped. Records vary in width across block types, so a caller reading the result back with encoding/csv must set csv.Reader.FieldsPerRecord = -1.

func ToJSON

func ToJSON(doc blocks.Document) ([]byte, error)

ToJSON serializes doc as its canonical JSON representation, for piping the block document to another consumer.

func ToPDF

func ToPDF(doc blocks.Document) ([]byte, error)

ToPDF renders every block in doc, in document order, into a single paginated PDF via maroto.

Types

This section is empty.

Jump to

Keyboard shortcuts

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