mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
A few CI and crate config changes (#3852)
This commit is contained in:
parent
c4001662b6
commit
b3615ccd49
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -31,6 +31,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@1.77.0
|
- uses: dtolnay/rust-toolchain@1.77.0
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- run: cargo test --workspace --no-run
|
||||||
- run: cargo test --workspace --no-fail-fast
|
- run: cargo test --workspace --no-fail-fast
|
||||||
|
|
||||||
checks:
|
checks:
|
||||||
|
@ -15,9 +15,6 @@ readme = { workspace = true }
|
|||||||
[[bin]]
|
[[bin]]
|
||||||
name = "typst"
|
name = "typst"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
test = false
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
doc = false
|
doc = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -12,11 +12,6 @@ categories = { workspace = true }
|
|||||||
keywords = { workspace = true }
|
keywords = { workspace = true }
|
||||||
readme = { workspace = true }
|
readme = { workspace = true }
|
||||||
|
|
||||||
[lib]
|
|
||||||
test = false
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
typst = { workspace = true }
|
typst = { workspace = true }
|
||||||
comemo = { workspace = true }
|
comemo = { workspace = true }
|
||||||
|
@ -14,9 +14,6 @@ readme = { workspace = true }
|
|||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
test = false
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
heck = { workspace = true }
|
heck = { workspace = true }
|
||||||
|
@ -33,6 +33,7 @@ pub fn category(_: TokenStream, item: syn::Item) -> Result<TokenStream> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a bare `pub static CATEGORY: Category;` item.
|
/// Parse a bare `pub static CATEGORY: Category;` item.
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct BareStatic {
|
pub struct BareStatic {
|
||||||
pub attrs: Vec<Attribute>,
|
pub attrs: Vec<Attribute>,
|
||||||
pub vis: Visibility,
|
pub vis: Visibility,
|
||||||
|
@ -136,7 +136,7 @@ pub fn ty(stream: BoundaryStream, item: BoundaryStream) -> BoundaryStream {
|
|||||||
///
|
///
|
||||||
/// This implements `NativeElement` for the given type.
|
/// This implements `NativeElement` for the given type.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```ignore
|
||||||
/// /// A section heading.
|
/// /// A section heading.
|
||||||
/// #[elem(Show, Count)]
|
/// #[elem(Show, Count)]
|
||||||
/// struct HeadingElem {
|
/// struct HeadingElem {
|
||||||
|
@ -232,6 +232,7 @@ impl Parse for BlockWithReturn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a bare `type Name;` item.
|
/// Parse a bare `type Name;` item.
|
||||||
|
#[allow(dead_code)]
|
||||||
pub struct BareType {
|
pub struct BareType {
|
||||||
pub attrs: Vec<Attribute>,
|
pub attrs: Vec<Attribute>,
|
||||||
pub type_token: Token![type],
|
pub type_token: Token![type],
|
||||||
|
@ -12,10 +12,6 @@ categories = { workspace = true }
|
|||||||
keywords = { workspace = true }
|
keywords = { workspace = true }
|
||||||
readme = { workspace = true }
|
readme = { workspace = true }
|
||||||
|
|
||||||
[lib]
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
typst = { workspace = true }
|
typst = { workspace = true }
|
||||||
typst-assets = { workspace = true }
|
typst-assets = { workspace = true }
|
||||||
|
@ -9,7 +9,6 @@ mod outline;
|
|||||||
mod page;
|
mod page;
|
||||||
mod pattern;
|
mod pattern;
|
||||||
|
|
||||||
use std::cmp::Eq;
|
|
||||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
@ -12,10 +12,6 @@ categories = { workspace = true }
|
|||||||
keywords = { workspace = true }
|
keywords = { workspace = true }
|
||||||
readme = { workspace = true }
|
readme = { workspace = true }
|
||||||
|
|
||||||
[lib]
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
typst = { workspace = true }
|
typst = { workspace = true }
|
||||||
typst-macros = { workspace = true }
|
typst-macros = { workspace = true }
|
||||||
|
@ -12,10 +12,6 @@ categories = { workspace = true }
|
|||||||
keywords = { workspace = true }
|
keywords = { workspace = true }
|
||||||
readme = { workspace = true }
|
readme = { workspace = true }
|
||||||
|
|
||||||
[lib]
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
typst = { workspace = true }
|
typst = { workspace = true }
|
||||||
typst-macros = { workspace = true }
|
typst-macros = { workspace = true }
|
||||||
|
@ -12,10 +12,6 @@ categories = { workspace = true }
|
|||||||
keywords = { workspace = true }
|
keywords = { workspace = true }
|
||||||
readme = { workspace = true }
|
readme = { workspace = true }
|
||||||
|
|
||||||
[lib]
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
comemo = { workspace = true }
|
comemo = { workspace = true }
|
||||||
ecow = { workspace = true }
|
ecow = { workspace = true }
|
||||||
|
@ -12,10 +12,6 @@ repository = { workspace = true }
|
|||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
readme = { workspace = true }
|
readme = { workspace = true }
|
||||||
|
|
||||||
[lib]
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
typst-assets = { workspace = true }
|
typst-assets = { workspace = true }
|
||||||
typst-macros = { workspace = true }
|
typst-macros = { workspace = true }
|
||||||
|
@ -21,7 +21,7 @@ use crate::{World, WorldExt};
|
|||||||
///
|
///
|
||||||
/// You can also emit hints with the `; hint: "..."` syntax.
|
/// You can also emit hints with the `; hint: "..."` syntax.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```ignore
|
||||||
/// bail!("bailing with a {}", "string result");
|
/// bail!("bailing with a {}", "string result");
|
||||||
/// bail!(span, "bailing with a {}", "source result");
|
/// bail!(span, "bailing with a {}", "source result");
|
||||||
/// bail!(
|
/// bail!(
|
||||||
@ -81,7 +81,7 @@ macro_rules! __error {
|
|||||||
///
|
///
|
||||||
/// You can also emit hints with the `; hint: "..."` syntax.
|
/// You can also emit hints with the `; hint: "..."` syntax.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```ignore
|
||||||
/// warning!(span, "warning with a {}", "source result");
|
/// warning!(span, "warning with a {}", "source result");
|
||||||
/// warning!(
|
/// warning!(
|
||||||
/// span, "warning with a {}", "source result";
|
/// span, "warning with a {}", "source result";
|
||||||
|
@ -44,9 +44,9 @@ pub trait Reflect {
|
|||||||
|
|
||||||
/// Produce an error message for an inacceptable value type.
|
/// Produce an error message for an inacceptable value type.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```ignore
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// <Int as Reflect>::error(&Value::None),
|
/// <i64 as Reflect>::error(&Value::None),
|
||||||
/// "expected integer, found none",
|
/// "expected integer, found none",
|
||||||
/// );
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -15,10 +15,6 @@ use crate::symbols::Symbol;
|
|||||||
use crate::text::TextElem;
|
use crate::text::TextElem;
|
||||||
|
|
||||||
/// A helper macro to create a field selector used in [`Selector::Elem`]
|
/// A helper macro to create a field selector used in [`Selector::Elem`]
|
||||||
///
|
|
||||||
/// ```ignore
|
|
||||||
/// select_where!(SequenceElem, Children => vec![]);
|
|
||||||
/// ```
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
macro_rules! __select_where {
|
macro_rules! __select_where {
|
||||||
|
@ -321,9 +321,6 @@ trait Blockable: Debug + Send + Sync + 'static {
|
|||||||
/// Equivalent to `downcast_ref` for the block.
|
/// Equivalent to `downcast_ref` for the block.
|
||||||
fn as_any(&self) -> &dyn Any;
|
fn as_any(&self) -> &dyn Any;
|
||||||
|
|
||||||
/// Equivalent to `downcast_mut` for the block.
|
|
||||||
fn as_any_mut(&mut self) -> &mut dyn Any;
|
|
||||||
|
|
||||||
/// Equivalent to [`Hash`] for the block.
|
/// Equivalent to [`Hash`] for the block.
|
||||||
fn dyn_hash(&self, state: &mut dyn Hasher);
|
fn dyn_hash(&self, state: &mut dyn Hasher);
|
||||||
|
|
||||||
@ -336,10 +333,6 @@ impl<T: Debug + Clone + Hash + Send + Sync + 'static> Blockable for T {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn dyn_hash(&self, mut state: &mut dyn Hasher) {
|
fn dyn_hash(&self, mut state: &mut dyn Hasher) {
|
||||||
// Also hash the TypeId since values with different types but
|
// Also hash the TypeId since values with different types but
|
||||||
// equal data should be different.
|
// equal data should be different.
|
||||||
|
@ -597,7 +597,7 @@ pub(super) fn hline_stroke_at_column(
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::super::layout::{Entry, RowPiece};
|
use super::super::layout::Entry;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::foundations::Content;
|
use crate::foundations::Content;
|
||||||
use crate::layout::{Axes, Cell, Sides, Sizing};
|
use crate::layout::{Axes, Cell, Sides, Sizing};
|
||||||
|
@ -73,7 +73,6 @@ pub struct OutlineElem {
|
|||||||
/// The outline's heading will not be numbered by default, but you can
|
/// The outline's heading will not be numbered by default, but you can
|
||||||
/// force it to be with a show-set rule:
|
/// force it to be with a show-set rule:
|
||||||
/// `{show outline: set heading(numbering: "1.")}`
|
/// `{show outline: set heading(numbering: "1.")}`
|
||||||
/// ```
|
|
||||||
#[default(Some(Smart::Auto))]
|
#[default(Some(Smart::Auto))]
|
||||||
pub title: Option<Smart<Content>>,
|
pub title: Option<Smart<Content>>,
|
||||||
|
|
||||||
|
@ -6,13 +6,10 @@ authors = { workspace = true }
|
|||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[lib]
|
|
||||||
doctest = false
|
|
||||||
bench = false
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "typst-docs"
|
name = "typst-docs"
|
||||||
required-features = ["cli"]
|
required-features = ["cli"]
|
||||||
|
doc = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["cli"]
|
default = ["cli"]
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
// Ref: false
|
|
||||||
|
|
||||||
// Configuration with `page` and `font` functions.
|
|
||||||
#set page(width: 450pt, margin: 1cm)
|
|
||||||
|
|
||||||
// There are variables and they can take normal values like strings, ...
|
|
||||||
#let city = "Berlin"
|
|
||||||
|
|
||||||
// ... but also "content" values. While these contain markup,
|
|
||||||
// they are also values and can be summed, stored in arrays etc.
|
|
||||||
// There are also more standard control flow structures, like #if and #for.
|
|
||||||
#let university = [*Technische Universität #city*]
|
|
||||||
#let faculty = [*Fakultät II, Institut for Mathematik*]
|
|
||||||
|
|
||||||
// The `box` function just places content into a rectangular container. When
|
|
||||||
// the only argument to a function is a content block, the parentheses can be
|
|
||||||
// omitted (i.e. `f[a]` is the same as `f([a])`).
|
|
||||||
#box[
|
|
||||||
// Backslash adds a forced line break.
|
|
||||||
#university \
|
|
||||||
#faculty \
|
|
||||||
Sekretariat MA \
|
|
||||||
Dr. Max Mustermann \
|
|
||||||
Ola Nordmann, John Doe
|
|
||||||
]
|
|
||||||
#align(right, box[*WiSe 2019/2020* \ Woche 3])
|
|
||||||
|
|
||||||
// Adds vertical spacing.
|
|
||||||
#v(6mm)
|
|
||||||
|
|
||||||
// If the last argument to a function is a content block, we can also place it
|
|
||||||
// behind the parentheses.
|
|
||||||
#align(center)[
|
|
||||||
// Markdown-like syntax for headings.
|
|
||||||
==== 3. Übungsblatt Computerorientierte Mathematik II #v(4mm)
|
|
||||||
*Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #v(4mm)
|
|
||||||
*Alle Antworten sind zu beweisen.*
|
|
||||||
]
|
|
||||||
|
|
||||||
*1. Aufgabe* #align(right)[(1 + 1 + 2 Punkte)]
|
|
||||||
|
|
||||||
Ein _Binärbaum_ ist ein Wurzelbaum, in dem jeder Knoten ≤ 2 Kinder hat.
|
|
||||||
Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel
|
|
||||||
zu _v_, und die Höhe von _v_ ist die Länge eines längsten (absteigenden) Weges
|
|
||||||
von _v_ zu einem Blatt. Die Höhe des Baumes ist die Höhe der Wurzel.
|
|
||||||
|
|
||||||
#v(6mm)
|
|
Loading…
x
Reference in New Issue
Block a user