Fix dead links

This commit is contained in:
Laurenz 2023-09-30 11:49:02 +02:00
parent 0ed84797e8
commit c97fc5eb55
5 changed files with 17 additions and 11 deletions

View file

@ -44,6 +44,7 @@ fn global(math: Module) -> Module {
/// Defines scoped values that are globally available, too.
fn prelude(global: &mut Scope) {
global.reset_category();
global.define("black", Color::BLACK);
global.define("gray", Color::GRAY);
global.define("silver", Color::SILVER);

View file

@ -109,6 +109,11 @@ impl Scope {
self.category = Some(name);
}
/// Reset the category.
pub fn reset_category(&mut self) {
self.category = None;
}
/// Bind a value to a name.
#[track_caller]
pub fn define(&mut self, name: impl Into<EcoString>, value: impl IntoValue) {

View file

@ -20,10 +20,10 @@ type Luma = palette::luma::Luma<encoding::Srgb, f32>;
/// A color in a specific color space.
///
/// Typst supports:
/// - sRGB through the [`rgb` function]($rgb)
/// - Device CMYK through [`cmyk` function]($cmyk)
/// - D65 Gray through the [`luma` function]($luma)
/// - Oklab through the [`oklab` function]($oklab)
/// - sRGB through the [`rgb` function]($color.rgb)
/// - Device CMYK through [`cmyk` function]($color.cmyk)
/// - D65 Gray through the [`luma` function]($color.luma)
/// - Oklab through the [`oklab` function]($color.oklab)
/// - Linear RGB through the [`color.linear-rgb` function]($color.linear-rgb)
/// - HSL through the [`color.hsl` function]($color.hsl)
/// - HSV through the [`color.hsv` function]($color.hsv)
@ -181,7 +181,7 @@ impl Color {
/// This color space is similar to Srgb<f32>, but with the distinction that
/// the color component are not gamma corrected. This makes it easier to
/// perform color operations such as blending and interpolation. Although,
/// you should prefer to use the [`oklab` function]($oklab) for these.
/// you should prefer to use the [`oklab` function]($color.oklab) for these.
///
/// A linear RGB(A) color is represented internally by an array of four components:
/// - red ([`ratio`]($ratio))

View file

@ -515,7 +515,7 @@ description: |
- Added [`zip`]($array.zip), [`sum`]($array.sum), and
[`product`]($array.product) methods for arrays
- Added `fact`, `perm`, `binom`, `gcd`, `lcm`, `atan2`, `quo`, `trunc`, and
`fract` [calculation]($category/calculate)
`fract` [calculation]($category/foundations/calc) functions
- Improvements
- Text in SVGs now displays properly

View file

@ -143,11 +143,11 @@ And finally a little loop:
```
A function call always involves the name of the function ([`rect`]($rect),
[`underline`]($underline), [`calc.max`]($calc.max), [`range`]($range)) followed
by parentheses (as opposed to LaTeX where the square brackets and curly braces
are optional if the macro requires no arguments). The expected list of arguments
passed within those parentheses depends on the concrete function and is
specified in the [reference]($reference).
[`underline`]($underline), [`calc.max`]($calc.max), [`range`]($array.range))
followed by parentheses (as opposed to LaTeX where the square brackets and curly
braces are optional if the macro requires no arguments). The expected list of
arguments passed within those parentheses depends on the concrete function and
is specified in the [reference]($reference).
### Arguments
A function can have multiple arguments. Some arguments are positional, i.e., you