Skip to content

Commit

Permalink
add: horizontal rules
Browse files Browse the repository at this point in the history
  • Loading branch information
momeemt committed Jun 13, 2024
1 parent 644e640 commit c947db3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ pub mod headings;
pub mod italic;
pub mod list;
pub mod quote;
pub mod rules;
pub mod strike;
20 changes: 20 additions & 0 deletions src/rules.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use brack_sdk_rs::{MetaData, Type, Value};
use extism_pdk::{plugin_fn, FnResult, Json, WithReturnCode};

#[plugin_fn]
pub fn metadata_rules() -> FnResult<Json<MetaData>> {
Ok(Json(MetaData {
command_name: "---".to_string(),
call_name: "rules".to_string(),
argument_types: vec![],
return_type: Type::TBlock,
}))
}

#[plugin_fn]
pub fn rules(Json(args): Json<Vec<Value>>) -> FnResult<String> {
if args.len() != 0 {
return Err(WithReturnCode::new(anyhow::anyhow!("Usage: {{std.---}}"), 1));
}
Ok(String::from("<hr />"))
}

0 comments on commit c947db3

Please sign in to comment.