Compare commits

...

3 Commits

Author SHA1 Message Date
Laurenz
95a7e28e25
Make two typst-kit functions private (#6045) 2025-03-12 12:46:03 +00:00
Kevin K.
37bb632d2e
Fix missing words and paren in docs (#6046) 2025-03-12 12:45:57 +00:00
Michael Fortunato
24b2f98bf9
Fix typo in 4-template.md (#6047) 2025-03-12 12:45:22 +00:00
5 changed files with 9 additions and 8 deletions

View File

@ -78,7 +78,8 @@ impl PackageStorage {
self.package_path.as_deref() self.package_path.as_deref()
} }
/// Make a package available in the on-disk. /// Makes a package available on-disk and returns the path at which it is
/// located (will be either in the cache or package directory).
pub fn prepare_package( pub fn prepare_package(
&self, &self,
spec: &PackageSpec, spec: &PackageSpec,
@ -111,7 +112,7 @@ impl PackageStorage {
Err(PackageError::NotFound(spec.clone())) Err(PackageError::NotFound(spec.clone()))
} }
/// Try to determine the latest version of a package. /// Tries to determine the latest version of a package.
pub fn determine_latest_version( pub fn determine_latest_version(
&self, &self,
spec: &VersionlessPackageSpec, spec: &VersionlessPackageSpec,
@ -144,7 +145,7 @@ impl PackageStorage {
} }
/// Download the package index. The result of this is cached for efficiency. /// Download the package index. The result of this is cached for efficiency.
pub fn download_index(&self) -> StrResult<&[serde_json::Value]> { fn download_index(&self) -> StrResult<&[serde_json::Value]> {
self.index self.index
.get_or_try_init(|| { .get_or_try_init(|| {
let url = format!("{DEFAULT_REGISTRY}/{DEFAULT_NAMESPACE}/index.json"); let url = format!("{DEFAULT_REGISTRY}/{DEFAULT_NAMESPACE}/index.json");
@ -165,7 +166,7 @@ impl PackageStorage {
/// ///
/// # Panics /// # Panics
/// Panics if the package spec namespace isn't `DEFAULT_NAMESPACE`. /// Panics if the package spec namespace isn't `DEFAULT_NAMESPACE`.
pub fn download_package( fn download_package(
&self, &self,
spec: &PackageSpec, spec: &PackageSpec,
cache_dir: &Path, cache_dir: &Path,

View File

@ -94,7 +94,7 @@ pub struct BibliographyElem {
/// - A path string to load a bibliography file from the given path. For /// - A path string to load a bibliography file from the given path. For
/// more details about paths, see the [Paths section]($syntax/#paths). /// more details about paths, see the [Paths section]($syntax/#paths).
/// - Raw bytes from which the bibliography should be decoded. /// - Raw bytes from which the bibliography should be decoded.
/// - An array where each item is one the above. /// - An array where each item is one of the above.
#[required] #[required]
#[parse( #[parse(
let sources = args.expect("sources")?; let sources = args.expect("sources")?;

View File

@ -388,7 +388,7 @@ pub struct OutlineEntry {
/// space between the entry's body and the page number. When using show /// space between the entry's body and the page number. When using show
/// rules to override outline entries, it is thus recommended to wrap the /// rules to override outline entries, it is thus recommended to wrap the
/// fill in a [`box`] with fractional width, i.e. /// fill in a [`box`] with fractional width, i.e.
/// `{box(width: 1fr, it.fill}`. /// `{box(width: 1fr, it.fill)}`.
/// ///
/// When using [`repeat`], the [`gap`]($repeat.gap) property can be useful /// When using [`repeat`], the [`gap`]($repeat.gap) property can be useful
/// to tweak the visual weight of the fill. /// to tweak the visual weight of the fill.

View File

@ -188,7 +188,7 @@ pub struct RawElem {
/// - A path string to load a syntax file from the given path. For more /// - A path string to load a syntax file from the given path. For more
/// details about paths, see the [Paths section]($syntax/#paths). /// details about paths, see the [Paths section]($syntax/#paths).
/// - Raw bytes from which the syntax should be decoded. /// - Raw bytes from which the syntax should be decoded.
/// - An array where each item is one the above. /// - An array where each item is one of the above.
/// ///
/// ````example /// ````example
/// #set raw(syntaxes: "SExpressions.sublime-syntax") /// #set raw(syntaxes: "SExpressions.sublime-syntax")

View File

@ -44,7 +44,7 @@ I am #amazed(color: purple)[amazed]!
Templates now work by wrapping our whole document in a custom function like Templates now work by wrapping our whole document in a custom function like
`amazed`. But wrapping a whole document in a giant function call would be `amazed`. But wrapping a whole document in a giant function call would be
cumbersome! Instead, we can use an "everything" show rule to achieve the same cumbersome! Instead, we can use an "everything" show rule to achieve the same
with cleaner code. To write such a show rule, put a colon directly behind the with cleaner code. To write such a show rule, put a colon directly after the
show keyword and then provide a function. This function is given the rest of the show keyword and then provide a function. This function is given the rest of the
document as a parameter. The function can then do anything with this content. document as a parameter. The function can then do anything with this content.
Since the `amazed` function can be called with a single content argument, we can Since the `amazed` function can be called with a single content argument, we can