summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/color.rs8
-rw-r--r--src/diagnostic.rs8
-rw-r--r--src/eval/value.rs2
-rw-r--r--src/lib.rs5
-rw-r--r--src/macros.rs10
-rw-r--r--src/parse/tests.rs2
-rw-r--r--src/prelude.rs4
-rw-r--r--src/syntax/ast/lit.rs2
-rw-r--r--src/syntax/span.rs2
-rw-r--r--src/syntax/token.rs2
10 files changed, 20 insertions, 25 deletions
diff --git a/src/color.rs b/src/color.rs
index 119192fe..5944b7c0 100644
--- a/src/color.rs
+++ b/src/color.rs
@@ -20,9 +20,11 @@ pub struct RgbaColor {
pub b: u8,
/// Alpha channel.
pub a: u8,
- /// This is true if this value was provided as a fail-over by the parser
- /// because the user-defined value was invalid. This color may be
- /// overwritten if this property is true.
+ /// Whether the color was provided as a fail-over by the parser because the
+ /// user-defined value was invalid.
+ ///
+ /// If this is true, the color may be replaced with any color deemed
+ /// approriate at the use-site.
pub healed: bool,
}
diff --git a/src/diagnostic.rs b/src/diagnostic.rs
index 2548e1d5..8d56f401 100644
--- a/src/diagnostic.rs
+++ b/src/diagnostic.rs
@@ -41,7 +41,7 @@ impl Display for Level {
}
}
-/// Construct a diagnostic with `Error` level.
+/// Construct a diagnostic with [`Error`] level.
///
/// ```
/// # use typstc::error;
@@ -59,6 +59,8 @@ impl Display for Level {
/// // Create an error and directly add it to existing feedback.
/// error!(@feedback, span, "oh no!");
/// ```
+///
+/// [`Error`]: diagnostic/enum.Level.html#variant.Error
#[macro_export]
macro_rules! error {
($($tts:tt)*) => {
@@ -66,10 +68,12 @@ macro_rules! error {
};
}
-/// Construct a diagnostic with `Warning` level.
+/// Construct a diagnostic with [`Warning`] level.
///
/// This works exactly like `error!`. See its documentation for more
/// information.
+///
+/// [`Warning`]: diagnostic/enum.Level.html#variant.Warning
#[macro_export]
macro_rules! warning {
($($tts:tt)*) => {
diff --git a/src/eval/value.rs b/src/eval/value.rs
index 85ac2367..f6c1fcd7 100644
--- a/src/eval/value.rs
+++ b/src/eval/value.rs
@@ -31,7 +31,7 @@ pub enum Value {
Length(f64),
/// A relative value: `50%`.
///
- /// Note: `50%` is represented as `0.5` here, but as `50.0` in the
+ /// _Note_: `50%` is represented as `0.5` here, but as `50.0` in the
/// corresponding [literal].
///
/// [literal]: ../syntax/ast/enum.Lit.html#variant.Percent
diff --git a/src/lib.rs b/src/lib.rs
index 3be97873..c47f7f51 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -22,8 +22,6 @@
//! [`MultiLayout`]: layout/type.MultiLayout.html
#[macro_use]
-mod macros;
-#[macro_use]
pub mod diagnostic;
pub mod color;
@@ -122,8 +120,7 @@ impl Typesetter {
}
/// A dynamic future type which allows recursive invocation of async functions
-/// when used as the return type. This is also how the async trait functions
-/// work internally.
+/// when used as the return type.
pub type DynFuture<'a, T> = Pin<Box<dyn Future<Output = T> + 'a>>;
/// The result of some pass: Some output `T` and feedback data.
diff --git a/src/macros.rs b/src/macros.rs
deleted file mode 100644
index 710af1e6..00000000
--- a/src/macros.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-/// Unwrap the option if it is `Some(T)` or evaluate `$or` if it is `None`.
-#[allow(unused)]
-macro_rules! try_or {
- ($option:expr, $or:expr $(,)?) => {
- match $option {
- Some(v) => v,
- None => $or,
- }
- };
-}
diff --git a/src/parse/tests.rs b/src/parse/tests.rs
index 4315fd2c..21375a0f 100644
--- a/src/parse/tests.rs
+++ b/src/parse/tests.rs
@@ -366,7 +366,7 @@ fn test_parse_colon_starting_func_args() {
e!("[val/🌎:$]" => s(4, 4, "expected colon"));
// String in invalid header without colon still parsed as string
- // Note: No "expected quote" error because not even the string was
+ // _Note_: No "expected quote" error because not even the string was
// expected.
e!("[val/\"]" => s(4, 4, "expected colon"),
s(7, 7, "expected closing bracket"));
diff --git a/src/prelude.rs b/src/prelude.rs
index 0fab6fbb..899ced7d 100644
--- a/src/prelude.rs
+++ b/src/prelude.rs
@@ -1,9 +1,11 @@
//! A prelude for building custom functions.
+#[doc(no_inline)]
pub use crate::eval::{Dict, DictValue, Value};
pub use crate::layout::primitive::*;
+#[doc(no_inline)]
pub use crate::layout::{layout, Command, Commands, LayoutContext};
-pub use crate::style::*;
+#[doc(no_inline)]
pub use crate::syntax::{Span, Spanned, SynTree};
pub use crate::{Feedback, Pass};
diff --git a/src/syntax/ast/lit.rs b/src/syntax/ast/lit.rs
index c08dc8cd..3b6441e7 100644
--- a/src/syntax/ast/lit.rs
+++ b/src/syntax/ast/lit.rs
@@ -22,7 +22,7 @@ pub enum Lit {
Length(Length),
/// A percent literal: `50%`.
///
- /// Note: `50%` is represented as `50.0` here, but as `0.5` in the
+ /// _Note_: `50%` is represented as `50.0` here, but as `0.5` in the
/// corresponding [value].
///
/// [value]: ../../eval/enum.Value.html#variant.Relative
diff --git a/src/syntax/span.rs b/src/syntax/span.rs
index 09e5f02c..e9e1021c 100644
--- a/src/syntax/span.rs
+++ b/src/syntax/span.rs
@@ -83,7 +83,7 @@ impl<T> Spanned<T> {
}
impl<T> Spanned<Option<T>> {
- /// Swap the spanned and option.
+ /// Swap the spanned and the option.
pub fn transpose(self) -> Option<Spanned<T>> {
let Spanned { v, span } = self;
v.map(|v| v.span_with(span))
diff --git a/src/syntax/token.rs b/src/syntax/token.rs
index e3fada43..cb0526c1 100644
--- a/src/syntax/token.rs
+++ b/src/syntax/token.rs
@@ -75,7 +75,7 @@ pub enum Token<'s> {
Length(Length),
/// A percentage: `50%`.
///
- /// Note: `50%` is represented as `50.0` here, as in the corresponding
+ /// _Note_: `50%` is represented as `50.0` here, as in the corresponding
/// [literal].
///
/// [literal]: ../ast/enum.Lit.html#variant.Percent