Version: latest (v0.3.0)

expand_esm_template

Stable function · Other

Tier: stable · Kind: function · Topic: Other

PythonJuliaRust
expand_esm_templateexpand_esm_templateexpand_esm_template

Python

expand_esm_template(template: str, anchor: _dt.datetime | None = None, substitutions: Mapping[str, str] | None = None) -> str

Expand an esm URL template at anchor (a UTC instant; a naive datetime is read as UTC) with substitutions. See spec/esm-sources.md §1.

Source

Julia

expand_esm_template(template::AbstractString; ...)
expand_esm_template(template::AbstractString, anchor; substitutions)
expand_esm_template(template, anchor=nothing; substitutions=Dict()) -> String

Expand an esm URL template (spec/esm-sources.md §1) at anchor — a UTC DateTime, Unix seconds, or nothing — with substitutions (name => string). Errors are EsmTemplateError s carrying a §1.3 code.

Source

Rust

pub fn expand_esm_template(template: &str, anchor: Option<OffsetDateTime>, substitutions: &BTreeMap<String, String>) -> Result<String, EsmTemplateError>

Expand an esm URL template (spec/esm-sources.md §1) at anchor (a UTC instant; an offset is converted to UTC) with substitutions.

Source · Rust docs