8000 GitHub - jcbhmr/include-data-url: 🔗 Like include_str!(), but returns a data: URL · GitHub
[go: up one dir, main page]

Skip to content

About

🔗 Like include_str!(), but returns a data: URL

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

include-data-url

🔗 Like include_str!(), but returns a data: URL

/// Look at this cat:
/// 
/// ![](
#[doc = include_data_url!("./src/cat.jpg", "image/jpeg")]
/// )
struct Cat;

Installation

Rust

cargo add jcbhmr-include-data-url

Usage

Rust

use jcbhmr_include_data_url::include_data_url;

/// ![](
#[doc = include_data_url!("./src/cat.jpg", "image/jpeg")]
/// )
struct Cat;

fn main() {
    const ASSET: &str = include_data_url!("./src/cat.jpg", "image/jpeg");
    println!("You should navigate to this URL: {}", ASSET);
}

Development

Rust

cargo test

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

🔗 Like include_str!(), but returns a data: URL

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0