const fieldName = "theme"; // Your field with linksconst oldPrefix = "Thoughts/01 Themes/";const newPrefix = "Digital Garden/Topics/";const relatedLinks = dv.current()[fieldName];if (Array.isArray(relatedLinks)) { // Map over the links, replace the path, and output only clickable links dv.el("span", relatedLinks .map(link => { if (link && link.path) { let newPath = link.path.startsWith(oldPrefix) ? link.path.replace(oldPrefix, newPrefix) : link.path; return dv.fileLink(newPath); } }) .filter(Boolean).join(", ") // Remove any undefined/null items );} else { dv.el(dv.current().theme);}
Define measure of subsets of R, which we will eventually call Lebesgue measure.
Properties we want for this idea
m(E) is defined for all E⊂R
if I is an interval then m(E)=ℓ(I) the “length” of I
If {En} is a (countable) collection of disjoint subsets of E such that E=⋃nEn, then we want m(⋃nEn)=m(E)
Translation invariance. ie, if E⊂R and x∈R, then m(x+E)=m({x+y∣y∈E})=m(E)
SPOILER
Unfortunately, this is impossible. Such an m:P(R)→[0,∞) does not exist.
Instead, we can drop the assumption that measure is defined on all subsets of R. Instead, we can satisfy properties 2-4 and get it defined on “a large collection” of sets, which we will call Lebesgue measurable sets.
We will construct a function we call the outer measurem∗:P(R)→[0,∞) (which is defined on all of R) satisfying (2), almost (3), and (4).