maimai 0.1.1

Markup-based meme generator
Documentation
//! [![Build Status](https://codeberg.org/d-k-bo/maimai/badges/workflows/rust.yml/badge.svg)](https://codeberg.org/d-k-bo/maimai/actions?workflow=rust.yml)
//! [![crates.io](https://img.shields.io/crates/v/maimai)](https://lib.rs/crates/maimai)
//! [![Documentation](https://img.shields.io/docsrs/maimai)](https://docs.rs/maimai)
//! [![License](https://img.shields.io/crates/l/maimai)](https://codeberg.org/d-k-bo/maimai/src/branch/main/COPYING)
//! [![Repository](https://img.shields.io/badge/Source%20Code-on%20Codeberg-blue?logo=Codeberg)](https://codeberg.org/d-k-bo/maimai/)
//!
//! *maimai* (\[\'maɪ̯maɪ̯\], Zangendeutsch for “meme”) provides a command-line
//! application and a Rust library to generate [Memes] based on a declarative
//! text format.
//!
//! This is intended to be an alternative to popular [WYSIWYG] meme editors,
//! that don't give you much control and often have problems creating
//! reproducable, high quality content.
//!
//! ![](https://codeberg.org/d-k-bo/maimai/media/branch/main/examples/creating-memes.webp)
//!
//! _**All image templates used in this project were hand-drawn by [Gee] for
//! [Framamèmes] and published under the the terms of the [CC-0] License.**_
//!
//! # Usage
//!
//! In many cases, a meme is created from 3 “layers”:
//!
//! - the base image (often taken from a popular TV show or from stock images)
//! - the text layout that defines, where text is placed on the base image and
//!   how it is formatted
//! - the text content
//!
//! The first two “layer” are usually shared between different memes and the
//! text content is replaced for a different joke.
//!
//! A `maimai` meme definition is written as a [TOML] document that can extend
//! other meme definions. This allows implementing the pattern described
//! above.
//!
//! <table>
//!     <tr>
//!         <th>Source</th>
//!         <th>Result</th>
//!     </tr>
//!     <tr>
//! <td>
//!
//! ```toml
//! # examples/templates/sophie-no-yes.toml
//!
#![doc = include_str!("../examples/templates/sophie-no-yes.toml")]
//! ```
//!
//! </td>
//! <td>
//!
//! <img src="https://codeberg.org/d-k-bo/maimai/media/branch/main/examples/templates/sophie-no-yes.webp" height="400" width="400"/>
//!
//! </td>
//!     </tr>
//!     <tr>
//! <td>
//!
//! ```toml
//! # examples/reuse.toml
//!
#![doc = include_str!("../examples/reuse.toml")]
//! ```
//!
//! </td>
//! <td>
//!
//! <img src="https://codeberg.org/d-k-bo/maimai/media/branch/main/examples/reuse.webp" height="400" width="400"/>
//!
//! </td>
//!     </tr>
//! </table>
//!
//!
//! # License
//!
//! This project is licensed under the GNU Affero General Public License version 3 or (at your option) any later version (AGPL-3.0-or-later).
//!
//! [Memes]: https://en.wikipedia.org/wiki/Internet_meme
//! [WYSIWYG]: https://en.wikipedia.org/wiki/WYSIWYG
//! [Gee]: https://ptilouk.net/
//! [Framamèmes]: https://framamemes.org/
//! [CC-0]: https://creativecommons.org/publicdomain/zero/1.0/
//! [TOML]: https://toml.io/

#![cfg_attr(not(feature = "cli"), allow(dead_code))]
#![cfg_attr(not(feature = "cli"), allow(unused_imports))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

mod error;
#[cfg(feature = "read")]
mod files;
mod meme;
#[cfg(feature = "render")]
mod render;
#[cfg(feature = "render")]
mod text;

pub use self::{
    error::{Error, ErrorKind, IncompleteMemeDefinition, Result},
    meme::{Color, HAlign, Meme, MemeBase, PartialMeme, TextBox, TextOutline, VAlign, partial},
};

#[cfg(feature = "read")]
pub use self::files::{FileProvider, FsFileProvider};