We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85d1b6b commit 2557a7aCopy full SHA for 2557a7a
Cargo.toml
@@ -4,6 +4,9 @@ version = "0.0.0"
4
authors = ["Caleb Maclennan <[email protected]>"]
5
edition = "2018"
6
7
+[lib]
8
+crate-type = ["cdylib"]
9
+
10
[dependencies]
11
pulldown-cmark = "0.7.1"
12
mlua = "0.3.2"
src/lib.rs
@@ -1,3 +1,21 @@
1
+#[macro_use]
2
+extern crate mlua_derive;
3
+use mlua::prelude::*;
+use pulldown_cmark::{Options, Parser};
+fn hello(_: &Lua, name: String) -> LuaResult<()> {
+ println!("hello, {}!", name);
+ Ok(())
+}
+#[lua_module]
13
+fn my_module(lua: &Lua) -> LuaResult<LuaTable> {
14
+ let exports = lua.create_table()?;
15
+ exports.set("hello", lua.create_function(hello)?)?;
16
+ Ok(exports)
17
18
19
#[cfg(test)]
20
mod tests {
21
#[test]
0 commit comments