mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-04-01 09:35:34 +00:00
reorganize header component
This commit is contained in:
parent
c29f1ba529
commit
3e16995e00
3 changed files with 105 additions and 68 deletions
16
src/line/header/level.rs
Normal file
16
src/line/header/level.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/// [Header](https://geminiprotocol.net/docs/gemtext-specification.gmi#heading-lines) type holder
|
||||
pub enum Level {
|
||||
H1,
|
||||
H2,
|
||||
H3,
|
||||
}
|
||||
|
||||
impl Level {
|
||||
pub fn as_tag(&self) -> &str {
|
||||
match self {
|
||||
Level::H1 => "#",
|
||||
Level::H2 => "##",
|
||||
Level::H3 => "###",
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue