Last active
July 2, 2018 13:21
-
-
Save wehlutyk/90836084cf85e3c98ca71556d1f03968 to your computer and use it in GitHub Desktop.
lopdf + xml-rs → wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "infuse-explorations" | |
version = "0.1.0" | |
authors = ["Sébastien Lerique <sl@mehho.net>"] | |
[lib] | |
crate-type = ["cdylib"] | |
[dependencies] | |
wasm-bindgen = "0.2" | |
lopdf = { path = "../lopdf", features = ["rust_backend"], default-features = false } | |
xml-rs = "0.8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(proc_macro, wasm_custom_section, wasm_import_module)] | |
extern crate wasm_bindgen; | |
use wasm_bindgen::prelude::*; | |
#[wasm_bindgen] | |
extern { | |
#[wasm_bindgen(js_namespace = console)] | |
fn log(s: &str); | |
} | |
#[wasm_bindgen] | |
pub fn greet(name: &str) { | |
log(&format!("Hello, {}!", name)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment