package patoline

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

* Common structures and functions used to implement Patoline drivers. * * A driver in Patoline implements the very last part of the * document processing, after the document content has been typeset and * arranged into an array of pages. The driver is responsible of * serializing the content to some output medium, such as a PDF * document, a SVG image, or even displaying the content on screen.

type page = {
  1. mutable size : float * float;
    (*

    Size of a page, given as a pair of floats (width, height) * expressed in millimeters.

    *)
  2. mutable contents : RawContent.raw list;
    (*

    Typeset content belonging to the page.

    *)
}

Type of a single page.

val empty_page : (float * float) -> page

Creates an empty page of the given size.

val make_page : (float * float) -> RawContent.raw list -> page

Build a page with the given size and contents.

type meta_field =
  1. | Contributor
  2. | Coverage
  3. | Creator
  4. | Date
  5. | Description
  6. | Format
  7. | Identifier
  8. | Language
  9. | Publisher
  10. | Relation
  11. | Rights
  12. | Source
  13. | Subject
  14. | Title
  15. | Type

Available metadata fields to appear in the structure of the document.

type structure = {
  1. mutable name : string;
  2. mutable metadata : (meta_field * string) list;
  3. mutable raw_name : RawContent.raw list;
  4. mutable tags : (string * string) list;
  5. mutable page : int;
  6. mutable struct_x : float;
  7. mutable struct_y : float;
  8. mutable children : structure array;
}

Type representing the structure of a document. It contains metadata * but also position of sections and chapters.

val empty_structure : structure

Dummy structure with no information.

val print_structure : structure -> unit

Debuging function which prints to stdout the given structure.

module type OutputDriver = sig ... end

Interface of a Patoline driver.

val output_to_prime : (?structure:structure -> page array -> 'b -> 'c) -> ?structure:structure -> page array array -> 'b -> 'c

Function providing a more or less cannonical way of builing an output' * function given an output function.

val output_from_prime : (?structure:structure -> 'a array array -> 'b -> 'c) -> ?structure:structure -> 'a array -> 'b -> 'c

Similar to output_to_prime, but going the other direction.

val input_bin : string option ref

File name of an alternative pre-compiled input.

When using the Bin driver, the final typeset document * content is saved as marshalled content. It can be loaded later and * fed to another driver which outputs the actual document without * rebuilding the whole document. This reference holds the name of the * file which holds the marshalled content. When it is not None, most * formats prefer to load this content instead of doing the whole * document optimisation (the marshalled content is loaded even if the * source document has changed).

val driver : string option ref

Name of the driven used to compile the current document.

This value is usually set using the "--driver" command-line option when running patoline.