diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d05cbbb2..4911f9521 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Continous integration +name: Continuous integration on: [push, pull_request] jobs: diff --git a/docs/src/general/changelog.md b/docs/src/general/changelog.md index ca182c84c..5879c8407 100644 --- a/docs/src/general/changelog.md +++ b/docs/src/general/changelog.md @@ -11,7 +11,7 @@ description: | supported styles are APA, Chicago Author Date, IEEE, and MLA) - You can now [reference]($func/ref) sections, figures, formulas, and works from the bibliography with `[@label]` - - You can make an element referencable with a label: + - You can make an element referenceable with a label: - `[= Introduction ]` - `[$ A = pi r^2 $ ]` @@ -29,7 +29,7 @@ description: | document - State is modified in layout order and not in code order - [`query`]($func/query) function - - Find all occurances of an element or a label, either in the whole document + - Find all occurrences of an element or a label, either in the whole document or before/after some location - Link to elements, find out their position on the pages and access their fields diff --git a/docs/src/tutorial/1-writing.md b/docs/src/tutorial/1-writing.md index 78c1bc14d..9e0dc8c97 100644 --- a/docs/src/tutorial/1-writing.md +++ b/docs/src/tutorial/1-writing.md @@ -141,7 +141,7 @@ that, first attach a label to figure. A label uniquely identifies an element in your document. Add one after the figure by enclosing some name in angle brackets. You can then reference the figure in your text by writing an `[@]` symbol followed by that name. Headings and equations can also be labelled to -make them referencable. +make them referenceable. ```example Glaciers as the one shown in diff --git a/library/src/layout/flow.rs b/library/src/layout/flow.rs index b64768169..da2ddba69 100644 --- a/library/src/layout/flow.rs +++ b/library/src/layout/flow.rs @@ -75,7 +75,7 @@ struct FlowLayouter<'a> { regions: Regions<'a>, /// Whether the flow should expand to fill the region. expand: Axes, - /// The intial size of `regions.size` that was available before we started + /// The initial size of `regions.size` that was available before we started /// subtracting. initial: Size, /// Whether the last block was a paragraph. diff --git a/library/src/layout/grid.rs b/library/src/layout/grid.rs index 5c3d132ef..e0c8b6841 100644 --- a/library/src/layout/grid.rs +++ b/library/src/layout/grid.rs @@ -659,7 +659,7 @@ impl<'a, 'v> GridLayouter<'a, 'v> { assert!(x < self.cols.len()); assert!(y < self.rows.len()); - // Columns are reorded, but the cell slice is not. + // Columns are reorder, but the cell slice is not. if self.is_rtl { x = self.cols.len() - 1 - x; } diff --git a/library/src/layout/par.rs b/library/src/layout/par.rs index db65b1259..dc445c86b 100644 --- a/library/src/layout/par.rs +++ b/library/src/layout/par.rs @@ -395,7 +395,7 @@ impl SpanMapper { /// A layouted line, consisting of a sequence of layouted paragraph items that /// are mostly borrowed from the preparation phase. This type enables you to -/// measure the size of a line in a range before comitting to building the +/// measure the size of a line in a range before committing to building the /// line's frame. /// /// At most two paragraph items must be created individually for this line: The @@ -889,7 +889,7 @@ fn linebreak_optimized<'a>(vt: &Vt, p: &'a Preparation<'a>, width: Abs) -> Vec StackLayouter<'a> { /// Advance to the next region. fn finish_region(&mut self) { - // Determine the size of the stack in this region dependening on whether + // Determine the size of the stack in this region depending on whether // the region expands. let mut size = self .expand diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs index c103dd025..14246436e 100644 --- a/library/src/meta/reference.rs +++ b/library/src/meta/reference.rs @@ -146,7 +146,7 @@ impl Show for RefElem { } impl RefElem { - /// Turn the rference into a citation. + /// Turn the reference into a citation. pub fn to_citation(&self, styles: StyleChain) -> CiteElem { let mut elem = CiteElem::new(vec![self.target().0]); elem.0.set_location(self.0.location().unwrap()); diff --git a/library/src/text/quotes.rs b/library/src/text/quotes.rs index be923304d..97b07746f 100644 --- a/library/src/text/quotes.rs +++ b/library/src/text/quotes.rs @@ -109,7 +109,7 @@ fn is_opening_bracket(c: char) -> bool { matches!(c, '(' | '{' | '[') } -/// Decides which quotes to subtitute smart quotes with. +/// Decides which quotes to substitute smart quotes with. pub struct Quotes<'s> { /// The opening single quote. pub single_open: &'s str, diff --git a/src/diag.rs b/src/diag.rs index b12df2097..c1a7c8346 100644 --- a/src/diag.rs +++ b/src/diag.rs @@ -112,16 +112,16 @@ impl Display for Tracepoint { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { Tracepoint::Call(Some(name)) => { - write!(f, "error occured in this call of function `{}`", name) + write!(f, "error occurred in this call of function `{}`", name) } Tracepoint::Call(None) => { - write!(f, "error occured in this function call") + write!(f, "error occurred in this function call") } Tracepoint::Show(name) => { - write!(f, "error occured while applying show rule to this {name}") + write!(f, "error occurred while applying show rule to this {name}") } Tracepoint::Import => { - write!(f, "error occured while importing this module") + write!(f, "error occurred while importing this module") } } } @@ -180,7 +180,7 @@ where /// A result type with a file-related error. pub type FileResult = Result; -/// An error that occured while trying to load of a file. +/// An error that occurred while trying to load of a file. #[derive(Debug, Clone, Eq, PartialEq, Hash)] pub enum FileError { /// A file was not found at this path. diff --git a/src/eval/array.rs b/src/eval/array.rs index bebbe8094..3006c91f4 100644 --- a/src/eval/array.rs +++ b/src/eval/array.rs @@ -114,7 +114,7 @@ impl Array { Ok(self.0.remove(i)) } - /// Extract a contigous subregion of the array. + /// Extract a contiguous subregion of the array. pub fn slice(&self, start: i64, end: Option) -> StrResult { let len = self.len(); let start = self diff --git a/src/eval/str.rs b/src/eval/str.rs index 0d5d71b96..b15515644 100644 --- a/src/eval/str.rs +++ b/src/eval/str.rs @@ -72,7 +72,7 @@ impl Str { Ok(grapheme.into()) } - /// Extract a contigous substring. + /// Extract a contiguous substring. pub fn slice(&self, start: i64, end: Option) -> StrResult { let start = self.locate(start)?; let end = self.locate(end.unwrap_or(self.len()))?.max(start); @@ -251,7 +251,7 @@ impl Str { trimmed.into() } - /// Replace at most `count` occurances of the given pattern with a + /// Replace at most `count` occurrences of the given pattern with a /// replacement string (beginning from the start). pub fn replace(&self, pattern: StrPattern, with: Self, count: Option) -> Self { match pattern { diff --git a/src/eval/value.rs b/src/eval/value.rs index ce9c4e0e0..bf1dd18a1 100644 --- a/src/eval/value.rs +++ b/src/eval/value.rs @@ -250,7 +250,7 @@ impl Hash for Value { pub struct Dynamic(Arc); impl Dynamic { - /// Create a new instance from any value that satisifies the required bounds. + /// Create a new instance from any value that satisfies the required bounds. pub fn new(any: T) -> Self where T: Type + Debug + PartialEq + Hash + Sync + Send + 'static, diff --git a/src/export/pdf/image.rs b/src/export/pdf/image.rs index 906737dee..0bdcd481c 100644 --- a/src/export/pdf/image.rs +++ b/src/export/pdf/image.rs @@ -86,7 +86,7 @@ fn encode_image( (data.into_inner(), Filter::DctDecode, true) } - // TODO: Encode flate streams with PNG-predictor? + // TODO: Encode flat streams with PNG-predictor? // 8-bit gray PNG. (RasterFormat::Png, DynamicImage::ImageLuma8(luma)) => { diff --git a/src/geom/ratio.rs b/src/geom/ratio.rs index 7be16ff8f..5490bcba6 100644 --- a/src/geom/ratio.rs +++ b/src/geom/ratio.rs @@ -18,7 +18,7 @@ impl Ratio { Self(Scalar(1.0)) } - /// Create a new ratio from a value, whre `1.0` means `100%`. + /// Create a new ratio from a value, where `1.0` means `100%`. pub const fn new(ratio: f64) -> Self { Self(Scalar(ratio)) } diff --git a/src/ide/complete.rs b/src/ide/complete.rs index 886c12453..4dacc2b2c 100644 --- a/src/ide/complete.rs +++ b/src/ide/complete.rs @@ -195,7 +195,7 @@ fn markup_completions(ctx: &mut CompletionContext) { ctx.snippet_completion( "label", "<${name}>", - "Makes the preceding element referencable.", + "Makes the preceding element referenceable.", ); ctx.snippet_completion( @@ -517,7 +517,7 @@ fn show_rule_selector_completions(ctx: &mut CompletionContext) { ctx.snippet_completion( "text selector", "\"${text}\": ${}", - "Replace occurances of specific text.", + "Replace occurrences of specific text.", ); ctx.snippet_completion( @@ -794,19 +794,19 @@ fn code_completions(ctx: &mut CompletionContext, hashtag: bool) { ctx.snippet_completion( "while loop", "while ${1 < 2} {\n\t${}\n}", - "Computes or inserts somthing while a condition is met.", + "Computes or inserts something while a condition is met.", ); ctx.snippet_completion( "for loop", "for ${value} in ${(1, 2, 3)} {\n\t${}\n}", - "Computes or inserts somthing for each value in a collection.", + "Computes or inserts something for each value in a collection.", ); ctx.snippet_completion( "for loop (with key)", "for ${key}, ${value} in ${(a: 1, b: 2)} {\n\t${}\n}", - "Computes or inserts somthing for each key and value in a collection.", + "Computes or inserts something for each key and value in a collection.", ); ctx.snippet_completion( diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index 73aa41e1e..bd8fa230b 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -652,7 +652,7 @@ impl Heading { self.0.cast_first_match().unwrap_or_default() } - /// The section depth (numer of equals signs). + /// The section depth (number of equals signs). pub fn level(&self) -> NonZeroUsize { self.0 .children() @@ -1085,7 +1085,7 @@ impl Array { pub enum ArrayItem { /// A bare expression: `12`. Pos(Expr), - /// A spreaded expression: `..things`. + /// A spread expression: `..things`. Spread(Expr), } @@ -1117,14 +1117,14 @@ impl Dict { } } -/// An item in an dictionary expresssion. +/// An item in an dictionary expression. #[derive(Debug, Clone, Hash)] pub enum DictItem { /// A named pair: `thickness: 3pt`. Named(Named), /// A keyed pair: `"spacy key": true`. Keyed(Keyed), - /// A spreaded expression: `..things`. + /// A spread expression: `..things`. Spread(Expr), } @@ -1484,7 +1484,7 @@ pub enum Arg { Pos(Expr), /// A named argument: `draw: false`. Named(Named), - /// A spreaded argument: `..things`. + /// A spread argument: `..things`. Spread(Expr), } diff --git a/src/syntax/kind.rs b/src/syntax/kind.rs index c96539d14..b0d934d1a 100644 --- a/src/syntax/kind.rs +++ b/src/syntax/kind.rs @@ -212,7 +212,7 @@ pub enum SyntaxKind { FuncCall, /// A function call's argument list: `(12pt, y)`. Args, - /// Spreaded arguments or an argument sink: `..x`. + /// Spread arguments or an argument sink: `..x`. Spread, /// A closure: `(x, y) => z`. Closure, diff --git a/src/syntax/source.rs b/src/syntax/source.rs index 53cc6de90..e8553b1e9 100644 --- a/src/syntax/source.rs +++ b/src/syntax/source.rs @@ -425,7 +425,7 @@ mod tests { assert_eq!(source.lines, result.lines); } - // Test inserting at the begining. + // Test inserting at the beginning. test("abc\n", 0..0, "hi\n", "hi\nabc\n"); test("\nabc", 0..0, "hi\r", "hi\r\nabc"); diff --git a/tests/README.md b/tests/README.md index d57b770c2..1da8a9c6a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -52,7 +52,7 @@ testit --pdf ## Creating new tests To keep things small, please optimize reference images before committing them. -When you use the approve buttom from the Test Helper (see the `tools` folder) +When you use the approve button from the Test Helper (see the `tools` folder) this happens automatically if you have `oxipng` installed. ```bash # One image diff --git a/tests/src/tests.rs b/tests/src/tests.rs index 07312c5c4..12f1ecdc1 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -35,7 +35,7 @@ fn main() { let args = Args::new(env::args().skip(1)); let mut filtered = Vec::new(); - // Since differents tests can affect each other through the memoization + // Since different tests can affect each other through the memoization // cache, a deterministic order is important for reproducibility. for entry in WalkDir::new("typ").sort_by_file_name() { let entry = entry.unwrap(); @@ -554,7 +554,7 @@ fn print_error(source: &Source, line: usize, (range, message): &(Range, S /// same result as a clean parse. /// /// The method will first inject 10 strings once every 400 source characters -/// and then select 5 leaf node boundries to inject an additional, randomly +/// and then select 5 leaf node boundaries to inject an additional, randomly /// chosen string from the injection list. fn test_reparse(text: &str, i: usize, rng: &mut LinearShift) -> bool { let supplements = [ diff --git a/tests/typ/compiler/call.typ b/tests/typ/compiler/call.typ index 32a54cd4b..f78dec20b 100644 --- a/tests/typ/compiler/call.typ +++ b/tests/typ/compiler/call.typ @@ -4,7 +4,7 @@ --- // Ref: true -// Ommitted space. +// Omitted space. #let f() = {} #[#f()*Bold*] diff --git a/tests/typ/layout/list-marker.typ b/tests/typ/layout/list-marker.typ index 97d1ce917..6f348530b 100644 --- a/tests/typ/layout/list-marker.typ +++ b/tests/typ/layout/list-marker.typ @@ -1,4 +1,4 @@ -// Test list marker configuraiton. +// Test list marker configuration. --- // Test en-dash. diff --git a/tests/typ/meta/bibliography.typ b/tests/typ/meta/bibliography.typ index 0d9c19a04..f1dbe3c8d 100644 --- a/tests/typ/meta/bibliography.typ +++ b/tests/typ/meta/bibliography.typ @@ -5,7 +5,7 @@ #bibliography("/bad.bib") --- -// Test ambigious reference. +// Test ambiguous reference. = Introduction // Error: 1-7 label occurs in the document and its bibliography @arrgh diff --git a/tools/support/typst.tmLanguage.json b/tools/support/typst.tmLanguage.json index d546eccb5..1e7e94e03 100644 --- a/tools/support/typst.tmLanguage.json +++ b/tools/support/typst.tmLanguage.json @@ -96,7 +96,7 @@ "name": "string.other.math.typst", "begin": "\\$", "end": "\\$", - "captures": { "0": { "name": "punctuation.defintion.string.math.typst" } } + "captures": { "0": { "name": "punctuation.definition.string.math.typst" } } }, { "name": "markup.heading.typst", @@ -364,7 +364,7 @@ "name": "string.other.math.typst", "begin": "\\$", "end": "\\$", - "captures": { "0": { "name": "punctuation.defintion.string.math.typst" } } + "captures": { "0": { "name": "punctuation.definition.string.math.typst" } } } ] },