bobzhang/asciidoctor-pdf/theme does not have a README file

    ThemeError

    pub suberror ThemeError {
    ThemeError(String)
    } derive(
    Debug
    )

    Raised when a theme cannot be loaded: malformed YAML, a value safe_load refuses, a missing file.
    impl Show for ThemeError

    ThemeError::output

    fn ThemeError::output(self : ThemeError, logger : &Logger) -> Unit

    ThemeError::to_string

    fn ThemeError::to_string(self : ThemeError) -> String

    Files

    pub(all) struct Files {
    read : (String) -> String?
    cwd : String
    home : String
    }

    How the loader reads files: an absolute path to its text, or None when there is no such file. The bundled themes are served before it is asked.

    Files::new

    fn Files::new(read? : (String) -> String?, cwd? : String, home? : String) -> Files

    Theme

    pub struct Theme {
    table : Map[String, Value]
    }

    The loaded theme (Ruby's ThemeData): flattened keys and their values, in the order they were first set. As in Ruby, the directory the theme was loaded from is a key too (__dir__, see Theme::dir).

    Theme::at

    #alias("_[_]")
    fn Theme::at(self : Theme, key : String) -> Value

    The value of a key, nil when absent (theme[key]).

    Theme::copy

    fn Theme::copy(self : Theme) -> Theme

    Theme::dir

    fn Theme::dir(self : Theme) -> String

    The directory the theme was loaded from (__dir__), which relative asset paths resolve against: the bundled themes' when unset.

    Theme::dump

    fn Theme::dump(self : Theme) -> String

    The theme as key: value lines (see Value::dump) in the order the keys were set.

    Theme::get

    fn Theme::get(self : Theme, key : String) -> Value?

    The value of a key; None when the key is absent (a key set to nil is Some(Null), as respond_to? sees it).

    Theme::has

    fn Theme::has(self : Theme, key : String) -> Bool

    Theme::keys

    fn Theme::keys(self : Theme) -> Array[String]

    The keys in the order they were first set.

    Theme::new

    fn Theme::new() -> Theme

    Theme::set

    #alias("_[_]=_")
    fn Theme::set(self : Theme, key : String, value : Value) -> Unit

    Theme::set_dir

    fn Theme::set_dir(self : Theme, dir : String) -> Unit

    Value

    pub(all) enum Value {
    Null
    Bool(Bool)
    Int(Int64)
    Float(Double)
    Str(String)
    Array(Array[Value])
    Hash(Map[String, Value], symbols~ : Bool)
    Hex(String)
    Transparent
    Cmyk(Array[Value])
    } derive(Eq,
    Debug
    )

    A theme value.

    Value::as_number

    fn Value::as_number(self : Value) -> Double?

    A number as a Double (Ruby to_f of a Numeric).

    Value::dump

    fn Value::dump(self : Value) -> String

    A canonical, typed form of the value: nil, true, 12, f12.0 (a Float, as Ruby prints it), "text", hex"FFFFFF", transparent, cmyk[0, 50, 100, 100], [...], {"key" => ...} ({:key => ...} for symbol keys).

    Value::equal

    fn Value::equal(Value, Value) -> Bool

    Value::inspect_ruby

    fn Value::inspect_ruby(self : Value) -> String

    Ruby's inspect of the value (Array#to_s and Hash#to_s use it).

    Value::is_numeric

    fn Value::is_numeric(self : Value) -> Bool

    Ruby Numeric === value.

    Value::not_equal

    fn Value::not_equal(x : Value, y : Value) -> Bool

    Value::to_f

    fn Value::to_f(self : Value) -> Double

    Ruby to_f: Numeric, String (leading number), nil (0.0).

    Value::to_repr

    Value::to_ruby_s

    fn Value::to_ruby_s(self : Value) -> String

    Ruby's to_s of the value (what "#{value}" and gsub blocks produce).

    Value::truthy

    fn Value::truthy(self : Value) -> Bool

    Ruby's truthiness: everything but nil and false.

    base_theme_path

    let base_theme_path : String

    BaseThemePath

    bundled_theme_names

    fn bundled_theme_names() -> Array[String]

    The names of the bundled themes (BundledThemeNames).

    clear_warnings

    fn clear_warnings() -> Unit

    fonts_dir

    let fonts_dir : String

    Where the bundled fonts live (ThemeLoader::FontsDir, the gem's data/fonts): the directory GEM_FONTS_DIR stands for. Virtual too: the converter maps it to the directory holding the fonts.

    load_base_theme

    fn load_base_theme(files : Files) -> Theme raise ThemeError

    ThemeLoader.load_base_theme: the base theme is loaded as it is, with no processing (its keys are already flat).

    load_file

    fn load_file(files : Files, filename : String, theme_dir? : String) -> Theme raise ThemeError

    ThemeLoader.load_file filename, nil, theme_dir: a theme file loaded by itself (the themes it extends first), without the defaults load_theme adds.

    load_map

    fn load_map(map : Map[String, Value], theme : Theme) -> Unit raise ThemeError

    ThemeLoader#load: process the entries of a (parsed) theme into theme, top-level keys normalized.

    load_text

    fn load_text(text : String, theme? : Theme) -> Theme raise ThemeError

    Load theme YAML text into theme (or a new theme) without extends or the hex color protection (ThemeLoader.new.load YAML.safe_load text).

    load_theme

    fn load_theme(files : Files, theme_name? : String, theme_dir? : String) -> Theme raise ThemeError

    ThemeLoader.load_theme: the named (or .yml path) theme, or the default theme; a theme outside the bundled themes gets the defaults of a theme that extends nothing (left-aligned black text in Courier...).

    resolve_measurement_values

    fn resolve_measurement_values(str : String) -> String

    InsetMeasurementValueRx: (?<=^| |\()(-?\d+(?:\.\d+)?)(in|mm|cm|p[txc])(?=$| |\)) — every measurement in the string converted to points (Ruby's Float#to_s), when some digit is followed by a unit (MeasurementValueHintRx).

    resolve_theme_asset

    fn resolve_theme_asset(files : Files, asset_path : String, theme_dir? : String) -> String

    ThemeLoader.resolve_theme_asset

    resolve_theme_file

    fn resolve_theme_file(files : Files, theme_name : String?, theme_dir : String?) -> (String, String)

    ThemeLoader.resolve_theme_file: the theme's path and directory. A name ending in .yml is a path (relative to theme_dir, else the working directory); another is <name>-theme.yml in theme_dir (default: the bundled themes).

    ruby_float_to_s

    fn ruby_float_to_s(f : Double) -> String

    Ruby's Float#to_s: the shortest representation that round-trips, in fixed notation (with at least one fractional digit) when the decimal exponent is between -4 and 16, else d.ddde+XX.

    ruby_string_to_f

    fn ruby_string_to_f(s : String) -> Double

    Ruby's String#to_f: the longest leading decimal number (after whitespace), else 0.0.

    ruby_string_to_i

    fn ruby_string_to_i(s : String) -> Int64

    Ruby's String#to_i: the leading decimal integer (after whitespace), else 0.

    safe_load

    fn safe_load(text : String) -> Value raise ThemeError

    Parse YAML text as YAML.safe_load(text, aliases: true): the first document's value (Null for an empty document).

    str_to_pt

    fn str_to_pt(val : String) -> Double

    str_to_pt: MeasurementValueRx = /(\d+|\d*\.\d+)(in|mm|cm|p[txc])?$/ matched against the value's end, converted; else to_f.

    themes_dir

    let themes_dir : String

    Where the bundled themes live (Ruby's ThemeLoader::ThemesDir, the gem's data/themes). They are bundled in this package, so this is a virtual directory: Files serves the bundled themes from it.

    to_color

    fn to_color(value : Value) -> Value

    ThemeLoader#to_color

    to_pt

    fn to_pt(num : Double, units : String) -> Double?

    to_pt num, units: the number in points; None for an unknown unit (Ruby raises).

    tokenize

    fn tokenize(s : String) -> Value raise ThemeError

    Psych's ScalarScanner#tokenize (strict_integer: false) for a plain scalar.

    warnings

    let warnings : Array[String]

    Warnings met while loading (Ruby logs them): unknown variables, deprecated categories. Cleared by clear_warnings.