diff options
Diffstat (limited to 'crates')
48 files changed, 206 insertions, 212 deletions
diff --git a/crates/typst-macros/src/category.rs b/crates/typst-macros/src/category.rs index 399a0510..ac8c813d 100644 --- a/crates/typst-macros/src/category.rs +++ b/crates/typst-macros/src/category.rs @@ -20,6 +20,7 @@ pub fn category(_: TokenStream, item: syn::Item) -> Result<TokenStream> { Ok(quote! { #(#attrs)* + #[allow(rustdoc::broken_intra_doc_links)] #vis static #ident: #ty = { static DATA: #foundations::CategoryData = #foundations::CategoryData { name: #name, diff --git a/crates/typst-macros/src/elem.rs b/crates/typst-macros/src/elem.rs index f14d3350..7734dd54 100644 --- a/crates/typst-macros/src/elem.rs +++ b/crates/typst-macros/src/elem.rs @@ -311,6 +311,7 @@ fn create_struct(element: &Elem) -> TokenStream { #[doc = #docs] #[derive(#debug Clone, Hash)] #[allow(clippy::derived_hash_with_manual_eq)] + #[allow(rustdoc::broken_intra_doc_links)] #vis struct #ident { #(#fields,)* } diff --git a/crates/typst-macros/src/func.rs b/crates/typst-macros/src/func.rs index 728ab05b..b7a7ac63 100644 --- a/crates/typst-macros/src/func.rs +++ b/crates/typst-macros/src/func.rs @@ -233,6 +233,7 @@ fn create(func: &Func, item: &syn::ItemFn) -> TokenStream { quote! { #[doc = #docs] #[allow(dead_code)] + #[allow(rustdoc::broken_intra_doc_links)] #item #[doc(hidden)] diff --git a/crates/typst-macros/src/ty.rs b/crates/typst-macros/src/ty.rs index 943bd453..a6ae3f1c 100644 --- a/crates/typst-macros/src/ty.rs +++ b/crates/typst-macros/src/ty.rs @@ -101,7 +101,14 @@ fn create(ty: &Type, item: Option<&syn::Item>) -> TokenStream { } }; + let attr = item.map(|_| { + quote! { + #[allow(rustdoc::broken_intra_doc_links)] + } + }); + quote! { + #attr #item #cast diff --git a/crates/typst/src/foundations/bytes.rs b/crates/typst/src/foundations/bytes.rs index 605af065..4b8800e8 100644 --- a/crates/typst/src/foundations/bytes.rs +++ b/crates/typst/src/foundations/bytes.rs @@ -17,10 +17,10 @@ use crate::util::LazyHash; /// using a [for loop]($scripting/#loops). /// /// You can convert -/// - a [string]($str) or an [array]($array) of integers to bytes with the -/// [`bytes`]($bytes) constructor -/// - bytes to a string with the [`str`]($str) constructor, with UTF-8 encoding -/// - bytes to an array of integers with the [`array`]($array) constructor +/// - a [string]($str) or an [array] of integers to bytes with the [`bytes`] +/// constructor +/// - bytes to a string with the [`str`] constructor, with UTF-8 encoding +/// - bytes to an array of integers with the [`array`] constructor /// /// When [reading]($read) data from a file, you can decide whether to load it /// as a string or as raw bytes. diff --git a/crates/typst/src/foundations/content.rs b/crates/typst/src/foundations/content.rs index 54789be0..83e94d30 100644 --- a/crates/typst/src/foundations/content.rs +++ b/crates/typst/src/foundations/content.rs @@ -67,7 +67,7 @@ use crate::util::{fat, BitSet, LazyHash}; /// /// In the web app, you can hover over a content variable to see exactly which /// elements the content is composed of and what fields they have. -/// Alternatively, you can inspect the output of the [`repr`]($repr) function. +/// Alternatively, you can inspect the output of the [`repr`] function. #[ty(scope, cast)] #[derive(Clone, Hash)] #[allow(clippy::derived_hash_with_manual_eq)] @@ -569,10 +569,9 @@ impl Content { } /// The location of the content. This is only available on content returned - /// by [query]($query) or provided by a - /// [show rule]($reference/styling/#show-rules), for other content it will - /// be `{none}`. The resulting location can be used with - /// [counters]($counter), [state]($state) and [queries]($query). + /// by [query] or provided by a [show rule]($reference/styling/#show-rules), + /// for other content it will be `{none}`. The resulting location can be + /// used with [counters]($counter), [state] and [queries]($query). #[func] pub fn location(&self) -> Option<Location> { self.inner.location diff --git a/crates/typst/src/foundations/datetime.rs b/crates/typst/src/foundations/datetime.rs index 053aa422..9e4f0084 100644 --- a/crates/typst/src/foundations/datetime.rs +++ b/crates/typst/src/foundations/datetime.rs @@ -213,8 +213,8 @@ impl Datetime { impl Datetime { /// Creates a new datetime. /// - /// You can specify the [datetime]($datetime) using a year, month, day, - /// hour, minute, and second. + /// You can specify the [datetime] using a year, month, day, hour, minute, + /// and second. /// /// _Note_: Depending on which components of the datetime you specify, Typst /// will store it in one of the following three ways: diff --git a/crates/typst/src/foundations/duration.rs b/crates/typst/src/foundations/duration.rs index 83e3d962..94d44fb2 100644 --- a/crates/typst/src/foundations/duration.rs +++ b/crates/typst/src/foundations/duration.rs @@ -22,8 +22,8 @@ impl Duration { impl Duration { /// Creates a new duration. /// - /// You can specify the [duration]($duration) using weeks, days, hours, - /// minutes and seconds. You can also get a duration by subtracting two + /// You can specify the [duration] using weeks, days, hours, minutes and + /// seconds. You can also get a duration by subtracting two /// [datetimes]($datetime). /// /// ```example diff --git a/crates/typst/src/foundations/selector.rs b/crates/typst/src/foundations/selector.rs index 28c1967a..92bfa823 100644 --- a/crates/typst/src/foundations/selector.rs +++ b/crates/typst/src/foundations/selector.rs @@ -44,23 +44,22 @@ pub use crate::__select_where as select_where; /// A filter for selecting elements within the document. /// /// You can construct a selector in the following ways: -/// - you can use an element [function]($function) +/// - you can use an element [function] /// - you can filter for an element function with /// [specific fields]($function.where) /// - you can use a [string]($str) or [regular expression]($regex) /// - you can use a [`{<label>}`]($label) -/// - you can use a [`location`]($location) -/// - call the [`selector`]($selector) constructor to convert any of the above -/// types into a selector value and use the methods below to refine it +/// - you can use a [`location`] +/// - call the [`selector`] constructor to convert any of the above types into a +/// selector value and use the methods below to refine it /// /// Selectors are used to [apply styling rules]($styling/#show-rules) to -/// elements. You can also use selectors to [query]($query) the document for -/// certain types of elements. +/// elements. You can also use selectors to [query] the document for certain +/// types of elements. /// /// Furthermore, you can pass a selector to several of Typst's built-in -/// functions to configure their behaviour. One such example is the -/// [outline]($outline) where it can be used to change which elements are listed -/// within the outline. +/// functions to configure their behaviour. One such example is the [outline] +/// where it can be used to change which elements are listed within the outline. /// /// Multiple selectors can be combined using the methods shown below. However, /// not all kinds of selectors are supported in all places, at the moment. diff --git a/crates/typst/src/foundations/styles.rs b/crates/typst/src/foundations/styles.rs index 95fb96fc..9bdeb4ea 100644 --- a/crates/typst/src/foundations/styles.rs +++ b/crates/typst/src/foundations/styles.rs @@ -20,9 +20,9 @@ use crate::util::LazyHash; /// Provides access to active styles. /// /// The styles are currently opaque and only useful in combination with the -/// [`measure`]($measure) function. See its documentation for more details. In -/// the future, the provided styles might also be directly accessed to look up -/// styles defined by [set rules]($styling/#set-rules). +/// [`measure`] function. See its documentation for more details. In the future, +/// the provided styles might also be directly accessed to look up styles +/// defined by [set rules]($styling/#set-rules). /// /// ```example /// #let thing(body) = context { diff --git a/crates/typst/src/foundations/version.rs b/crates/typst/src/foundations/version.rs index 6f5c350c..9e2c61ba 100644 --- a/crates/typst/src/foundations/version.rs +++ b/crates/typst/src/foundations/version.rs @@ -19,7 +19,7 @@ use crate::foundations::{cast, func, repr, scope, ty, Repr}; /// as `0`, `0.0`, `0.0.0`, and so on. /// /// You can convert a version to an array of explicitly given components using -/// the [`array`]($array) constructor. +/// the [`array`] constructor. #[ty(scope, cast)] #[derive(Debug, Default, Clone, Hash)] #[allow(clippy::derived_hash_with_manual_eq)] diff --git a/crates/typst/src/introspection/counter.rs b/crates/typst/src/introspection/counter.rs index 121611a2..3bf553a5 100644 --- a/crates/typst/src/introspection/counter.rs +++ b/crates/typst/src/introspection/counter.rs @@ -28,14 +28,14 @@ use crate::World; /// other things you want to count. /// /// Since counters change throughout the course of the document, their current -/// value is _contextual_ It is recommended to read the chapter on -/// [context]($context) before continuing here. +/// value is _contextual._ It is recommended to read the chapter on [context] +/// before continuing here. /// /// # Accessing a counter { #accessing } /// To access the raw value of a counter, we can use the [`get`]($counter.get) -/// function. This function returns an [array]($array): Counters can have -/// multiple levels (in the case of headings for sections, subsections, and so -/// on), and each item in the array corresponds to one level. +/// function. This function returns an [array]: Counters can have multiple +/// levels (in the case of headings for sections, subsections, and so on), and +/// each item in the array corresponds to one level. /// /// ```example /// #set heading(numbering: "1.") @@ -49,8 +49,7 @@ use crate::World; /// Often, we want to display the value of a counter in a more human-readable /// way. To do that, we can call the [`display`]($counter.display) function on /// the counter. This function retrieves the current counter value and formats -/// it either with a provided or with an automatically inferred -/// [numbering]($numbering). +/// it either with a provided or with an automatically inferred [numbering]. /// /// ```example /// #set heading(numbering: "1.") @@ -199,7 +198,7 @@ use crate::World; /// ``` /// /// # Other kinds of state { #other-state } -/// The `counter` type is closely related to [state]($state) type. Read its +/// The `counter` type is closely related to [state] type. Read its /// documentation for more details on state management in Typst and why it /// doesn't just use normal variables for counters. #[ty(scope)] @@ -410,7 +409,7 @@ impl Counter { /// label, /// - If this is an element function or selector, counts through its /// elements, - /// - If this is the [`page`]($page) function, counts through pages. + /// - If this is the [`page`] function, counts through pages. key: CounterKey, ) -> Counter { Self(key) diff --git a/crates/typst/src/introspection/here.rs b/crates/typst/src/introspection/here.rs index 310c38d3..ac6b5335 100644 --- a/crates/typst/src/introspection/here.rs +++ b/crates/typst/src/introspection/here.rs @@ -5,21 +5,21 @@ use crate::introspection::Location; /// Provides the current location in the document. /// /// You can think of `here` as a low-level building block that directly extracts -/// the current location from the active [context]($context). Some other -/// functions use it internally: For instance, `{counter.get()}` is equivalent -/// to `{counter.at(here())}`. +/// the current location from the active [context]. Some other functions use it +/// internally: For instance, `{counter.get()}` is equivalent to +/// `{counter.at(here())}`. /// /// Within show rules on [locatable]($location/#locatable) elements, `{here()}` /// will match the location of the shown element. /// /// If you want to display the current page number, refer to the documentation -/// of the [`counter`]($counter) type. While `here` can be used to determine the -/// physical page number, typically you want the logical page number that may, -/// for instance, have been reset after a preface. +/// of the [`counter`] type. While `here` can be used to determine the physical +/// page number, typically you want the logical page number that may, for +/// instance, have been reset after a preface. /// /// # Examples /// Determining the current position in the document in combination with -/// [`locate`]($locate): +/// [`locate`]: /// ```example /// #context [ /// I am located at @@ -27,7 +27,7 @@ use crate::introspection::Location; /// ] /// ``` /// -/// Running a [query]($query) for elements before the current position: +/// Running a [query] for elements before the current position: /// ```example /// = Introduction /// = Background @@ -40,8 +40,7 @@ use crate::introspection::Location; /// /// = Conclusion /// ``` -/// Refer to the [`selector`]($selector) type for more details on before/after -/// selectors. +/// Refer to the [`selector`] type for more details on before/after selectors. #[func(contextual)] pub fn here( /// The callsite context. diff --git a/crates/typst/src/introspection/locate.rs b/crates/typst/src/introspection/locate.rs index 147bfb0e..1ce3ae38 100644 --- a/crates/typst/src/introspection/locate.rs +++ b/crates/typst/src/introspection/locate.rs @@ -10,8 +10,8 @@ use crate::syntax::Span; /// Determines the location of an element in the document. /// /// Takes a selector that must match exactly one element and returns that -/// element's [`location`]($location). This location can, in particular, be used -/// to retrieve the physical [`page`]($location.page) number and +/// element's [`location`]. This location can, in particular, be used to +/// retrieve the physical [`page`]($location.page) number and /// [`position`]($location.position) (page, x, y) for that element. /// /// # Examples @@ -27,7 +27,7 @@ use crate::syntax::Span; /// /// # Compatibility /// In Typst 0.10 and lower, the `locate` function took a closure that made the -/// current location in the document available (like [`here`]($here) does now). +/// current location in the document available (like [`here`] does now). /// Compatibility with the old way will remain for a while to give package /// authors time to upgrade. To that effect, `locate` detects whether it /// received a selector or a user-defined function and adjusts its semantics @@ -44,8 +44,8 @@ pub fn locate( /// located. /// /// Especially useful in combination with - /// - [`here`]($here) to locate the current context, - /// - a [`location`]($location) retrieved from some queried element via the + /// - [`here`] to locate the current context, + /// - a [`location`] retrieved from some queried element via the /// [`location()`]($content.location) method on content. selector: LocateInput, ) -> HintedStrResult<LocateOutput> { diff --git a/crates/typst/src/introspection/location.rs b/crates/typst/src/introspection/location.rs index 215303f5..8cd49b07 100644 --- a/crates/typst/src/introspection/location.rs +++ b/crates/typst/src/introspection/location.rs @@ -11,17 +11,15 @@ use crate::model::Numbering; /// /// A location uniquely identifies an element in the document and lets you /// access its absolute position on the pages. You can retrieve the current -/// location with the [`here`]($here) function and the location of a queried -/// or shown element with the [`location()`]($content.location) method on -/// content. +/// location with the [`here`] function and the location of a queried or shown +/// element with the [`location()`]($content.location) method on content. /// /// # Locatable elements { #locatable } /// Currently, only a subset of element functions is locatable. Aside from -/// headings and figures, this includes equations, references and all -/// elements with an explicit label. As a result, you _can_ query for e.g. -/// [`strong`]($strong) elements, but you will find only those that have an -/// explicit label attached to them. This limitation will be resolved in the -/// future. +/// headings and figures, this includes equations, references and all elements +/// with an explicit label. As a result, you _can_ query for e.g. [`strong`] +/// elements, but you will find only those that have an explicit label attached +/// to them. This limitation will be resolved in the future. #[ty(scope)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub struct Location { @@ -54,7 +52,7 @@ impl Location { /// If you want to know the value of the page counter, use /// `{counter(page).at(loc)}` instead. /// - /// Can be used with [`here`]($here) to retrieve the physical page position + /// Can be used with [`here`] to retrieve the physical page position /// of the current context: /// ```example /// #context [ diff --git a/crates/typst/src/introspection/metadata.rs b/crates/typst/src/introspection/metadata.rs index 962d57e4..287bef67 100644 --- a/crates/typst/src/introspection/metadata.rs +++ b/crates/typst/src/introspection/metadata.rs @@ -6,11 +6,11 @@ use crate::realize::{Behave, Behaviour}; /// Exposes a value to the query system without producing visible content. /// -/// This element can be retrieved with the [`query`]($query) function and from -/// the command line with [`typst query`]($reference/meta/query/#cli-queries). -/// Its purpose is to expose an arbitrary value to the introspection system. To -/// identify a metadata value among others, you can attach a [`label`]($label) -/// to it and query for that label. +/// This element can be retrieved with the [`query`] function and from the +/// command line with [`typst query`]($reference/meta/query/#cli-queries). Its +/// purpose is to expose an arbitrary value to the introspection system. To +/// identify a metadata value among others, you can attach a [`label`] to it and +/// query for that label. /// /// The `metadata` element is especially useful for command line queries because /// it allows you to expose arbitrary values to the outside world. diff --git a/crates/typst/src/introspection/mod.rs b/crates/typst/src/introspection/mod.rs index 2019111e..4ccff0c1 100644 --- a/crates/typst/src/introspection/mod.rs +++ b/crates/typst/src/introspection/mod.rs @@ -43,7 +43,7 @@ use crate::realize::{Behave, Behaviour}; /// of figures or headers which show the current chapter title. /// /// Most of the functions are _contextual._ It is recommended to read the chapter -/// on [context]($context) before continuing here. +/// on [context] before continuing here. #[category] pub static INTROSPECTION: Category; diff --git a/crates/typst/src/introspection/query.rs b/crates/typst/src/introspection/query.rs index c80fe4ef..a6ddb815 100644 --- a/crates/typst/src/introspection/query.rs +++ b/crates/typst/src/introspection/query.rs @@ -7,21 +7,18 @@ use crate::introspection::Location; /// /// The `query` functions lets you search your document for elements of a /// particular type or with a particular label. To use it, you first need to -/// retrieve the current document location with the [`locate`]($locate) -/// function. -/// -/// You can get the location of the elements returned by `query` with -/// [`location`]($content.location). +/// ensure that [context] is available. /// + /// # Finding elements /// In the example below, we create a custom page header that displays the text /// "Typst Academy" in small capitals and the current section title. On the /// first page, the section title is omitted because the header is before the /// first section heading. /// -/// To realize this layout, we call `locate` and then query for all headings -/// after the current location. The function we pass to locate is called twice -/// in this case: Once per page. +/// To realize this layout, we open a `context` and then query for all headings +/// after the [current location]($here). The code within the context block +/// runs twice: Once per page. /// /// - On the first page the query for all headings before the current location /// yields an empty array: There are no previous headings. We check for this @@ -46,7 +43,7 @@ use crate::introspection::Location; /// let academy = smallcaps[ /// Typst Academy /// ] -/// if elems == () { +/// if elems.len() == 0 { /// align(right, academy) /// } else { /// let body = elems.last().body @@ -64,6 +61,9 @@ use crate::introspection::Location; /// #lorem(15) /// ``` /// +/// You can get the location of the elements returned by `query` with +/// [`location`]($content.location). +/// /// # A word of caution { #caution } /// To resolve all your queries, Typst evaluates and layouts parts of the /// document multiple times. However, there is no guarantee that your queries @@ -80,7 +80,7 @@ use crate::introspection::Location; /// /// In general, you should try not to write queries that affect themselves. The /// same words of caution also apply to other introspection features like -/// [counters]($counter) and [state]($state). +/// [counters]($counter) and [state]. /// /// ```example /// = Real @@ -95,7 +95,7 @@ use crate::introspection::Location; /// You can also perform queries from the command line with the `typst query` /// command. This command executes an arbitrary query on the document and /// returns the resulting elements in serialized form. Consider the following -/// `example.typ` file which contains some invisible [metadata]($metadata): +/// `example.typ` file which contains some invisible [metadata]: /// /// ```typ /// #metadata("This is a note") <note> diff --git a/crates/typst/src/layout/align.rs b/crates/typst/src/layout/align.rs index 3e462d33..06c48cdd 100644 --- a/crates/typst/src/layout/align.rs +++ b/crates/typst/src/layout/align.rs @@ -24,7 +24,7 @@ use crate::text::TextElem; /// ``` #[elem(Show)] pub struct AlignElem { - /// The [alignment]($alignment) along both axes. + /// The [alignment] along both axes. /// /// ```example /// #set page(height: 6cm) @@ -56,7 +56,7 @@ impl Show for Packed<AlignElem> { } } -/// Where to [align]($align) something along an axis. +/// Where to [align] something along an axis. /// /// Possible values are: /// - `start`: Aligns at the [start]($direction.start) of the [text diff --git a/crates/typst/src/layout/fr.rs b/crates/typst/src/layout/fr.rs index 6621e6bc..5a42ce6f 100644 --- a/crates/typst/src/layout/fr.rs +++ b/crates/typst/src/layout/fr.rs @@ -13,7 +13,7 @@ use crate::util::{Numeric, Scalar}; /// Each fractionally sized element gets space based on the ratio of its /// fraction to the sum of all fractions. /// -/// For more details, also see the [h]($h) and [v]($v) functions and the +/// For more details, also see the [h] and [v] functions and the /// [grid function]($grid). /// /// # Example diff --git a/crates/typst/src/layout/layout.rs b/crates/typst/src/layout/layout.rs index 360f0254..f83dd700 100644 --- a/crates/typst/src/layout/layout.rs +++ b/crates/typst/src/layout/layout.rs @@ -11,7 +11,7 @@ use crate::syntax::Span; /// (width and height). /// /// The given function must accept a single parameter, `size`, which is a -/// dictionary with keys `width` and `height`, both of type [`length`]($length). +/// dictionary with keys `width` and `height`, both of type [`length`. /// /// ```example /// #let text = lorem(30) @@ -31,9 +31,8 @@ use crate::syntax::Span; /// page it receives the page's dimensions minus its margins. This is mostly /// useful in combination with [measurement]($measure). /// -/// You can also use this function to resolve [`ratio`]($ratio) to fixed -/// lengths. This might come in handy if you're building your own layout -/// abstractions. +/// You can also use this function to resolve [`ratio`] to fixed lengths. This +/// might come in handy if you're building your own layout abstractions. /// /// ```example /// #layout(size => { @@ -51,8 +50,8 @@ pub fn layout( /// A function to call with the outer container's size. Its return value is /// displayed in the document. /// - /// The container's size is given as a [dictionary]($dictionary) with the - /// keys `width` and `height`. + /// The container's size is given as a [dictionary] with the keys `width` + /// and `height`. /// /// This function is called once for each time the content returned by /// `layout` appears in the document. That makes it possible to generate diff --git a/crates/typst/src/layout/length.rs b/crates/typst/src/layout/length.rs index ff1db8f0..ecc7a954 100644 --- a/crates/typst/src/layout/length.rs +++ b/crates/typst/src/layout/length.rs @@ -37,7 +37,7 @@ use crate::util::Numeric; /// # Fields /// - `abs`: A length with just the absolute component of the current length /// (that is, excluding the `em` component). -/// - `em`: The amount of `em` units in this length, as a [float]($float). +/// - `em`: The amount of `em` units in this length, as a [float]. #[ty(scope, cast)] #[derive(Default, Copy, Clone, Eq, PartialEq, Hash)] pub struct Length { diff --git a/crates/typst/src/layout/measure.rs b/crates/typst/src/layout/measure.rs index 52ceaae0..b2d78665 100644 --- a/crates/typst/src/layout/measure.rs +++ b/crates/typst/src/layout/measure.rs @@ -10,12 +10,12 @@ use crate::syntax::Span; /// that an infinite space is assumed, therefore the measured height/width may /// not necessarily match the final height/width of the measured content. If you /// want to measure in the current layout dimensions, you can combine `measure` -/// and [`layout`]($layout). +/// and [`layout`]. /// /// # Example -/// The same content can have a different size depending on the styles that -/// are active when it is layouted. For example, in the example below -/// `[#content]` is of course bigger when we increase the font size. +/// The same content can have a different size depending on the [context] that +/// it is placed into. For example, in the example below `[#content]` is of +/// course bigger when we increase the font size. /// /// ```example /// #let content = [Hello!] @@ -24,9 +24,7 @@ use crate::syntax::Span; /// #content /// ``` /// -/// To do a meaningful measurement, you therefore first need to retrieve the -/// active styles with the [`style`]($style) function. You can then pass them to -/// the `measure` function. +/// For this reason, you can only measure when context is available. /// /// ```example /// #let thing(body) = context { @@ -39,7 +37,7 @@ use crate::syntax::Span; /// ``` /// /// The measure function returns a dictionary with the entries `width` and -/// `height`, both of type [`length`]($length). +/// `height`, both of type [`length`]. #[func(contextual)] pub fn measure( /// The engine. @@ -50,7 +48,8 @@ pub fn measure( span: Span, /// The content whose size to measure. content: Content, - /// The styles with which to layout the content. + /// _Compatibility:_ This argument only exists for compatibility with + /// Typst 0.10 and lower and shouldn't be used anymore. #[default] styles: Option<Styles>, ) -> SourceResult<Dict> { diff --git a/crates/typst/src/layout/rel.rs b/crates/typst/src/layout/rel.rs index df58df86..fa2a56e2 100644 --- a/crates/typst/src/layout/rel.rs +++ b/crates/typst/src/layout/rel.rs @@ -10,9 +10,9 @@ use crate::util::Numeric; /// A length in relation to some known length. /// -/// This type is a combination of a [length]($length) with a [ratio]($ratio). It -/// results from addition and subtraction of a length and a ratio. Wherever a -/// relative length is expected, you can also use a bare length or ratio. +/// This type is a combination of a [length] with a [ratio]. It results from +/// addition and subtraction of a length and a ratio. Wherever a relative length +/// is expected, you can also use a bare length or ratio. /// /// # Example /// ```example diff --git a/crates/typst/src/loading/read.rs b/crates/typst/src/loading/read.rs index 7ffdbd3a..ff7f6b43 100644 --- a/crates/typst/src/loading/read.rs +++ b/crates/typst/src/loading/read.rs @@ -11,7 +11,7 @@ use crate::World; /// /// By default, the file will be read as UTF-8 and returned as a [string]($str). /// -/// If you specify `{encoding: none}`, this returns raw [bytes]($bytes) instead. +/// If you specify `{encoding: none}`, this returns raw [bytes] instead. /// /// # Example /// ```example diff --git a/crates/typst/src/model/cite.rs b/crates/typst/src/model/cite.rs index 088c7512..2d5de152 100644 --- a/crates/typst/src/model/cite.rs +++ b/crates/typst/src/model/cite.rs @@ -10,8 +10,8 @@ use crate::text::{Lang, Region, TextElem}; /// Cite a work from the bibliography. /// -/// Before you starting citing, you need to add a [bibliography]($bibliography) -/// somewhere in your document. +/// Before you starting citing, you need to add a [bibliography] somewhere in +/// your document. /// /// # Example /// ```example diff --git a/crates/typst/src/model/figure.rs b/crates/typst/src/model/figure.rs index c43c2ff9..cbe77c48 100644 --- a/crates/typst/src/model/figure.rs +++ b/crates/typst/src/model/figure.rs @@ -103,7 +103,7 @@ use crate::visualize::ImageElem; /// ``` #[elem(scope, Locatable, Synthesize, Count, Show, ShowSet, Refable, Outlinable)] pub struct FigureElem { - /// The content of the figure. Often, an [image]($image). + /// The content of the figure. Often, an [image]. #[required] pub body: Content, @@ -143,12 +143,12 @@ pub struct FigureElem { /// If set to `{auto}`, the figure will try to automatically determine its /// kind based on the type of its body. Automatically detected kinds are /// [tables]($table) and [code]($raw). In other cases, the inferred kind is - /// that of an [image]($image). + /// that of an [image]. /// /// Setting this to something other than `{auto}` will override the /// automatic detection. This can be useful if /// - you wish to create a custom figure type that is not an - /// [image]($image), a [table]($table) or [code]($raw), + /// [image], a [table] or [code]($raw), /// - you want to force the figure to use a specific counter regardless of /// its content. /// @@ -199,7 +199,7 @@ pub struct FigureElem { #[default(Em::new(0.65).into())] pub gap: Length, - /// Whether the figure should appear in an [`outline`]($outline) of figures. + /// Whether the figure should appear in an [`outline`] of figures. #[default(true)] pub outlined: bool, diff --git a/crates/typst/src/model/footnote.rs b/crates/typst/src/model/footnote.rs index 9350e853..44942341 100644 --- a/crates/typst/src/model/footnote.rs +++ b/crates/typst/src/model/footnote.rs @@ -23,9 +23,9 @@ use crate::visualize::{LineElem, Stroke}; /// /// To customize the appearance of the entry in the footnote listing, see /// [`footnote.entry`]($footnote.entry). The footnote itself is realized as a -/// normal superscript, so you can use a set rule on the [`super`]($super) -/// function to customize it. You can also apply a show rule to customize -/// only the footnote marker (superscript number) in the running text. +/// normal superscript, so you can use a set rule on the [`super`] function to +/// customize it. You can also apply a show rule to customize only the footnote +/// marker (superscript number) in the running text. /// /// # Example /// ```example @@ -56,8 +56,8 @@ pub struct FootnoteElem { /// /// By default, the footnote numbering continues throughout your document. /// If you prefer per-page footnote numbering, you can reset the footnote - /// [counter]($counter) in the page [header]($page.header). In the future, - /// there might be a simpler way to achieve this. + /// [counter] in the page [header]($page.header). In the future, there might + /// be a simpler way to achieve this. /// /// ```example /// #set footnote(numbering: "*") diff --git a/crates/typst/src/model/heading.rs b/crates/typst/src/model/heading.rs index cd342bec..0aae9f27 100644 --- a/crates/typst/src/model/heading.rs +++ b/crates/typst/src/model/heading.rs @@ -25,8 +25,8 @@ use crate::util::{option_eq, NonZeroExt}; /// [numbering pattern or function]($numbering). /// /// Independently of the numbering, Typst can also automatically generate an -/// [outline]($outline) of all headings for you. To exclude one or more headings -/// from this outline, you can set the `outlined` parameter to `{false}`. +/// [outline] of all headings for you. To exclude one or more headings from this +/// outline, you can set the `outlined` parameter to `{false}`. /// /// # Example /// ```example @@ -122,7 +122,7 @@ pub struct HeadingElem { /// ``` pub supplement: Smart<Option<Supplement>>, - /// Whether the heading should appear in the [outline]($outline). + /// Whether the heading should appear in the [outline]. /// /// Note that this property, if set to `{true}`, ensures the heading is also /// shown as a bookmark in the exported PDF's outline (when exporting to @@ -146,9 +146,9 @@ pub struct HeadingElem { /// /// The default value of `{auto}` indicates that the heading will only /// appear in the exported PDF's outline if its `outlined` property is set - /// to `{true}`, that is, if it would also be listed in Typst's - /// [outline]($outline). Setting this property to either `{true}` (bookmark) - /// or `{false}` (don't bookmark) bypasses that behaviour. + /// to `{true}`, that is, if it would also be listed in Typst's [outline]. + /// Setting this property to either `{true}` (bookmark) or `{false}` (don't + /// bookmark) bypasses that behaviour. /// /// ```example /// #heading[Normal heading] diff --git a/crates/typst/src/model/link.rs b/crates/typst/src/model/link.rs index 22500c3b..fb93f060 100644 --- a/crates/typst/src/model/link.rs +++ b/crates/typst/src/model/link.rs @@ -40,16 +40,16 @@ pub struct LinkElem { /// /// - To link to another part of the document, `dest` can take one of three /// forms: - /// - A [label]($label) attached to an element. If you also want automatic - /// text for the link based on the element, consider using a + /// - A [label] attached to an element. If you also want automatic text + /// for the link based on the element, consider using a /// [reference]($ref) instead. /// - /// - A [location]($locate) resulting from a [`locate`]($locate) call or - /// [`query`]($query). + /// - A [`location`] (typically retrieved from [`here`], [`locate`] or + /// [`query`]). /// /// - A dictionary with a `page` key of type [integer]($int) and `x` and - /// `y` coordinates of type [length]($length). Pages are counted from - /// one, and the coordinates are relative to the page's top left corner. + /// `y` coordinates of type [length]. Pages are counted from one, and + /// the coordinates are relative to the page's top left corner. /// /// ```example /// = Introduction <intro> diff --git a/crates/typst/src/model/outline.rs b/crates/typst/src/model/outline.rs index bec98b7d..cc3d6d6e 100644 --- a/crates/typst/src/model/outline.rs +++ b/crates/typst/src/model/outline.rs @@ -465,9 +465,9 @@ pub struct OutlineEntry { /// located in. When `{none}`, empty space is inserted in that gap instead. /// /// Note that, when using show rules to override outline entries, it is - /// recommended to wrap the filling content in a [`box`]($box) with - /// fractional width. For example, `{box(width: 1fr, repeat[-])}` would show - /// precisely as many `-` characters as necessary to fill a particular gap. + /// recommended to wrap the filling content in a [`box`] with fractional + /// width. For example, `{box(width: 1fr, repeat[-])}` would show precisely + /// as many `-` characters as necessary to fill a particular gap. #[required] pub fill: Option<Content>, diff --git a/crates/typst/src/model/par.rs b/crates/typst/src/model/par.rs index 629613e8..cc4a1fcb 100644 --- a/crates/typst/src/model/par.rs +++ b/crates/typst/src/model/par.rs @@ -47,8 +47,8 @@ pub struct ParElem { /// [text function's `hyphenate` property]($text.hyphenate) is set to /// `{auto}` and the current language is known. /// - /// Note that the current [alignment]($align) still has an effect on the - /// placement of the last line except if it ends with a + /// Note that the current [alignment]($align.alignment) still has an effect + /// on the placement of the last line except if it ends with a /// [justified line break]($linebreak.justify). #[ghost] #[default(false)] @@ -85,8 +85,8 @@ pub struct ParElem { /// /// By typographic convention, paragraph breaks are indicated either by some /// space between paragraphs or by indented first lines. Consider reducing - /// the [paragraph spacing]($block.spacing) to the [`leading`] when - /// using this property (e.g. using + /// the [paragraph spacing]($block.spacing) to the [`leading`]($par.leading) + /// when using this property (e.g. using /// `[#show par: set block(spacing: 0.65em)]`). #[ghost] pub first_line_indent: Length, diff --git a/crates/typst/src/model/quote.rs b/crates/typst/src/model/quote.rs index d02208b6..f4a66871 100644 --- a/crates/typst/src/model/quote.rs +++ b/crates/typst/src/model/quote.rs @@ -63,8 +63,7 @@ pub struct QuoteElem { /// Whether double quotes should be added around this quote. /// /// The double quotes used are inferred from the `quotes` property on - /// [smartquote]($smartquote), which is affected by the `lang` property on - /// [text]($text). + /// [smartquote], which is affected by the `lang` property on [text]. /// /// - `{true}`: Wrap this quote in double quotes. /// - `{false}`: Do not wrap this quote in double quotes. diff --git a/crates/typst/src/model/reference.rs b/crates/typst/src/model/reference.rs index 0d998054..4cb46617 100644 --- a/crates/typst/src/model/reference.rs +++ b/crates/typst/src/model/reference.rs @@ -18,8 +18,7 @@ use crate::text::TextElem; /// Produces a textual reference to a label. For example, a reference to a /// heading will yield an appropriate string such as "Section 1" for a reference /// to the first heading. The references are also links to the respective -/// element. Reference syntax can also be used to [cite]($cite) from a -/// bibliography. +/// element. Reference syntax can also be used to [cite] from a bibliography. /// /// Referenceable elements include [headings]($heading), [figures]($figure), /// [equations]($math.equation), and [footnotes]($footnote). To create a custom @@ -28,7 +27,7 @@ use crate::text::TextElem; /// might be a more direct way to define a custom referenceable element. /// /// If you just want to link to a labelled element and not get an automatic -/// textual reference, consider using the [`link`]($link) function instead. +/// textual reference, consider using the [`link`] function instead. /// /// # Example /// ```example @@ -96,7 +95,7 @@ pub struct RefElem { /// The target label that should be referenced. /// /// Can be a label that is defined in the document or an entry from the - /// [`bibliography`]($bibliography). + /// [`bibliography`]. #[required] pub target: Label, diff --git a/crates/typst/src/model/table.rs b/crates/typst/src/model/table.rs index 79521f2d..2285e9a7 100644 --- a/crates/typst/src/model/table.rs +++ b/crates/typst/src/model/table.rs @@ -35,7 +35,7 @@ use crate::visualize::{Paint, Stroke}; /// more information. /// /// To give a table a caption and make it [referenceable]($ref), put it into a -/// [figure]($figure). +/// [figure]. /// /// # Example /// @@ -165,7 +165,7 @@ pub struct TableElem { #[borrowed] pub align: Celled<Smart<Alignment>>, - /// How to [stroke]($stroke) the cells. + /// How to [stroke] the cells. /// /// Strokes can be disabled by setting this to `{none}`. /// diff --git a/crates/typst/src/text/deco.rs b/crates/typst/src/text/deco.rs index d105a353..c813846f 100644 --- a/crates/typst/src/text/deco.rs +++ b/crates/typst/src/text/deco.rs @@ -22,7 +22,7 @@ use crate::visualize::{styled_rect, Color, FixedStroke, Geometry, Paint, Stroke} /// ``` #[elem(Show)] pub struct UnderlineElem { - /// How to [stroke]($stroke) the line. + /// How to [stroke] the line. /// /// If set to `{auto}`, takes on the text's color and a thickness defined in /// the current font. @@ -108,7 +108,7 @@ impl Show for Packed<UnderlineElem> { /// ``` #[elem(Show)] pub struct OverlineElem { - /// How to [stroke]($stroke) the line. + /// How to [stroke] the line. /// /// If set to `{auto}`, takes on the text's color and a thickness defined in /// the current font. @@ -200,7 +200,7 @@ impl Show for Packed<OverlineElem> { /// ``` #[elem(title = "Strikethrough", Show)] pub struct StrikeElem { - /// How to [stroke]($stroke) the line. + /// How to [stroke] the line. /// /// If set to `{auto}`, takes on the text's color and a thickness defined in /// the current font. diff --git a/crates/typst/src/text/mod.rs b/crates/typst/src/text/mod.rs index 13193fe8..bcfca08d 100644 --- a/crates/typst/src/text/mod.rs +++ b/crates/typst/src/text/mod.rs @@ -155,9 +155,9 @@ pub struct TextElem { /// available either in an italic or oblique style, the difference between /// italic and oblique style is rarely observable. /// - /// If you want to emphasize your text, you should do so using the - /// [emph]($emph) function instead. This makes it easy to adapt the style - /// later if you change your mind about how to signify the emphasis. + /// If you want to emphasize your text, you should do so using the [emph] + /// function instead. This makes it easy to adapt the style later if you + /// change your mind about how to signify the emphasis. /// /// ```example /// #text(font: "Linux Libertine", style: "italic")[Italic] @@ -172,9 +172,8 @@ pub struct TextElem { /// that is closest in weight. /// /// If you want to strongly emphasize your text, you should do so using the - /// [strong]($strong) function instead. This makes it easy to adapt the - /// style later if you change your mind about how to signify the strong - /// emphasis. + /// [strong] function instead. This makes it easy to adapt the style later + /// if you change your mind about how to signify the strong emphasis. /// /// ```example /// #set text(font: "IBM Plex Sans") diff --git a/crates/typst/src/text/raw.rs b/crates/typst/src/text/raw.rs index d47cd947..b1e00672 100644 --- a/crates/typst/src/text/raw.rs +++ b/crates/typst/src/text/raw.rs @@ -211,10 +211,9 @@ pub struct RawElem { /// Applying a theme only affects the color of specifically highlighted /// text. It does not consider the theme's foreground and background /// properties, so that you retain control over the color of raw text. You - /// can apply the foreground color yourself with the [`text`]($text) - /// function and the background with a [filled block]($block.fill). You - /// could also use the [`xml`]($xml) function to extract these properties - /// from the theme. + /// can apply the foreground color yourself with the [`text`] function and + /// the background with a [filled block]($block.fill). You could also use + /// the [`xml`] function to extract these properties from the theme. /// /// ````example /// #set raw(theme: "halcyon.tmTheme") @@ -542,7 +541,7 @@ cast! { /// A highlighted line of raw text. /// -/// This is a helper element that is synthesized by [`raw`]($raw) elements. +/// This is a helper element that is synthesized by [`raw`] elements. /// /// It allows you to access various properties of the line, such as the line /// number, the raw non-highlighted text, the highlighted text, and whether it diff --git a/crates/typst/src/text/smartquote.rs b/crates/typst/src/text/smartquote.rs index 0c435f11..dbcca6dc 100644 --- a/crates/typst/src/text/smartquote.rs +++ b/crates/typst/src/text/smartquote.rs @@ -67,10 +67,9 @@ pub struct SmartQuoteElem { /// - [string]($str): a string consisting of two characters containing the /// opening and closing double quotes (characters here refer to Unicode /// grapheme clusters) - /// - [array]($array): an array containing the opening and closing double - /// quotes - /// - [dictionary]($dictionary): an array containing the double and single - /// quotes, each specified as either `{auto}`, string, or array + /// - [array]: an array containing the opening and closing double quotes + /// - [dictionary]: an array containing the double and single quotes, each + /// specified as either `{auto}`, string, or array /// /// ```example /// #set text(lang: "de") diff --git a/crates/typst/src/visualize/color.rs b/crates/typst/src/visualize/color.rs index 2821ba7c..c2a9af84 100644 --- a/crates/typst/src/visualize/color.rs +++ b/crates/typst/src/visualize/color.rs @@ -290,12 +290,12 @@ impl Color { /// /// A linear Oklab color is represented internally by an array of four /// components: - /// - lightness ([`ratio`]($ratio)) - /// - a ([`float`]($float) or [`ratio`]($ratio). + /// - lightness ([`ratio`]) + /// - a ([`float`] or [`ratio`]. /// Ratios are relative to `{0.4}`; meaning `{50%}` is equal to `{0.2}`) - /// - b ([`float`]($float) or [`ratio`]($ratio). + /// - b ([`float`] or [`ratio`]. /// Ratios are relative to `{0.4}`; meaning `{50%}` is equal to `{0.2}`) - /// - alpha ([`ratio`]($ratio)) + /// - alpha ([`ratio`]) /// /// These components are also available using the /// [`components`]($color.components) method. @@ -349,11 +349,11 @@ impl Color { /// /// A linear Oklch color is represented internally by an array of four /// components: - /// - lightness ([`ratio`]($ratio)) - /// - chroma ([`float`]($float) or [`ratio`]($ratio). + /// - lightness ([`ratio`]) + /// - chroma ([`float`] or [`ratio`]. /// Ratios are relative to `{0.4}`; meaning `{50%}` is equal to `{0.2}`) - /// - hue ([`angle`]($angle)) - /// - alpha ([`ratio`]($ratio)) + /// - hue ([`angle`]) + /// - alpha ([`ratio`]) /// /// These components are also available using the /// [`components`]($color.components) method. @@ -412,10 +412,10 @@ impl Color { /// /// A linear RGB(A) color is represented internally by an array of four /// components: - /// - red ([`ratio`]($ratio)) - /// - green ([`ratio`]($ratio)) - /// - blue ([`ratio`]($ratio)) - /// - alpha ([`ratio`]($ratio)) + /// - red ([`ratio`]) + /// - green ([`ratio`]) + /// - blue ([`ratio`]) + /// - alpha ([`ratio`]) /// /// These components are also available using the /// [`components`]($color.components) method. @@ -469,10 +469,10 @@ impl Color { /// The color is specified in the sRGB color space. /// /// An RGB(A) color is represented internally by an array of four components: - /// - red ([`ratio`]($ratio)) - /// - green ([`ratio`]($ratio)) - /// - blue ([`ratio`]($ratio)) - /// - alpha ([`ratio`]($ratio)) + /// - red ([`ratio`]) + /// - green ([`ratio`]) + /// - blue ([`ratio`]) + /// - alpha ([`ratio`]) /// /// These components are also available using the [`components`]($color.components) /// method. @@ -544,10 +544,10 @@ impl Color { /// the color. /// /// A CMYK color is represented internally by an array of four components: - /// - cyan ([`ratio`]($ratio)) - /// - magenta ([`ratio`]($ratio)) - /// - yellow ([`ratio`]($ratio)) - /// - key ([`ratio`]($ratio)) + /// - cyan ([`ratio`]) + /// - magenta ([`ratio`]) + /// - yellow ([`ratio`]) + /// - key ([`ratio`]) /// /// These components are also available using the /// [`components`]($color.components) method. @@ -603,10 +603,10 @@ impl Color { /// while keeping perceived hue. /// /// An HSL color is represented internally by an array of four components: - /// - hue ([`angle`]($angle)) - /// - saturation ([`ratio`]($ratio)) - /// - lightness ([`ratio`]($ratio)) - /// - alpha ([`ratio`]($ratio)) + /// - hue ([`angle`]) + /// - saturation ([`ratio`]) + /// - lightness ([`ratio`]) + /// - alpha ([`ratio`]) /// /// These components are also available using the /// [`components`]($color.components) method. @@ -662,10 +662,10 @@ impl Color { /// while keeping perceived hue. /// /// An HSV color is represented internally by an array of four components: - /// - hue ([`angle`]($angle)) - /// - saturation ([`ratio`]($ratio)) - /// - value ([`ratio`]($ratio)) - /// - alpha ([`ratio`]($ratio)) + /// - hue ([`angle`]) + /// - saturation ([`ratio`]) + /// - value ([`ratio`]) + /// - alpha ([`ratio`]) /// /// These components are also available using the /// [`components`]($color.components) method. diff --git a/crates/typst/src/visualize/gradient.rs b/crates/typst/src/visualize/gradient.rs index da747026..c5e953da 100644 --- a/crates/typst/src/visualize/gradient.rs +++ b/crates/typst/src/visualize/gradient.rs @@ -82,11 +82,10 @@ use crate::visualize::{Color, ColorSpace, WeightedColor}; /// Typst determines the ancestor container as follows: /// - For shapes that are placed at the root/top level of the document, the /// closest ancestor is the page itself. -/// - For other shapes, the ancestor is the innermost [`block`]($block) or -/// [`box`]($box) that contains the shape. This includes the boxes and blocks -/// that are implicitly created by show rules and elements. For example, a -/// [`rotate`]($rotate) will not affect the parent of a gradient, but a -/// [`grid`]($grid) will. +/// - For other shapes, the ancestor is the innermost [`block`] or [`box`] that +/// contains the shape. This includes the boxes and blocks that are implicitly +/// created by show rules and elements. For example, a [`rotate`] will not +/// affect the parent of a gradient, but a [`grid`] will. /// /// # Color spaces and interpolation /// Gradients can be interpolated in any color space. By default, gradients are @@ -708,9 +707,9 @@ impl Gradient { /// Sample the gradient at a given position. /// - /// The position is either a position along the gradient (a [ratio]($ratio) - /// between `{0%}` and `{100%}`) or an [angle]($angle). Any value outside - /// of this range will be clamped. + /// The position is either a position along the gradient (a [ratio] between + /// `{0%}` and `{100%}`) or an [angle]. Any value outside of this range will + /// be clamped. #[func] pub fn sample( &self, diff --git a/crates/typst/src/visualize/line.rs b/crates/typst/src/visualize/line.rs index 571bf7ec..78b951d2 100644 --- a/crates/typst/src/visualize/line.rs +++ b/crates/typst/src/visualize/line.rs @@ -41,7 +41,7 @@ pub struct LineElem { /// respected if `end` is `none`. pub angle: Angle, - /// How to [stroke]($stroke) the line. + /// How to [stroke] the line. /// /// ```example /// #set line(length: 100%) diff --git a/crates/typst/src/visualize/mod.rs b/crates/typst/src/visualize/mod.rs index 744e4e85..086c150c 100644 --- a/crates/typst/src/visualize/mod.rs +++ b/crates/typst/src/visualize/mod.rs @@ -28,7 +28,7 @@ use crate::foundations::{category, Category, Scope}; /// /// If you want to create more advanced drawings or plots, also have a look at /// the [CetZ](https://github.com/johannes-wolf/cetz) package as well as more -/// specialized [packages]($packages) for your use case. +/// specialized [packages] for your use case. #[category] pub static VISUALIZE: Category; diff --git a/crates/typst/src/visualize/path.rs b/crates/typst/src/visualize/path.rs index a5bce014..5ee9922f 100644 --- a/crates/typst/src/visualize/path.rs +++ b/crates/typst/src/visualize/path.rs @@ -37,7 +37,7 @@ pub struct PathElem { /// rule](https://en.wikipedia.org/wiki/Nonzero-rule). pub fill: Option<Paint>, - /// How to [stroke]($stroke) the path. This can be: + /// How to [stroke] the path. This can be: /// /// Can be set to `{none}` to disable the stroke or to `{auto}` for a /// stroke of `{1pt}` black if and if only if no fill is given. @@ -56,8 +56,7 @@ pub struct PathElem { /// /// Each vertex can be defined in 3 ways: /// - /// - A regular point, as given to the [`line`]($line) or - /// [`polygon`]($polygon) function. + /// - A regular point, as given to the [`line`] or [`polygon`] function. /// - An array of two points, the first being the vertex and the second /// being the control point. The control point is expressed relative to /// the vertex and is mirrored to get the second control point. The given diff --git a/crates/typst/src/visualize/pattern.rs b/crates/typst/src/visualize/pattern.rs index fe4c58d5..d180a81b 100644 --- a/crates/typst/src/visualize/pattern.rs +++ b/crates/typst/src/visualize/pattern.rs @@ -90,11 +90,10 @@ use crate::World; /// Typst determines the ancestor container as follows: /// - For shapes that are placed at the root/top level of the document, the /// closest ancestor is the page itself. -/// - For other shapes, the ancestor is the innermost [`block`]($block) or -/// [`box`]($box) that contains the shape. This includes the boxes and blocks -/// that are implicitly created by show rules and elements. For example, a -/// [`rotate`]($rotate) will not affect the parent of a gradient, but a -/// [`grid`]($grid) will. +/// - For other shapes, the ancestor is the innermost [`block`] or [`box`] that +/// contains the shape. This includes the boxes and blocks that are implicitly +/// created by show rules and elements. For example, a [`rotate`] will not +/// affect the parent of a gradient, but a [`grid`] will. #[ty(scope, cast)] #[derive(Debug, Clone, Eq, PartialEq, Hash)] pub struct Pattern(Arc<Repr>); diff --git a/crates/typst/src/visualize/polygon.rs b/crates/typst/src/visualize/polygon.rs index 14aec0e1..e0e18ddf 100644 --- a/crates/typst/src/visualize/polygon.rs +++ b/crates/typst/src/visualize/polygon.rs @@ -38,7 +38,7 @@ pub struct PolygonElem { /// [non-zero winding rule](https://en.wikipedia.org/wiki/Nonzero-rule). pub fill: Option<Paint>, - /// How to [stroke]($stroke) the polygon. This can be: + /// How to [stroke] the polygon. This can be: /// /// Can be set to `{none}` to disable the stroke or to `{auto}` for a /// stroke of `{1pt}` black if and if only if no fill is given. diff --git a/crates/typst/src/visualize/shape.rs b/crates/typst/src/visualize/shape.rs index de1eac16..4567739e 100644 --- a/crates/typst/src/visualize/shape.rs +++ b/crates/typst/src/visualize/shape.rs @@ -47,7 +47,7 @@ pub struct RectElem { /// - `{none}` to disable stroking /// - `{auto}` for a stroke of `{1pt + black}` if and if only if no fill is /// given. - /// - Any kind of [stroke]($stroke) + /// - Any kind of [stroke] /// - A dictionary describing the stroke for each side inidvidually. The /// dictionary can contain the following keys in order of precedence: /// - `top`: The top stroke. diff --git a/crates/typst/src/visualize/stroke.rs b/crates/typst/src/visualize/stroke.rs index 97d13428..27157128 100644 --- a/crates/typst/src/visualize/stroke.rs +++ b/crates/typst/src/visualize/stroke.rs @@ -39,10 +39,9 @@ use crate::visualize::{Color, Gradient, Paint, Pattern}; /// - A stroke combined from color and thickness using the `+` operator as in /// `{2pt + red}`. /// -/// For full control, you can also provide a [dictionary]($dictionary) or a -/// `{stroke}` object to any function that expects a stroke. The dictionary's -/// keys may include any of the parameters for the constructor function, shown -/// below. +/// For full control, you can also provide a [dictionary] or a `{stroke}` object +/// to any function that expects a stroke. The dictionary's keys may include any +/// of the parameters for the constructor function, shown below. /// /// # Fields /// On a stroke object, you can access any of the fields listed in the @@ -139,11 +138,12 @@ impl Stroke { /// - `{"dash-dotted"}` /// - `{"densely-dash-dotted"}` /// - `{"loosely-dash-dotted"}` - /// - An [array]($array) with alternating lengths for dashes and gaps. You can - /// also use the string `{"dot"}` for a length equal to the line thickness. - /// - A [dictionary]($dictionary) with the keys `array` (same as the array - /// above), and `phase` (of type [length]($length)), which defines where in - /// the pattern to start drawing. + /// - An [array] with alternating lengths for dashes and gaps. You can + /// also use the string `{"dot"}` for a length equal to the line + /// thickness. + /// - A [dictionary] with the keys `array` (same as the array above), + /// and `phase` (of type [length]), which defines where in the pattern + /// to start drawing. /// /// If set to `{auto}`, the value is inherited, defaulting to `{none}`. /// |
