summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-12-14 14:24:02 +0100
committerMartin Haug <mhaug@live.de>2022-01-27 22:04:45 +0100
commit4f66907d08a8ed18b41e70188b112d7c915aa0bc (patch)
treefee27c337c8d60754e1e459b48084a7ab2f9af00 /src/library
parent3739ab77207e0e54edb55a110a16a1eb925b84f4 (diff)
Add Code Block syntax highlighting
Diffstat (limited to 'src/library')
-rw-r--r--src/library/deco.rs37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/library/deco.rs b/src/library/deco.rs
index 3e91d1de..5f27c8be 100644
--- a/src/library/deco.rs
+++ b/src/library/deco.rs
@@ -38,6 +38,41 @@ pub struct Decoration {
pub extent: Linear,
}
+impl Decoration {
+ /// Create a new underline with default settings.
+ pub const fn underline() -> Self {
+ Self {
+ line: DecoLine::Underline,
+ stroke: None,
+ thickness: None,
+ offset: None,
+ extent: Linear::zero(),
+ }
+ }
+
+ /// Create a new strikethrough with default settings.
+ pub const fn strikethrough() -> Self {
+ Self {
+ line: DecoLine::Underline,
+ stroke: None,
+ thickness: None,
+ offset: None,
+ extent: Linear::zero(),
+ }
+ }
+
+ /// Create a new overline with default settings.
+ pub const fn overline() -> Self {
+ Self {
+ line: DecoLine::Overline,
+ stroke: None,
+ thickness: None,
+ offset: None,
+ extent: Linear::zero(),
+ }
+ }
+}
+
/// The kind of decorative line.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum DecoLine {
@@ -49,7 +84,7 @@ pub enum DecoLine {
Overline,
}
-/// Differents kinds of decorative lines for text.
+/// Different kinds of decorative lines for text.
pub trait LineKind {
const LINE: DecoLine;
}