Skip to content

Commit c947db3

Browse files
committed
add: horizontal rules
1 parent 644e640 commit c947db3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ pub mod headings;
66
pub mod italic;
77
pub mod list;
88
pub mod quote;
9+
pub mod rules;
910
pub mod strike;

src/rules.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
use brack_sdk_rs::{MetaData, Type, Value};
2+
use extism_pdk::{plugin_fn, FnResult, Json, WithReturnCode};
3+
4+
#[plugin_fn]
5+
pub fn metadata_rules() -> FnResult<Json<MetaData>> {
6+
Ok(Json(MetaData {
7+
command_name: "---".to_string(),
8+
call_name: "rules".to_string(),
9+
argument_types: vec![],
10+
return_type: Type::TBlock,
11+
}))
12+
}
13+
14+
#[plugin_fn]
15+
pub fn rules(Json(args): Json<Vec<Value>>) -> FnResult<String> {
16+
if args.len() != 0 {
17+
return Err(WithReturnCode::new(anyhow::anyhow!("Usage: {{std.---}}"), 1));
18+
}
19+
Ok(String::from("<hr />"))
20+
}

0 commit comments

Comments
 (0)