aboutsummaryrefslogtreecommitdiff
path: root/src/ast/macros.rs
blob: 6f91ac4c40405d0033cc2ee5aff790788485735b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Convert Gemtext an `Ast`
///
/// # Examples
///
/// ```rust
/// // Using a value
/// assert_eq!(
///   germ::gemini_to_ast!("=> / A link!").to_gemtext(),
///   // `to_gemtext` appends a newline to all responses, so let's make sure we
///   // account for that.
///   "=> / A link!",
/// );
#[macro_export]
macro_rules! gemini_to_ast {
  ($gemini:expr) => {
    $crate::ast::Ast::from_string($gemini)
  };
}