Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 61 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
[package]
edition = "2024"
name = "aemark"
version = "0.1.1"
edition = "2024"

[lib]
name = "aemark"
crate-type = ["cdylib"]

[workspace]
resolver = "3"
members = ["mark"]

[dependencies]
pyo3 = "0.29.0"
mark = { path = "mark" }

[dependencies.mark]
path = "mark"

[workspace]
members = [
"mark",
"wasm",
]
resolver = "3"

[profile.release]
strip = true
panic = "abort"
lto = "fat"
codegen-units = 1

panic = "abort"
strip = true
6 changes: 6 additions & 0 deletions wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/target
**/*.rs.bk
Cargo.lock
bin/
pkg/
wasm-pack.log
21 changes: 21 additions & 0 deletions wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "wasm"
version = "0.1.1"
authors = ["Thomas Girod <thgirod@hotmail.com>"]
edition = "2018"

[package.metadata.wasm-pack.profile.release]
wasm-opt = false

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "0.2.84"
mark = { path = "../mark" }

[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
11 changes: 11 additions & 0 deletions wasm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
JS bindings for the aemark parser, built upon Rust and WASM.

Exemple :

```javascript
import { markdown } from "@ae_utbm/aemark"

const result = markdown("This some *text* formatted in __markdown__");
console.log(result);
// <p>This some <em>text</em> formatted in <u>markdown</u></p>\n
```
17 changes: 17 additions & 0 deletions wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use wasm_bindgen::prelude::*;

/// Generate HTML from a markdown string following the aemark spec.
///
/// # Exemple
///
/// ```javascript
/// import { markdown } from "@ae_utbm/aemark"
///
/// const result = markdown("This some *text* formatted in __markdown__");
/// console.log(result);
/// // <p>This some <em>text</em> formatted in <u>markdown</u></p>\n
/// ```
#[wasm_bindgen]
pub fn markdown(s: &str) -> String {
mark::markdown(s)
}