add comments

This commit is contained in:
yggverse 2024-12-03 18:43:34 +02:00
parent 2e0a1ae3ef
commit 155247a2ea
7 changed files with 30 additions and 3 deletions

View file

@ -1,17 +1,22 @@
use glib::{GString, Regex, RegexCompileFlags, RegexMatchFlags};
/// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) type holder
pub enum Level {
H1,
H2,
H3,
}
/// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) entity holder
pub struct Header {
pub value: GString,
pub level: Level,
}
impl Header {
// Constructors
/// Parse `Self` from string
pub fn from(line: &str) -> Option<Self> {
// Parse line
let regex = Regex::split_simple(