Crate docima[][src]

Expand description

docima

Usage

  1. Configure your build script to generate the images in the desired path.
ImageFile::new()
    .path("images/my_image.html")
    .width(600)
    .height(400)
    .attr("title", "My image")
    .attr("id", "image-01")
    .attr("style", "display: block; margin:auto;")
    .wrapper("div")
    .wrapper_attr("style", "background-color:red; padding:3px;")
    .overwrite(true)
    .generate(my_image_generator_function)?;
  1. Include your image in the docs by using the doc attribute and the include_str macro.
#[doc = include_str!("../images/my_image.html")]
struct Foo;
  1. Generate the docs:
$ cargo doc --open

Examples

The following examples are generated by this build.rs:

Inline A 32x32 square filled with random color pixels. embedding.

Structs

An image file generator.

Enums

The docima Error type.

Type Definitions

The docima Result type.

A standard Result type.