Skip to content

jcbhmr/include-data-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

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

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages