summaryrefslogtreecommitdiff
path: root/crates/typst-library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-11-19 16:34:38 +0100
committerLaurenz <laurmaedje@gmail.com>2023-11-19 16:34:38 +0100
commit2da619e17cb48efd468818ea35793b3f90b8aaea (patch)
treee38012152337099a334c00247f2b27e406c9427f /crates/typst-library
parentea987ef4a3cb1e16b73e9d97f4a736f3a611b275 (diff)
Streamline imports
Diffstat (limited to 'crates/typst-library')
-rw-r--r--crates/typst-library/src/layout/container.rs3
-rw-r--r--crates/typst-library/src/layout/enum.rs4
-rw-r--r--crates/typst-library/src/layout/flow.rs2
-rw-r--r--crates/typst-library/src/layout/grid.rs3
-rw-r--r--crates/typst-library/src/layout/list.rs3
-rw-r--r--crates/typst-library/src/layout/page.rs2
-rw-r--r--crates/typst-library/src/layout/par.rs3
-rw-r--r--crates/typst-library/src/layout/repeat.rs3
-rw-r--r--crates/typst-library/src/layout/stack.rs2
-rw-r--r--crates/typst-library/src/layout/terms.rs3
-rw-r--r--crates/typst-library/src/math/accent.rs2
-rw-r--r--crates/typst-library/src/math/align.rs2
-rw-r--r--crates/typst-library/src/math/matrix.rs2
-rw-r--r--crates/typst-library/src/math/op.rs2
-rw-r--r--crates/typst-library/src/meta/bibliography.rs5
-rw-r--r--crates/typst-library/src/meta/cite.rs4
-rw-r--r--crates/typst-library/src/meta/counter.rs2
-rw-r--r--crates/typst-library/src/meta/figure.rs6
-rw-r--r--crates/typst-library/src/meta/footnote.rs3
-rw-r--r--crates/typst-library/src/meta/outline.rs8
-rw-r--r--crates/typst-library/src/text/deco.rs2
-rw-r--r--crates/typst-library/src/text/linebreak.rs2
-rw-r--r--crates/typst-library/src/text/misc.rs2
-rw-r--r--crates/typst-library/src/text/quote.rs2
-rw-r--r--crates/typst-library/src/text/raw.rs6
-rw-r--r--crates/typst-library/src/text/shaping.rs2
-rw-r--r--crates/typst-library/src/text/shift.rs2
27 files changed, 36 insertions, 46 deletions
diff --git a/crates/typst-library/src/layout/container.rs b/crates/typst-library/src/layout/container.rs
index 2e6ccdd2..9268f8df 100644
--- a/crates/typst-library/src/layout/container.rs
+++ b/crates/typst-library/src/layout/container.rs
@@ -1,7 +1,6 @@
use typst::eval::AutoValue;
-use super::VElem;
-use crate::layout::Spacing;
+use crate::layout::{Spacing, VElem};
use crate::prelude::*;
/// An inline-level container that sizes content.
diff --git a/crates/typst-library/src/layout/enum.rs b/crates/typst-library/src/layout/enum.rs
index 8c491dca..0c98c18a 100644
--- a/crates/typst-library/src/layout/enum.rs
+++ b/crates/typst-library/src/layout/enum.rs
@@ -1,12 +1,10 @@
use std::str::FromStr;
-use crate::layout::{BlockElem, ParElem, Sizing, Spacing};
+use crate::layout::{BlockElem, GridLayouter, ParElem, Sizing, Spacing};
use crate::meta::{Numbering, NumberingPattern};
use crate::prelude::*;
use crate::text::TextElem;
-use super::GridLayouter;
-
/// A numbered list.
///
/// Displays a sequence of items vertically and numbers them consecutively.
diff --git a/crates/typst-library/src/layout/flow.rs b/crates/typst-library/src/layout/flow.rs
index 5c795c81..17a39254 100644
--- a/crates/typst-library/src/layout/flow.rs
+++ b/crates/typst-library/src/layout/flow.rs
@@ -2,7 +2,7 @@ use std::mem;
use comemo::Prehashed;
-use super::{
+use crate::layout::{
AlignElem, BlockElem, ColbreakElem, ColumnsElem, ParElem, PlaceElem, Spacing, VElem,
};
use crate::meta::{FootnoteElem, FootnoteEntry};
diff --git a/crates/typst-library/src/layout/grid.rs b/crates/typst-library/src/layout/grid.rs
index 9e9fe3ba..1cde6564 100644
--- a/crates/typst-library/src/layout/grid.rs
+++ b/crates/typst-library/src/layout/grid.rs
@@ -1,10 +1,9 @@
use smallvec::{smallvec, SmallVec};
+use crate::layout::Sizing;
use crate::prelude::*;
use crate::text::TextElem;
-use super::Sizing;
-
/// Arranges content in a grid.
///
/// The grid element allows you to arrange content in a grid. You can define the
diff --git a/crates/typst-library/src/layout/list.rs b/crates/typst-library/src/layout/list.rs
index 18c89a24..e30aa975 100644
--- a/crates/typst-library/src/layout/list.rs
+++ b/crates/typst-library/src/layout/list.rs
@@ -1,9 +1,8 @@
+use crate::layout::GridLayouter;
use crate::layout::{BlockElem, ParElem, Sizing, Spacing};
use crate::prelude::*;
use crate::text::TextElem;
-use super::GridLayouter;
-
/// A bullet list.
///
/// Displays a sequence of items vertically, with each item introduced by a
diff --git a/crates/typst-library/src/layout/page.rs b/crates/typst-library/src/layout/page.rs
index 5f8f90c1..53646c7d 100644
--- a/crates/typst-library/src/layout/page.rs
+++ b/crates/typst-library/src/layout/page.rs
@@ -4,7 +4,7 @@ use std::str::FromStr;
use typst::eval::AutoValue;
-use super::{AlignElem, ColumnsElem};
+use crate::layout::{AlignElem, ColumnsElem};
use crate::meta::{Counter, CounterKey, ManualPageCounter, Numbering};
use crate::prelude::*;
use crate::text::TextElem;
diff --git a/crates/typst-library/src/layout/par.rs b/crates/typst-library/src/layout/par.rs
index 98cf605f..2028c9fd 100644
--- a/crates/typst-library/src/layout/par.rs
+++ b/crates/typst-library/src/layout/par.rs
@@ -4,8 +4,7 @@ use typst::model::DelayedErrors;
use unicode_bidi::{BidiInfo, Level as BidiLevel};
use unicode_script::{Script, UnicodeScript};
-use super::{BoxElem, HElem, Sizing, Spacing};
-use crate::layout::AlignElem;
+use crate::layout::{AlignElem, BoxElem, HElem, Sizing, Spacing};
use crate::math::EquationElem;
use crate::prelude::*;
use crate::text::{
diff --git a/crates/typst-library/src/layout/repeat.rs b/crates/typst-library/src/layout/repeat.rs
index 6b30dd50..ce31164e 100644
--- a/crates/typst-library/src/layout/repeat.rs
+++ b/crates/typst-library/src/layout/repeat.rs
@@ -1,7 +1,6 @@
+use crate::layout::AlignElem;
use crate::prelude::*;
-use super::AlignElem;
-
/// Repeats content to the available space.
///
/// This can be useful when implementing a custom index, reference, or outline.
diff --git a/crates/typst-library/src/layout/stack.rs b/crates/typst-library/src/layout/stack.rs
index 50d1c862..c12d2048 100644
--- a/crates/typst-library/src/layout/stack.rs
+++ b/crates/typst-library/src/layout/stack.rs
@@ -1,4 +1,4 @@
-use super::{AlignElem, Spacing};
+use crate::layout::{AlignElem, Spacing};
use crate::prelude::*;
/// Arranges content and spacing horizontally or vertically.
diff --git a/crates/typst-library/src/layout/terms.rs b/crates/typst-library/src/layout/terms.rs
index d4262118..d373768d 100644
--- a/crates/typst-library/src/layout/terms.rs
+++ b/crates/typst-library/src/layout/terms.rs
@@ -1,5 +1,4 @@
-use super::{HElem, VElem};
-use crate::layout::{BlockElem, ParElem, Spacing};
+use crate::layout::{BlockElem, HElem, ParElem, Spacing, VElem};
use crate::prelude::*;
/// A list of terms and their descriptions.
diff --git a/crates/typst-library/src/math/accent.rs b/crates/typst-library/src/math/accent.rs
index bedc5635..1b2d4793 100644
--- a/crates/typst-library/src/math/accent.rs
+++ b/crates/typst-library/src/math/accent.rs
@@ -1,4 +1,4 @@
-use super::*;
+use crate::math::*;
/// How much the accent can be shorter than the base.
const ACCENT_SHORT_FALL: Em = Em::new(0.5);
diff --git a/crates/typst-library/src/math/align.rs b/crates/typst-library/src/math/align.rs
index bf81597c..4192e97b 100644
--- a/crates/typst-library/src/math/align.rs
+++ b/crates/typst-library/src/math/align.rs
@@ -1,4 +1,4 @@
-use super::*;
+use crate::math::*;
/// A math alignment point: `&`, `&&`.
#[elem(title = "Alignment Point", LayoutMath)]
diff --git a/crates/typst-library/src/math/matrix.rs b/crates/typst-library/src/math/matrix.rs
index 4142d235..b5d21ed6 100644
--- a/crates/typst-library/src/math/matrix.rs
+++ b/crates/typst-library/src/math/matrix.rs
@@ -1,5 +1,3 @@
-use typst::model::Resolve;
-
use super::*;
const DEFAULT_ROW_GAP: Em = Em::new(0.5);
diff --git a/crates/typst-library/src/math/op.rs b/crates/typst-library/src/math/op.rs
index 8f44b3e1..9e35d207 100644
--- a/crates/typst-library/src/math/op.rs
+++ b/crates/typst-library/src/math/op.rs
@@ -1,5 +1,3 @@
-use typst::eval::Scope;
-
use super::*;
/// A text operator in an equation.
diff --git a/crates/typst-library/src/meta/bibliography.rs b/crates/typst-library/src/meta/bibliography.rs
index c6937aad..c258d19d 100644
--- a/crates/typst-library/src/meta/bibliography.rs
+++ b/crates/typst-library/src/meta/bibliography.rs
@@ -21,11 +21,12 @@ use typst::eval::{eval_string, Bytes, CastInfo, EvalMode, Reflect};
use typst::font::FontStyle;
use typst::util::{option_eq, PicoStr};
-use super::{CitationForm, CiteGroup, LinkElem, LocalName};
use crate::layout::{
BlockElem, GridElem, HElem, PadElem, ParElem, Sizing, TrackSizings, VElem,
};
-use crate::meta::{FootnoteElem, HeadingElem, LocalNameIn};
+use crate::meta::{
+ CitationForm, CiteGroup, FootnoteElem, HeadingElem, LinkElem, LocalName, LocalNameIn,
+};
use crate::prelude::*;
use crate::text::{Delta, SubElem, SuperElem, TextElem};
diff --git a/crates/typst-library/src/meta/cite.rs b/crates/typst-library/src/meta/cite.rs
index a61523d8..c0bd71ae 100644
--- a/crates/typst-library/src/meta/cite.rs
+++ b/crates/typst-library/src/meta/cite.rs
@@ -1,5 +1,5 @@
-use super::bibliography::Works;
-use super::CslStyle;
+use crate::meta::bibliography::Works;
+use crate::meta::CslStyle;
use crate::prelude::*;
use crate::text::TextElem;
diff --git a/crates/typst-library/src/meta/counter.rs b/crates/typst-library/src/meta/counter.rs
index 45041a38..0e733efb 100644
--- a/crates/typst-library/src/meta/counter.rs
+++ b/crates/typst-library/src/meta/counter.rs
@@ -5,9 +5,9 @@ use smallvec::{smallvec, SmallVec};
use typst::eval::{Repr, Tracer};
use typst::model::DelayedErrors;
-use super::{FigureElem, HeadingElem, Numbering, NumberingPattern};
use crate::layout::PageElem;
use crate::math::EquationElem;
+use crate::meta::{FigureElem, HeadingElem, Numbering, NumberingPattern};
use crate::prelude::*;
/// Counts through pages, elements, and more.
diff --git a/crates/typst-library/src/meta/figure.rs b/crates/typst-library/src/meta/figure.rs
index 8e08b940..e96b076c 100644
--- a/crates/typst-library/src/meta/figure.rs
+++ b/crates/typst-library/src/meta/figure.rs
@@ -1,9 +1,11 @@
use std::borrow::Cow;
use std::str::FromStr;
-use super::{Count, Counter, CounterKey, CounterUpdate, Numbering, NumberingPattern};
use crate::layout::{BlockElem, PlaceElem, VElem};
-use crate::meta::{Outlinable, Refable, Supplement};
+use crate::meta::{
+ Count, Counter, CounterKey, CounterUpdate, Numbering, NumberingPattern, Outlinable,
+ Refable, Supplement,
+};
use crate::prelude::*;
use crate::text::TextElem;
use crate::visualize::ImageElem;
diff --git a/crates/typst-library/src/meta/footnote.rs b/crates/typst-library/src/meta/footnote.rs
index c7bed909..189dbcb8 100644
--- a/crates/typst-library/src/meta/footnote.rs
+++ b/crates/typst-library/src/meta/footnote.rs
@@ -1,9 +1,8 @@
use comemo::Prehashed;
use std::str::FromStr;
-use super::{Counter, Numbering, NumberingPattern};
use crate::layout::{HElem, ParElem};
-use crate::meta::{Count, CounterUpdate};
+use crate::meta::{Count, Counter, CounterUpdate, Numbering, NumberingPattern};
use crate::prelude::*;
use crate::text::{SuperElem, TextElem, TextSize};
use crate::visualize::LineElem;
diff --git a/crates/typst-library/src/meta/outline.rs b/crates/typst-library/src/meta/outline.rs
index b3b97087..ebd6c4b0 100644
--- a/crates/typst-library/src/meta/outline.rs
+++ b/crates/typst-library/src/meta/outline.rs
@@ -2,11 +2,11 @@ use std::str::FromStr;
use typst::util::option_eq;
-use super::{
- Counter, CounterKey, HeadingElem, LocalName, Numbering, NumberingPattern, Refable,
-};
use crate::layout::{BoxElem, HElem, HideElem, ParbreakElem, RepeatElem, Spacing};
-use crate::meta::LocalNameIn;
+use crate::meta::{
+ Counter, CounterKey, HeadingElem, LocalName, LocalNameIn, Numbering,
+ NumberingPattern, Refable,
+};
use crate::prelude::*;
use crate::text::{LinebreakElem, SpaceElem, TextElem};
diff --git a/crates/typst-library/src/text/deco.rs b/crates/typst-library/src/text/deco.rs
index d8167788..aecff401 100644
--- a/crates/typst-library/src/text/deco.rs
+++ b/crates/typst-library/src/text/deco.rs
@@ -1,8 +1,8 @@
use kurbo::{BezPath, Line, ParamCurve};
use ttf_parser::{GlyphId, OutlineBuilder};
-use super::{BottomEdge, BottomEdgeMetric, TextElem, TopEdge, TopEdgeMetric};
use crate::prelude::*;
+use crate::text::{BottomEdge, BottomEdgeMetric, TextElem, TopEdge, TopEdgeMetric};
/// Underlines text.
///
diff --git a/crates/typst-library/src/text/linebreak.rs b/crates/typst-library/src/text/linebreak.rs
index 3992d54d..5602d9cc 100644
--- a/crates/typst-library/src/text/linebreak.rs
+++ b/crates/typst-library/src/text/linebreak.rs
@@ -7,8 +7,8 @@ use once_cell::sync::Lazy;
use typst::doc::Lang;
use typst::syntax::link_prefix;
-use super::TextElem;
use crate::layout::Preparation;
+use crate::text::TextElem;
/// Generated by the following command:
///
diff --git a/crates/typst-library/src/text/misc.rs b/crates/typst-library/src/text/misc.rs
index 9f768f11..1bf28a34 100644
--- a/crates/typst-library/src/text/misc.rs
+++ b/crates/typst-library/src/text/misc.rs
@@ -1,5 +1,5 @@
-use super::TextElem;
use crate::prelude::*;
+use crate::text::TextElem;
/// A text space.
#[elem(Behave, Unlabellable, PlainText, Repr)]
diff --git a/crates/typst-library/src/text/quote.rs b/crates/typst-library/src/text/quote.rs
index 3301f4e9..8d7bd15b 100644
--- a/crates/typst-library/src/text/quote.rs
+++ b/crates/typst-library/src/text/quote.rs
@@ -1,7 +1,7 @@
-use super::{SmartquoteElem, SpaceElem, TextElem};
use crate::layout::{BlockElem, HElem, PadElem, Spacing, VElem};
use crate::meta::{CitationForm, CiteElem};
use crate::prelude::*;
+use crate::text::{SmartquoteElem, SpaceElem, TextElem};
/// Displays a quote alongside an optional attribution.
///
diff --git a/crates/typst-library/src/text/raw.rs b/crates/typst-library/src/text/raw.rs
index 21da104c..c5e152cf 100644
--- a/crates/typst-library/src/text/raw.rs
+++ b/crates/typst-library/src/text/raw.rs
@@ -13,12 +13,12 @@ use typst::syntax::{self, split_newlines, LinkedNode};
use typst::util::option_eq;
use unicode_segmentation::UnicodeSegmentation;
-use super::{
- FontFamily, FontList, Hyphenate, LinebreakElem, SmartquoteElem, TextElem, TextSize,
-};
use crate::layout::BlockElem;
use crate::meta::Figurable;
use crate::prelude::*;
+use crate::text::{
+ FontFamily, FontList, Hyphenate, LinebreakElem, SmartquoteElem, TextElem, TextSize,
+};
// Shorthand for highlighter closures.
type StyleFn<'a> = &'a mut dyn FnMut(&LinkedNode, Range<usize>, synt::Style) -> Content;
diff --git a/crates/typst-library/src/text/shaping.rs b/crates/typst-library/src/text/shaping.rs
index 05ed4633..2d820c64 100644
--- a/crates/typst-library/src/text/shaping.rs
+++ b/crates/typst-library/src/text/shaping.rs
@@ -8,9 +8,9 @@ use typst::font::{Font, FontStyle, FontVariant};
use typst::util::SliceExt;
use unicode_script::{Script, UnicodeScript};
-use super::{decorate, NumberType, NumberWidth, TextElem};
use crate::layout::SpanMapper;
use crate::prelude::*;
+use crate::text::{decorate, NumberType, NumberWidth, TextElem};
/// The result of shaping text.
///
diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs
index 903982ef..a1862098 100644
--- a/crates/typst-library/src/text/shift.rs
+++ b/crates/typst-library/src/text/shift.rs
@@ -1,5 +1,5 @@
-use super::{variant, SpaceElem, TextElem, TextSize};
use crate::prelude::*;
+use crate::text::{variant, SpaceElem, TextElem, TextSize};
/// Renders text in subscript.
///