summaryrefslogtreecommitdiff
path: root/src/library/deco.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-01-27 23:07:34 +0100
committerGitHub <noreply@github.com>2022-01-27 23:07:34 +0100
commit2d97d406aced1f1ab7d3bc459e31bb0eff92b892 (patch)
tree3deea994c8e1b44fc3a0644eca10162c46b9b3fc /src/library/deco.rs
parent3739ab77207e0e54edb55a110a16a1eb925b84f4 (diff)
parentc183ed3c15110e11bffd40fad5c5fdfb4d1a5814 (diff)
Merge pull request #58 from typst/highlighted-raw
Add Code Block syntax highlighting
Diffstat (limited to 'src/library/deco.rs')
-rw-r--r--src/library/deco.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/library/deco.rs b/src/library/deco.rs
index 3e91d1de..ccb657d1 100644
--- a/src/library/deco.rs
+++ b/src/library/deco.rs
@@ -38,6 +38,18 @@ pub struct Decoration {
pub extent: Linear,
}
+impl From<DecoLine> for Decoration {
+ fn from(line: DecoLine) -> Self {
+ Self {
+ line,
+ 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 +61,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;
}