Struct crowbook::ResourceHandler [] [src]

pub struct ResourceHandler<'r> {
    pub images: HashMap<StringString>,
    // some fields omitted
}

Resource Handler.

Its task is to make sure that some resource (image, link) is available for the book and to list images used in Markdown files so they can be used for the book

Fields

Maps an original (local) file name to a new file name. Allows to

Methods

impl<'r> ResourceHandler<'r>
[src]

Creates a new, empty Resource Handler

Turns on mapping for image files

Argument: an offset (should be book.root)

Sets base64 mode for image mapping

If set to true, instead of returning a destination file path, map_image will include the image as base64

Add a local image file and get the resulting transformed file name

Returns an iterator the the images files mapping

Add a match between an original file and a dest file

Get a destination link from an original link

Tell whether a file name is a local resource or net

Add a path offset to all linked urls and images src

Get the list of all files, walking recursively in directories

Arguments

  • list: a list of files
  • base: the path where to get them

Returns

A list of files (relative to base), or an error.

Trait Implementations

impl<'r> Debug for ResourceHandler<'r>
[src]

Formats the value using the given formatter.