jotdown_wasm: display version

mostly useful for the hosted version
This commit is contained in:
Noah Hellman 2023-04-04 19:27:20 +02:00
parent 0af2c46c57
commit 7a10767fed
6 changed files with 184 additions and 13 deletions

View file

@ -3,6 +3,12 @@ use wasm_bindgen::prelude::*;
use jotdown::Render;
use std::fmt::Write;
#[must_use]
#[wasm_bindgen]
pub fn jotdown_version() -> String {
include_str!(concat!(env!("OUT_DIR"), "/version")).to_string()
}
#[must_use]
#[wasm_bindgen]
pub fn jotdown_render(djot: &str) -> String {