~subsetpark/erasmus

3013b697be5cc29c9d2b347735bb8b9933b3eec7 — Zach Smith 3 months ago e34130f
Improve pant doc.
1 files changed, 16 insertions(+), 10 deletions(-)

M priv/zk.pant
M priv/zk.pant => priv/zk.pant +16 -10
@@ 67,7 67,7 @@ ref s = "%ref:" + escape s + "\n".

ref_note n = ref (name n).

body n = [all line<: n, ~(line in (references n)) => line].
body n = [all line<: n, ~(line in references m) => line].

// As mentioned above, to *index* a note is to take the note body, prepend all
// of the backlinks to that note, and append all the references to other notes


@@ 75,26 75,32 @@ body n = [all line<: n, ~(line in (references n)) => line].
// to any note that links to this one; a (forward) reference is a reference to
// any note which is linked to by this one.

backlinks n = {all m: Note, (bracketed (name n)) in m => ref_note m}.
references n = [all s: String, (bracketed s) in n => ref s].
backlinks n = {all m: Note, bracketed (name n) in m => ref_note m}.
references n = [all s: String, bracketed s in n => ref s].

// It's worth noting that references can be ordered as they appear in the note
// body; but backlinks have no defined order.

n (bracketed (name (referent rr))).

all (r, rr)<: references n =>
        n (bracketed (name (referent r))) < n (bracketed (name (referent rr))) ->
        n (reference_source r) < n (reference_source rr) ->
                (references n) r < (references n) rr.

;

// To link to any name, simply enclose it in square brackets in the body of a note.
bracketed s: String => String.

// To link to any name, simply enclose it in curly braces in the body of a note.

escape s: String => String.
bracketed s: String => String.

referent r: Reference => Note.
reference_source r: Reference => String.
---

bracketed s = "[" + s + "]".
bracketed s = "{" + s + "}".

reference_source r = bracketed (name (referent r)).

;

referent r: Reference => Note.
---