diff --git a/crates/typst-macros/src/category.rs b/crates/typst-macros/src/category.rs index 399a0510f..ac8c813df 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 { 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 f14d33507..7734dd547 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 728ab05b6..b7a7ac63c 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 943bd4530..a6ae3f1c9 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 605af0650..4b8800e8d 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 54789be08..83e94d302 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 { self.inner.location diff --git a/crates/typst/src/foundations/datetime.rs b/crates/typst/src/foundations/datetime.rs index 053aa4226..9e4f00849 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 83e3d962a..94d44fb2a 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 28c1967aa..92bfa8231 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 [`{