1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::Pod;

#[doc(hidden)]
pub mod json;
#[cfg(feature = "toml")]
#[doc(hidden)]
pub mod toml;
#[cfg(feature = "yaml")]
#[doc(hidden)]
pub mod yaml;

#[doc(inline)]
pub use crate::engine::json::JSON;
#[cfg(feature = "toml")]
#[doc(inline)]
pub use crate::engine::toml::TOML;
#[cfg(feature = "yaml")]
#[doc(inline)]
pub use crate::engine::yaml::YAML;

/// The trait requirement used by [`Matter`](crate::Matter) when parsing the front matter.
///
/// Implementing this trait in your own engine will allow you to create a custom front matter
/// format that can be used by [gray_matter](crate).
pub trait Engine {
    fn parse(content: &str) -> Pod;
}