# Το τετράδιο του αναγνώστη: σημειώσεις σε ό,τι επιλέγει

> Επιλέξτε ένα απόσπασμα σχολικού βιβλίου και γράψτε μια σημείωση: οι λέξεις χρωματίζονται, μπαίνει αριθμημένη σημαία στο περιθώριο, ένα τετράδιο τις απαριθμεί.

- Έκδοση HTML: https://postext.dev/el/cookbook/reader-notebook
- Συνταγή Αρ. 224 · Ενσωμάτωση σε CMS · Επίπεδο 2 (Μεσαίο) · Έξοδοι: Canvas
- Είδη: Σχολικά βιβλία
- Απαιτεί postext ≥ 1.103.0 · δοκιμασμένη με 1.103.1 στις 2026-12-04
- Σελίδες: [1](https://postext.dev/cookbook/reader-notebook/en/p01.webp?v=5095b0ef), [2](https://postext.dev/cookbook/reader-notebook/en/p02.webp?v=5095b0ef)
- ![Η εφαρμογή μελέτης μόλις ανοίγει: τρεις σημειώσεις στο κεφάλαιο 4, κάθε απόσπασμα χρωματισμένο με αριθμημένη σημαία στο εξωτερικό περιθώριο, και το τετράδιο που τις απαριθμεί με τις λέξεις και τη σελίδα τους.](https://postext.dev/cookbook/reader-notebook/en/s01.webp?v=5095b0ef)
- ![Ένα επιλεγμένο απόσπασμα και μια κάρτα ανοιχτή από κάτω, με τις λέξεις που αφορά και τη σημείωση μισογραμμένη.](https://postext.dev/cookbook/reader-notebook/en/s02.webp?v=5095b0ef)
- ![Η νέα σημείωση πήρε τον αριθμό 3 και οι επόμενες ανέβηκαν κατά έναν· ένα πάτημα στη σημαία 4 ανοίγει εκείνη τη σημείωση πάνω στη σελίδα, με Επεξεργασία και Διαγραφή, και το τετράδιο την επισημαίνει.](https://postext.dev/cookbook/reader-notebook/en/s03.webp?v=5095b0ef)
- Τελευταία ενημέρωση: 2026-12-04
- Άλλες γλώσσες: [en](https://postext.dev/en/cookbook/reader-notebook.md), [es](https://postext.dev/es/cookbook/reader-notebook.md), [ca](https://postext.dev/ca/cookbook/reader-notebook.md), [de](https://postext.dev/de/cookbook/reader-notebook.md), [fr](https://postext.dev/fr/cookbook/reader-notebook.md), [it](https://postext.dev/it/cookbook/reader-notebook.md), [pt](https://postext.dev/pt/cookbook/reader-notebook.md), [ru](https://postext.dev/ru/cookbook/reader-notebook.md), [zh](https://postext.dev/zh/cookbook/reader-notebook.md), [ja](https://postext.dev/ja/cookbook/reader-notebook.md), [ar](https://postext.dev/ar/cookbook/reader-notebook.md)

## Με λίγα λόγια

Ένα βιβλίο ιστορίας σε μια εφαρμογή μελέτης. Επιλέγετε μερικές λέξεις και από κάτω ανοίγει μια κάρτα για να γράψετε σημείωση. Οι λέξεις παίρνουν απαλό χρώμα και αριθμημένη ετικέτα στο περιθώριο. Δίπλα στο βιβλίο φαίνονται όλες.

## Τι θα στοιχειοθετήσετε

Ένα κεφάλαιο σχολικού βιβλίου ιστορίας, *When books became cheap* («Όταν τα βιβλία έγιναν φτηνά»), σε μια εφαρμογή μελέτης. Μια μαθήτρια επιλέγει ένα απόσπασμα και από κάτω ανοίγει μια κάρτα με τις λέξεις σε παράθεση και ένα πλαίσιο για γράψιμο. Με την αποθήκευση το απόσπασμα χρωματίζεται και μια αριθμημένη σημαία εμφανίζεται στο φαρδύ εξωτερικό περιθώριο. Η σημαία, ή οι χρωματισμένες λέξεις, ανοίγουν τη σημείωση πάνω στη σελίδα, με κουμπιά για επεξεργασία ή διαγραφή. Το τετράδιο δεξιά απαριθμεί όλες τις σημειώσεις με τη σειρά ανάγνωσης, με τις λέξεις που αφορούν και τη σελίδα τους: το φύλλο επανάληψης που φτιάχνει κανείς διαβάζοντας. Οι σημειώσεις μένουν στη συσκευή ως άγκυρες, έτσι μια διορθωμένη έκδοση του βιβλίου τις κρατά πάνω στις λέξεις τους.

**Αυτή η συνταγή απαντά:**

- Πώς αφήνω τους αναγνώστες να γράφουν σημείωση σε απόσπασμα που επιλέγουν και να βλέπουν τις σημειώσεις τους;

## Η σύντομη απάντηση

```js
// script.js, γραμμές 137–158
const view = createViewer($('viewer'), {
  document: doc, markdown, zoom: 'fit-width', maxZoom: 0.85, labels: L.viewer,
  marks: { noteSide: 'end' }, // the flags in the wide outer margin
});
let card = null; // what the card over the page shows: { range } to write, { id } to read
view.on('select', ({ range }) => {
  const same = card?.range && card.range.start === range?.start && card.range.end === range?.end;
  if (range && range.end > range.start && !same) compose({ range });
});
view.on('annotationclick', ({ id }) => read(id));
function addNote(range, body) {
  notes = [...notes, { id: nextId(), body, range }];
  save();
  render();
}
function render() {
  notes.sort((a, b) => a.range.start - b.range.start);
  view.setAnnotations(notes.map(({ id, range }, i) => ({
    id, kind: 'note', range, label: String(i + 1), color: INK,
  })));
  renderNotebook();
}
```

## Υλικά

**Διδάσκει**

- [Σημάδια σχολιασμού](https://postext.dev/el/docs/integration-marks.md#σημάνσεις-σχολιασμού): Επισημάνσεις, υπογραμμίσεις, διαγραφές, αντικαταστάσεις, προσθήκες, σημειώσεις και πλαίσια πάνω στο κείμενο των σελίδων, ζωγραφισμένα σε καμβά ή γραμμένα ως SVG πάνω σε εικόνες σελίδων.
- [Άγκυρες που αντέχουν στις αναθεωρήσεις](https://postext.dev/el/docs/integration-anchors.md#άγκυρες-και-αλλαγές): Η textAnchor κρατά ένα εύρος μαζί με το παράθεμα και τα συμφραζόμενά του, ώστε η resolveAnchor να το ξαναβρίσκει σε αναθεωρημένο κείμενο· η applyEdits γράφει τις αποδεκτές αλλαγές και η mapOffset μεταφέρει τις υπόλοιπες θέσεις.

**Χρησιμοποιεί επίσης**

- [Πρόγραμμα προβολής σελίδων (postext-viewer)](https://postext.dev/el/docs/integration-viewer.md#το-πρόγραμμα-προβολής-σελίδων)
- [Γεωμετρία κειμένου (εύρη και σημεία)](https://postext.dev/el/docs/integration-geometry.md#το-κείμενο-στη-σελίδα)
- [Γραμματοσειρές πριν από τη σελιδοποίηση](https://postext.dev/el/docs/configuration-programmatic-usage.md#φόρτωση-γραμματοσειρών-πριν-από-τη-σελιδοποίηση)
- [Τρέχουσες κεφαλίδες και αριθμοί σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα)
- [Σημασιολογική χρωματική παλέτα](https://postext.dev/el/docs/configuration-fonts-colors-viewers.md#παλέτα-χρωμάτων)

**Η διαμόρφωση με μια ματιά**

- [`bodyText`](https://postext.dev/el/docs/configuration-text.md#κυρίως-κείμενο), [`colorPalette`](https://postext.dev/el/docs/configuration-fonts-colors-viewers.md#παλέτα-χρωμάτων), [`footer`](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα), [`header`](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα), [`headings`](https://postext.dev/el/docs/configuration-headings.md#επικεφαλίδες), [`layout`](https://postext.dev/el/docs/configuration-page-layout.md#διάταξη), [`locale`](https://postext.dev/el/docs/configuration-language.md#συλλαβισμός), [`page`](https://postext.dev/el/docs/configuration-page-layout.md#σελίδα)

**API**

- [`buildDocumentWithFonts`](https://postext.dev/el/docs/configuration-programmatic-usage.md#φόρτωση-γραμματοσειρών-πριν-από-τη-σελιδοποίηση), `createViewer`, [`renderPageToCanvas`](https://postext.dev/el/docs/configuration-programmatic-usage.md#απόδοση-σελίδας-σε-bitmap), `resolveAnchor`, `setAnnotations`, `textAnchor`

**Γραμματοσειρές**

- Source Serif 4 (OFL-1.1), Source Sans 3 (OFL-1.1)

## Προετοιμασία

### 1 · Αποθηκεύστε κάθε σημείωση με μια άγκυρα

```js
// script.js, γραμμές 112–133
const KEY = `${RECIPE}:${LANG}`;
const quote = (text) => {
  const start = markdown.indexOf(text);
  return { start, end: start + text.length };
};
const seed = t({
  en: [['the skins of some two hundred calves', 'A Bible cost a herd of calves. Compare with a house today.'],
    ['used again', 'Movable type: the letters are reused, not the page.'],
    ['Printing also fixed the text.', 'Key idea for the essay: printing made every copy the same.']],
  es: [['la piel de unos doscientos terneros', 'Una Biblia costaba un rebaño de terneros. Compararlo con una casa hoy.'],
    ['se volvían a usar', 'Tipos móviles: se reutilizan las letras, no la página.'],
    ['La imprenta también fijó el texto.', 'Idea clave para el trabajo: la imprenta hizo iguales todos los ejemplares.']],
}).map(([text, body], i) => ({ id: `n${i + 1}`, body, anchor: textAnchor(markdown, quote(text)) }));
const kept = JSON.parse(localStorage.getItem(KEY) ?? 'null') ?? seed;
let notes = kept.flatMap((n) => {
  const found = resolveAnchor(markdown, n.anchor);
  return found.status === 'exact' || found.status === 'moved'
    ? [{ ...n, range: { start: found.start, end: found.end } }] : [];
});
const nextId = () => `n${1 + Math.max(0, ...notes.map((n) => Number(n.id.slice(1)) || 0))}`;
const save = () => localStorage.setItem(KEY, JSON.stringify(
  notes.map(({ id, body, range }) => ({ id, body, anchor: textAnchor(markdown, range) }))));
```

Η εφαρμογή αποθηκεύει μια σημείωση ως το κείμενό της και μια άγκυρα του αποσπάσματος (`textAnchor`): το εύρος, τις λέξεις και λίγο συγκείμενο από κάθε πλευρά. Στο άνοιγμα, το `resolveAnchor` βρίσκει κάθε απόσπασμα στην έκδοση που υπάρχει. Μια διόρθωση του εκδότη μία σελίδα νωρίτερα μετακινεί τις θέσεις· η άγκυρα ξαναβρίσκει τις λέξεις, και χάνεται μόνο ένα απόσπασμα που κόπηκε.

### 2 · Κάντε μια επιλογή σημάδι σημείωσης

Ο κώδικας είναι [η σύντομη απάντηση](https://postext.dev/el/cookbook/reader-notebook.md#η-σύντομη-απάντηση) παραπάνω. Η προβολή αναφέρει μια ολοκληρωμένη επιλογή ως εύρος του Markdown, και η εφαρμογή ανοίγει την κάρτα της γι' αυτό. Μια αποθηκευμένη σημείωση είναι σημάδι `note`: χρωματίζει τις λέξεις της και βάζει σημαία στο περιθώριο, και το `noteSide: 'end'` στέλνει όλες τις σημαίες στο εξωτερικό. Οι ετικέτες είναι οι αριθμοί των σημειώσεων με τη σειρά ανάγνωσης, οπότε μια σημείωση νωρίς στο κεφάλαιο ανεβάζει τους επόμενους αριθμούς, όπως σε τυπωμένο βιβλίο.

### 3 · Ανοίξτε την κάρτα κάτω από τις λέξεις

```js
// script.js, γραμμές 162–215
function compose({ range, id }) {
  card = { range, id };
  $('card').dataset.mode = 'write';
  $('quote').textContent = plain(range);
  $('body').value = id ? notes.find((n) => n.id === id).body : '';
  show();
  $('body').focus({ preventScroll: true });
}
function read(id) {
  const note = notes.find((n) => n.id === id);
  card = { id, range: note.range };
  $('card').dataset.mode = 'read';
  $('number').textContent = `${L.note} ${notes.indexOf(note) + 1}`;
  $('quote').textContent = plain(note.range);
  $('text').textContent = note.body;
  show();
}
function show() {
  $('card').hidden = false;
  place();
  for (const item of $('list').children) item.setAttribute('aria-current', String(item.dataset.id === card.id));
}
function hide() {
  card = null;
  $('card').hidden = true;
  view.setSelection(null);
  for (const item of $('list').children) item.removeAttribute('aria-current');
}
// Under the last line of the words: page px turned into the window's px.
function place() {
  if (!card) return;
  const last = view.rangeRects(card.range).at(-1);
  const at = last && view.pageToClient(last.pageIndex, last.rect.x, last.rect.y + last.rect.height);
  if (at) Object.assign($('card').style, { left: `${at.x}px`, top: `${at.y + 10}px` });
}
$('save').addEventListener('click', () => {
  const body = $('body').value.trim();
  if (body && card.id) notes = notes.map((n) => (n.id === card.id ? { ...n, body } : n));
  else if (body) return void (addNote(card.range, body), hide());
  save();
  render();
  hide();
});
$('cancel').addEventListener('click', hide);
$('edit').addEventListener('click', () => compose(card));
$('remove').addEventListener('click', () => {
  notes = notes.filter((n) => n.id !== card.id);
  save();
  render();
  hide();
});
view.on('zoomchange', place);
view.element.addEventListener('scroll', place, { capture: true, passive: true });
addEventListener('keydown', (e) => e.key === 'Escape' && hide());
```

Μία κάρτα κάνει και τις δύο δουλειές: γράψιμο, με τις λέξεις σε παράθεση, ένα πλαίσιο κειμένου και Αποθήκευση· ανάγνωση, με τη σημείωση και Επεξεργασία ή Διαγραφή. Το `rangeRects` δίνει την τελευταία γραμμή του αποσπάσματος σε pixel σελίδας και το `pageToClient` τη μετατρέπει σε pixel παραθύρου, έτσι η κάρτα κάθεται κάτω από τις λέξεις σε κάθε ζουμ και τις ακολουθεί στην κύλιση.

### 4 · Κρατήστε το τετράδιο δίπλα στις σελίδες

```js
// script.js, γραμμές 219–233
function renderNotebook() {
  $('count').textContent = L.count(notes.length);
  $('list').replaceChildren(...notes.map(({ id, body, range }, i) => {
    const item = document.createElement('button');
    item.type = 'button';
    item.dataset.id = id;
    item.innerHTML = '<span class="n"></span><q></q><p></p><small></small>';
    item.querySelector('.n').textContent = i + 1;
    item.querySelector('q').textContent = plain(range);
    item.querySelector('p').textContent = body;
    item.querySelector('small').textContent = L.page(view.rangeRects(range)[0].pageIndex + 1);
    item.addEventListener('click', () => { view.revealAnnotation(id); read(id); });
    return item;
  }));
}
```

Το τετράδιο είναι οι ίδιες εγγραφές με τη σειρά ανάγνωσης. Ένα πάτημα σε μια καταχώριση φέρνει τις λέξεις της σε θέα με το `revealAnnotation` και ανοίγει την κάρτα της, και η καταχώριση μένει επισημασμένη όσο η κάρτα είναι ανοιχτή.

## Η πλήρης συνταγή

Τα παρακάτω αρχεία συντίθενται από τον φάκελο της συνταγής, με το δείγμα κειμένου και το κοινό κιτ του Συνταγολογίου ενσωματωμένα. Για να τα εκτελέσετε ως μία σελίδα, βάλτε την HTML στο `<body>`, το CSS σε ένα στοιχείο `<style>` και το script σε ένα `<script type="module">`· ή επικολλήστε το καθένα στο αντίστοιχο πάνελ ενός νέου CodePen (το JS ως module). Το script εισάγει το postext από το esm.sh, οπότε δεν χρειάζεται εγκατάσταση ούτε build.

- Φάκελος πηγής: https://github.com/drnachio/postext/tree/main/cookbook/reader-notebook

### index.html

```html
<main id="pages">
  <div id="viewer"></div>
  <aside id="panel">
    <h2 id="title"></h2>
    <p id="count"></p>
    <div id="list"></div>
  </aside>
  <section id="card" role="dialog" aria-labelledby="number" data-mode="read" hidden>
    <p id="number"></p>
    <blockquote id="quote"></blockquote>
    <p id="text"></p>
    <textarea id="body" rows="3"></textarea>
    <div class="actions">
      <button id="save" type="button" class="primary"></button>
      <button id="cancel" type="button"></button>
      <button id="edit" type="button"></button>
      <button id="remove" type="button"></button>
    </div>
  </section>
</main>
```

### style.css

```css
/* A study app: the textbook's pages on a cool desk, the reader's notebook beside them.
   The viewer fills its container, so the container gets a height. */
main#pages {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: max(560px, 100vh);
  justify-items: stretch; gap: 0; padding: 0; font: 15px/1.45 system-ui, sans-serif; color: #1f2328;
  color-scheme: light;
}
#viewer { min-height: 0; }
#viewer .postext-viewer {
  --pv-background: #e4e8ec; --pv-focus: #0f766e; --pv-selection: rgb(15 118 110 / .2);
}
#panel { overflow: auto; padding: 26px 22px; background: #f7f9fa; border-left: 1px solid #d3dae0; }
#panel h2 { margin: 0; font: 700 22px/1.2 'Source Sans 3', system-ui, sans-serif; color: #24527a; }
#count { margin: 2px 0 18px; font-size: 13px; color: #68707a; }
#list { display: grid; gap: 10px; }
#list button {
  display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; row-gap: 4px;
  min-height: 44px; padding: 12px 14px; text-align: left; color: inherit; font: inherit;
  background: #fff; border: 1px solid #dce2e7; border-radius: 10px; cursor: pointer;
  box-shadow: 0 1px 2px rgb(20 40 60 / .06);
}
#list button:hover, #list button[aria-current='true'] { border-color: #0f766e; }
#list button[aria-current='true'] { box-shadow: 0 0 0 1px #0f766e; }
#list button:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
#list .n {
  grid-row: span 3; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 4px; background: #0f766e; color: #fff; font-size: 12px; font-weight: 700;
}
#list q { font: italic 14px/1.4 'Source Serif 4', Georgia, serif; color: #4b535c; }
#list p { margin: 0; }
#list small { font-size: 12px; font-weight: 600; color: #68707a; }
/* The card floats under the words: placed in window px from pageToClient, so fixed. */
#card {
  position: fixed; z-index: 2; width: 320px; margin-left: -14px; padding: 14px 16px 12px;
  background: #fff; border: 1px solid #c9d2da; border-top: 3px solid #0f766e; border-radius: 10px;
  box-shadow: 0 14px 34px -10px rgb(15 30 45 / .4);
}
#card::before {
  content: ''; position: absolute; top: -9px; left: 22px; width: 12px; height: 12px;
  background: #0f766e; transform: rotate(45deg); z-index: -1;
}
#card[hidden] { display: none; }
#number { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: #0f766e; text-transform: uppercase; }
#quote {
  margin: 0 0 8px; padding-left: 10px; border-left: 2px solid #cfe5e2;
  font: italic 14px/1.4 'Source Serif 4', Georgia, serif; color: #4b535c;
}
#text { margin: 0 0 10px; }
#body {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 8px 10px;
  border: 1px solid #c9d2da; border-radius: 6px; background: #fff; font: inherit; color: inherit; resize: vertical;
}
#body:focus-visible { outline: 2px solid #0f766e; outline-offset: 1px; }
.actions { display: flex; gap: 8px; }
.actions button {
  min-height: 44px; padding: 0 14px; border: 1px solid #c9d2da; border-radius: 6px;
  background: #f4f6f8; font: 600 14px system-ui, sans-serif; color: inherit; cursor: pointer;
}
.actions button.primary { background: #0f766e; border-color: #0f766e; color: #fff; }
.actions button:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
#remove { margin-left: auto; color: #a1312a; }
#card[data-mode='write'] :is(#number, #text, #edit, #remove) { display: none; }
#card[data-mode='read'] :is(#body, #save, #cancel) { display: none; }
```

### script.js

```js
// ═══ Postext Cookbook · Nº 224 · A reader's notebook ═════════════════════════════════
// https://postext.dev/en/cookbook/reader-notebook
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Source Serif 4, Source Sans 3 (SIL OFL 1.1) · Needs postext ≥ 1.103.0
//
// A history textbook in a study app. Select a passage and write a note on it: the passage
// is tinted and a numbered flag goes in the margin. A flag opens its note over the page,
// and the notebook beside the pages lists every note with the words it is about. The notes
// are kept on this device as anchors, so a corrected edition of the book keeps them.
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { textAnchor, resolveAnchor } from 'https://esm.sh/postext/annotate';
import { createViewer } from 'https://esm.sh/postext-viewer';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'reader-notebook';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: semantic colours, every one linked by id
const palette = {
  ink: '#1f2328', // text
  accent: '#24527a', // ink blue: chapter number, headings, folio
  muted: '#68707a', // running head
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'accent (defaults)', value: { hex: palette.accent, model: 'hex' } },
];
// #endregion

// #region page: a textbook page with a wide outer margin, where the reader's flags go
const config = {
  locale: t({ en: 'en-gb', es: 'es' }),
  colorPalette,
  page: { sizePreset: 'custom', width: mm(170), height: mm(240), dpi: 150,
    margins: { top: mm(22), bottom: mm(24), left: mm(20), right: mm(48) } },
  layout: { layoutType: 'single' },
  bodyText: { fontFamily: 'Source Serif 4', fontSize: pt(10.5), lineHeight: pt(15),
    color: col('ink'), boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
    textAlign: 'left', firstLineIndent: mm(5), indentAfterHeading: false,
    hyphenation: { enabled: true }, avoidWidows: true, avoidOrphans: true, avoidRunts: true },
  headings: { fontFamily: 'Source Sans 3', color: col('accent'), fontWeight: 700, levels: [
    { level: 1, fontSize: pt(22), lineHeight: pt(26), marginTop: pt(0), marginBottom: pt(15) },
    { level: 2, fontSize: pt(11), lineHeight: pt(15), marginTop: pt(15), marginBottom: pt(4) },
  ] },
  header: { elements: [
    { kind: 'text', id: 'head', content: '{title}', fontFamily: 'Source Sans 3', fontSize: pt(7.5),
      fontWeight: 700, letterSpacing: pt(1.2), textTransform: 'uppercase', color: col('muted'),
      align: 'left', placement: { anchor: { to: 'page', edge: 'top-left' },
        offset: { x: mm(20), y: mm(12) } } },
  ] },
  footer: { elements: [
    { kind: 'text', id: 'folio', content: '{pageNumber}', fontFamily: 'Source Sans 3',
      fontSize: pt(8.5), fontWeight: 700, color: col('accent'), align: 'left',
      placement: { anchor: { to: 'page', edge: 'bottom-left' }, offset: { x: mm(20), y: mm(-12) } } },
  ] },
};
// #endregion

// ─── 2 · Content ────────────────────────────────────────────────────────────
const markdown = String.raw`---
title: "Reading Through Time"
author: "Lena Ortiz"
---

# 4 · When books became cheap

Before the middle of the fifteenth century, every book in Europe was copied by hand. A scribe working steadily could finish a Bible in about a year, and the parchment alone, the skins of some two hundred calves, cost more than a house. Books were chained to desks in monasteries and universities, and most people who could read had held only a handful of them in their lives.

Around 1450, in the city of Mainz, Johannes Gutenberg put together a way of printing that used separate metal letters. Each letter was cast in a mould, so a printer could make thousands that were exactly alike. The letters were set in lines, locked into a frame, inked, and pressed against paper in a press adapted from the ones used to squeeze grapes. When the page had been printed as many times as needed, the letters were taken apart and used again.

The idea spread quickly. By 1500 there were presses in more than two hundred towns, and historians estimate that they had produced some twenty million copies of books. Paper, made from old linen rags, was far cheaper than parchment. A book that had cost a year's wages could now be bought for the price of a few days' work.

Cheaper books changed who read and how. Students no longer had to copy their textbooks or listen to a teacher read one aloud; they could own a copy and mark it. Merchants bought printed guides to arithmetic and letter writing. Pamphlets carried news and arguments from one city to another in weeks rather than months, and in the religious quarrels of the sixteenth century both sides printed as fast as they could.

Printing also fixed the text. Two handwritten copies of the same book were never quite alike, because every scribe made small mistakes and sometimes corrected what he thought were the mistakes of others. Five hundred printed copies of an edition, on the other hand, said the same thing on the same page. A reader in Venice and a reader in London could point to page 37 and know that they were looking at the same words.

That sameness made new kinds of books possible. Indexes, page numbers and tables of contents only work when every copy is laid out alike. Scholars began to compare editions, list their errors, and print corrected ones. Maps and diagrams, which copyists had often redrawn badly, could be cut once in wood or copper and printed without change.

Not everyone welcomed the flood of print. Some writers complained that there were now too many books to read and too many of them bad. Authorities in several countries set up lists of forbidden titles and required printers to have a licence. Yet the presses kept running, and within a century the printed book had become the ordinary way to learn, argue and remember.

## Questions to think about

How did the price of a book change who could own one? Which features of a modern textbook depend on every copy being printed alike?
`; // content.<lang>.md, inlined by the Cookbook

// ─── 3 · Fonts ──────────────────────────────────────────────────────────────
const FONTS = {
  'Source Serif 4': ['400', '400i'],
  'Source Sans 3': ['700'],
};

// ─── 4 · Build & show ───────────────────────────────────────────────────────
const doc = await buildDocumentWithFonts({ markdown }, config, kitFonts(FONTS));
kitStatus(t({ en: 'Reading Through Time · my notebook', es: 'Leer a través del tiempo · mi cuaderno' }));

const INK = '#0f766e'; // the reader's pen: the tint, the flags and the notebook
const L = t({
  en: { title: 'Notebook', count: (n) => `${n} note${n === 1 ? '' : 's'} on chapter 4`,
    page: (p) => `p. ${p}`, note: 'Note', save: 'Save note', cancel: 'Cancel', edit: 'Edit',
    remove: 'Delete', placeholder: 'What do you want to remember about this passage?', viewer: {} },
  es: { title: 'Cuaderno', count: (n) => `${n} ${n === 1 ? 'nota' : 'notas'} del capítulo 4`,
    page: (p) => `p. ${p}`, note: 'Nota', save: 'Guardar nota', cancel: 'Cancelar', edit: 'Editar',
    remove: 'Borrar', placeholder: '¿Qué quieres recordar de este pasaje?',
    viewer: { viewer: 'Páginas del libro', page: 'Página {n} de {count}',
      selection: '{count} caracteres seleccionados', selectionCleared: 'Selección borrada',
      kinds: { note: 'Nota' } } },
});
const $ = (id) => document.getElementById(id);

// #region store: each note keeps an anchor of its words, found again in the edition at hand
const KEY = `${RECIPE}:${LANG}`;
const quote = (text) => {
  const start = markdown.indexOf(text);
  return { start, end: start + text.length };
};
const seed = t({
  en: [['the skins of some two hundred calves', 'A Bible cost a herd of calves. Compare with a house today.'],
    ['used again', 'Movable type: the letters are reused, not the page.'],
    ['Printing also fixed the text.', 'Key idea for the essay: printing made every copy the same.']],
  es: [['la piel de unos doscientos terneros', 'Una Biblia costaba un rebaño de terneros. Compararlo con una casa hoy.'],
    ['se volvían a usar', 'Tipos móviles: se reutilizan las letras, no la página.'],
    ['La imprenta también fijó el texto.', 'Idea clave para el trabajo: la imprenta hizo iguales todos los ejemplares.']],
}).map(([text, body], i) => ({ id: `n${i + 1}`, body, anchor: textAnchor(markdown, quote(text)) }));
const kept = JSON.parse(localStorage.getItem(KEY) ?? 'null') ?? seed;
let notes = kept.flatMap((n) => {
  const found = resolveAnchor(markdown, n.anchor);
  return found.status === 'exact' || found.status === 'moved'
    ? [{ ...n, range: { start: found.start, end: found.end } }] : [];
});
const nextId = () => `n${1 + Math.max(0, ...notes.map((n) => Number(n.id.slice(1)) || 0))}`;
const save = () => localStorage.setItem(KEY, JSON.stringify(
  notes.map(({ id, body, range }) => ({ id, body, anchor: textAnchor(markdown, range) }))));
// #endregion

// #region answer: a selection becomes a note, a numbered flag in the margin
const view = createViewer($('viewer'), {
  document: doc, markdown, zoom: 'fit-width', maxZoom: 0.85, labels: L.viewer,
  marks: { noteSide: 'end' }, // the flags in the wide outer margin
});
let card = null; // what the card over the page shows: { range } to write, { id } to read
view.on('select', ({ range }) => {
  const same = card?.range && card.range.start === range?.start && card.range.end === range?.end;
  if (range && range.end > range.start && !same) compose({ range });
});
view.on('annotationclick', ({ id }) => read(id));
function addNote(range, body) {
  notes = [...notes, { id: nextId(), body, range }];
  save();
  render();
}
function render() {
  notes.sort((a, b) => a.range.start - b.range.start);
  view.setAnnotations(notes.map(({ id, range }, i) => ({
    id, kind: 'note', range, label: String(i + 1), color: INK,
  })));
  renderNotebook();
}
// #endregion

// #region card: write or read a note, under its words, placed from page coordinates
function compose({ range, id }) {
  card = { range, id };
  $('card').dataset.mode = 'write';
  $('quote').textContent = plain(range);
  $('body').value = id ? notes.find((n) => n.id === id).body : '';
  show();
  $('body').focus({ preventScroll: true });
}
function read(id) {
  const note = notes.find((n) => n.id === id);
  card = { id, range: note.range };
  $('card').dataset.mode = 'read';
  $('number').textContent = `${L.note} ${notes.indexOf(note) + 1}`;
  $('quote').textContent = plain(note.range);
  $('text').textContent = note.body;
  show();
}
function show() {
  $('card').hidden = false;
  place();
  for (const item of $('list').children) item.setAttribute('aria-current', String(item.dataset.id === card.id));
}
function hide() {
  card = null;
  $('card').hidden = true;
  view.setSelection(null);
  for (const item of $('list').children) item.removeAttribute('aria-current');
}
// Under the last line of the words: page px turned into the window's px.
function place() {
  if (!card) return;
  const last = view.rangeRects(card.range).at(-1);
  const at = last && view.pageToClient(last.pageIndex, last.rect.x, last.rect.y + last.rect.height);
  if (at) Object.assign($('card').style, { left: `${at.x}px`, top: `${at.y + 10}px` });
}
$('save').addEventListener('click', () => {
  const body = $('body').value.trim();
  if (body && card.id) notes = notes.map((n) => (n.id === card.id ? { ...n, body } : n));
  else if (body) return void (addNote(card.range, body), hide());
  save();
  render();
  hide();
});
$('cancel').addEventListener('click', hide);
$('edit').addEventListener('click', () => compose(card));
$('remove').addEventListener('click', () => {
  notes = notes.filter((n) => n.id !== card.id);
  save();
  render();
  hide();
});
view.on('zoomchange', place);
view.element.addEventListener('scroll', place, { capture: true, passive: true });
addEventListener('keydown', (e) => e.key === 'Escape' && hide());
// #endregion

// #region notebook: every note with its words and page, in reading order
function renderNotebook() {
  $('count').textContent = L.count(notes.length);
  $('list').replaceChildren(...notes.map(({ id, body, range }, i) => {
    const item = document.createElement('button');
    item.type = 'button';
    item.dataset.id = id;
    item.innerHTML = '<span class="n"></span><q></q><p></p><small></small>';
    item.querySelector('.n').textContent = i + 1;
    item.querySelector('q').textContent = plain(range);
    item.querySelector('p').textContent = body;
    item.querySelector('small').textContent = L.page(view.rangeRects(range)[0].pageIndex + 1);
    item.addEventListener('click', () => { view.revealAnnotation(id); read(id); });
    return item;
  }));
}
// #endregion
const plain = ({ start, end }) => markdown.slice(start, end).replace(/[*_]/g, '');
$('title').textContent = L.title;
for (const id of ['save', 'cancel', 'edit', 'remove']) $(id).textContent = L[id];
$('body').placeholder = L.placeholder;
$('body').setAttribute('aria-label', L.placeholder);
render();

// The states the Cookbook photographs: a note being written, then one opened from its flag.
const [words, written] = t({
  en: ['some twenty million copies of books', 'Twenty million books in fifty years. How many before 1450?'],
  es: ['unos veinte millones de ejemplares', 'Veinte millones de libros en cincuenta años. ¿Cuántos había antes de 1450?'],
});
kitShots({
  write: () => {
    const range = quote(words);
    view.revealRange(range);
    view.setSelection(range);
    compose({ range });
    $('body').value = written;
  },
  open: () => {
    addNote(card.range, $('body').value);
    hide();
    view.revealAnnotation('n3');
    read('n3');
  },
});

// ─── Kit ── helpers shared by every Cookbook recipe · postext.dev/cookbook ─────

// ─── Kit · core v1 ── the same in every recipe · postext.dev/cookbook
function mm(value) { return { value, unit: 'mm' }; }
function pt(value) { return { value, unit: 'pt' }; }
function em(value) { return { value, unit: 'em' }; }
/** The sample language's string: t({ en: 'Figure', es: 'Figura' }). */
function t(strings) { return strings[LANG] ?? Object.values(strings)[0]; }
/** A file in this recipe's assets folder, served from the Postext repo by jsDelivr. */
function asset(file) { return `https://cdn.jsdelivr.net/gh/drnachio/postext@main/cookbook/${RECIPE}/assets/${file}`; }

// ─── Kit · fonts v3 ── the same in every recipe · postext.dev/cookbook
// Postext loads the faces a config asks for before layout and asks the kit
// for Fontsource's files, the ones the PDF embeds too.

/** buildDocumentWithFonts' options: the resolver, and FONTS' faces loaded
 *  with the config's. FONTS = { 'Family Name': ['400', '400i', '700'] }. */
function kitFonts(FONTS = {}) {
  const faces = Object.entries(FONTS).flatMap(([family, specs]) => specs.map((spec) =>
    ({ family, weight: parseInt(spec, 10), style: spec.endsWith('i') ? 'italic' : 'normal' })));
  return { resolve: fontsourceResolver, faces };
}

/** A face's files with their ranges: latin, then latin-ext and greek when
 *  `text` needs them (kitSubsetsFor). Null for a face Fontsource lacks. */
async function fontsourceResolver(family, weight, style, { text = '' } = {}) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  if (meta && !(await fontsourceWeights(family, style)).includes(weight)) return null;
  kitStatus('Loading fonts…');
  const at = await fontsourceAt(id);
  return ['latin', ...kitSubsetsFor(text, meta)].map((subset) => ({
    source: `${at}files/${id}-${subset}-${weight}-${style}.woff2`,
    unicodeRange: kitRanges()[subset],
  }));
}

/** Each file's unicode-range (a function: the kit runs after the pen's code). */
function kitRanges() {
  return {
    latin: 'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,'
      + 'U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
    'latin-ext': 'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,'
      + 'U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
    greek: 'U+0370-03FF',
  };
}

/** For the cjk, arabic and comics blocks: loads `faces` (as FONTS) for the
 *  sample `text`; `optional` skips a face Fontsource lacks. Files are added in
 *  the order asked, the last winning a shared character. Resolves to the count. */
async function loadFonts(faces, text = '', { optional = false } = {}) {
  kitStatus('Loading fonts…');
  const ranges = kitRanges();
  const jobs = [];
  for (const [family, specs] of Object.entries(faces)) {
    const id = fontsourceId(family);
    const todo = [...new Set(specs)].map((spec) => [parseInt(spec, 10), spec.endsWith('i') ? 'italic' : 'normal'])
      .filter(([weight, style]) => !hasFace(family, weight, style)); // before any await
    const at = fontsourceAt(id);
    const meta = optional || /[^\0-ÿ]/u.test(text) ? await fontsourceMeta(family) : null;
    const subsets = ['latin', ...kitSubsetsFor(text, meta)];
    for (const [weight, style] of todo) {
      if (optional && !(meta && (await fontsourceWeights(family, style)).includes(weight))) continue;
      for (const subset of subsets) {
        const url = `${await at}files/${id}-${subset}-${weight}-${style}.woff2`;
        const face = new FontFace(family, `url(${url}) format('woff2')`,
          { weight: String(weight), style, unicodeRange: ranges[subset] });
        jobs.push(face.load().catch(() => {
          if (subset === 'latin' && !optional) throw new Error(`Fontsource has no ${family} ${weight} ${style}`);
        }));
      }
    }
  }
  const ready = await Promise.all(jobs).catch((error) => { kitFail(error); throw error; });
  return ready.filter((face) => face && document.fonts.add(face)).length;
}

/** A loaded FontFace covers this face (fonts.check() says yes to any family). */
function hasFace(family, weight, style) {
  for (const face of document.fonts) {
    if (face.status !== 'loaded' || face.style !== style) continue;
    if (face.family.replace(/^["']|["']$/g, '') !== family) continue;
    const [low, high = low] = face.weight.split(' ').map(Number);
    if (weight >= low && weight <= high) return true;
  }
  return false;
}

/** The files beyond latin `text` needs that `meta`'s family ships. */
function kitSubsetsFor(text, meta) {
  return [[/[Ā-˿ᴀ-ᶿḀ-ỿ†ℓⱠ-Ɀ꜠-ꟿ]/u, 'latin-ext'], [/[Ͱ-Ͽ]/u, 'greek']]
    .filter(([re, x]) => re.test(text) && meta?.subsets?.includes(x)).map(([, x]) => x);
}

/** Fontsource's id for a family: 'Source Serif 4' → 'source-serif-4'. */
function fontsourceId(family) { return family.toLowerCase().replace(/\s+/g, '-'); }

/** A package's folder at the one version @5 names now (#766). */
function fontsourceAt(id, u = `https://cdn.jsdelivr.net/npm/@fontsource/${id}@`) {
  return (fontsourceAt.c ??= {})[id] ??= fetch(u + '5/package.json').then((r) => r.json())
    .then((p) => p.version || 5, () => 5).then((v) => `${u}${v}/`);
}

/** The family's Fontsource metadata (weights, styles, subsets), or null. */
function fontsourceMeta(family, id = fontsourceId(family)) {
  return (fontsourceMeta.c ??= {})[id] ??= fetch(`https://api.fontsource.org/v1/fonts/${id}`)
    .then((res) => (res.ok ? res.json() : null), () => null);
}

/** The weights the package ships in `style`: the API pairs none (no Libre
 *  Caslon 700 italic file), so italics are read from latin-italic.css. */
function fontsourceWeights(family, style, id = fontsourceId(family)) {
  return (fontsourceWeights.c ??= {})[id + style] ??= fontsourceMeta(family).then(async (m) => {
    if (!m?.styles.includes(style)) return m ? [] : [400, 700];
    const css = style === 'italic' ? await fetch(`${await fontsourceAt(id)}latin-italic.css`).then((r) => (r.ok ? r.text() : ''), () => '') : '';
    const w = [...css.matchAll(/weight: (\d+)/g)].map((x) => +x[1]);
    return w.length ? w : m.weights;
  });
}

// ─── Kit · viewer v2 ── the same in every recipe · postext.dev/cookbook
/** The pages as spreads on a dark desk, page 1 alone, then verso | recto,
 *  each painted when it scrolls near. Other options go to renderPageToCanvas. */
function showPages(docs, { title, width = 460, ...render } = {}) {
  const root = viewer(title);
  const pages = [docs].flat().flatMap((doc) =>
    doc.pages.map((page) => ({ doc, page, n: (doc.pageIndexOffset ?? 0) + page.index })));
  const spreads = [];
  let verso = null;
  for (const p of pages) {
    if (p.n % 2 === 1) { if (verso) spreads.push([verso, null]); verso = p; }
    else { spreads.push([verso, p]); verso = null; }
  }
  if (verso) spreads.push([verso, null]);
  const density = Math.min(window.devicePixelRatio || 1, 2);
  showPages.painter?.disconnect();
  const painter = new IntersectionObserver((entries) => {
    for (const { isIntersecting, target } of entries) {
      if (!isIntersecting) continue;
      painter.unobserve(target);
      const { doc, page } = target.postext;
      renderPageToCanvas(page, doc, target, { ...render, scale: (width * density) / page.width });
    }
  }, { rootMargin: '800px' });
  showPages.painter = painter;
  root.replaceChildren(...spreads.map((pair) => {
    const spread = document.createElement('div');
    spread.className = 'pt-spread';
    for (const p of pair) {
      const figure = document.createElement('figure');
      if (p) {
        const label = p.page.pageLabel || String(p.n + 1);
        const canvas = document.createElement('canvas');
        canvas.postext = p;
        canvas.style.aspectRatio = `${p.page.width} / ${p.page.height}`;
        canvas.setAttribute('role', 'img');
        canvas.setAttribute('aria-label', `Page ${label}`);
        const folio = document.createElement('figcaption');
        folio.textContent = label;
        figure.append(canvas, folio);
        painter.observe(canvas);
      } else figure.className = 'pt-blank';
      spread.append(figure);
    }
    return spread;
  }));
  kitStatus(`${pages.length} ${pages.length === 1 ? 'page' : 'pages'}`);
  document.documentElement.dataset.postext = 'ready';
  return pages.length;
}

/** The desk, the bar and the error reporting, created once. */
function viewer(title) {
  if (!document.getElementById('pt-kit')) {
    document.head.insertAdjacentHTML('beforeend', `<style id="pt-kit">
      :root { color-scheme: dark; }
      body { margin: 0; background: #0e1014; color: #b9bcc4; font: 13px/1.45 system-ui, sans-serif; }
      #pt-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
        gap: 6px 16px; padding: 10px 16px; background: rgb(14 16 20 / .92); backdrop-filter: blur(6px);
        border-bottom: 1px solid #23262d; }
      #pt-bar strong { color: #f4f1ea; font-weight: 600; }
      #pt-actions { display: flex; gap: 12px; margin-left: auto; }
      #pt-actions a, #pt-actions button { color: #d8a21a; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
      #pages { display: grid; justify-items: center; gap: 48px; padding: 32px 16px 72px; }
      .pt-spread { display: flex; }
      .pt-spread figure { margin: 0; width: min(460px, 44vw); }
      .pt-spread canvas { display: block; width: 100%; background: #fff;
        box-shadow: 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figure:first-child canvas { box-shadow: inset -14px 0 14px -14px rgb(0 0 0 / .18), 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figcaption { margin-top: 10px; text-align: center; font: 600 10px/1 system-ui, sans-serif;
        letter-spacing: .18em; text-transform: uppercase; color: #6c7079; }
      .pt-blank { visibility: hidden; }
      @media (max-width: 760px) {
        .pt-spread { flex-direction: column; gap: 32px; }
        .pt-spread figure { width: min(460px, 92vw); }
        .pt-blank { display: none; }
      }
    </style>`);
    document.body.insertAdjacentHTML('afterbegin',
      '<header id="pt-bar"><strong id="pt-title"></strong><span id="pt-status" role="status"></span><span id="pt-actions"></span></header>');
    document.getElementById('pt-title').textContent = document.title || 'Postext';
    addEventListener('error', (event) => kitFail(event.error ?? event.message));
    addEventListener('unhandledrejection', (event) => kitFail(event.reason));
  }
  if (title) document.getElementById('pt-title').textContent = title;
  return document.getElementById('pages')
    ?? document.body.appendChild(Object.assign(document.createElement('main'), { id: 'pages' }));
}

function kitStatus(text) {
  viewer();
  document.getElementById('pt-status').textContent = text;
}

function kitFail(error) {
  document.documentElement.dataset.postext = 'error';
  kitStatus(`Error: ${error?.message ?? error}`);
}

// ─── Kit · shots v1 ── developer recipes, photographed while they run
/** The states the Cookbook photographs the pen in, in order, after its first
 *  view: each an async function that puts the page in that state (a passage
 *  selected, a note open). The recipe page shows these pictures in place of
 *  the bare pages. Your own app leaves this call out. */
function kitShots(states) {
  window.__cbShots = states;
}

// ─── /Kit ───────────────────────────────────────────────────────────────────────
```

## Παραλλαγές

### Πρώτα υπογράμμιση, μετά γράψιμο

Πολλοί αναγνώστες σημαδεύουν ένα απόσπασμα και επιστρέφουν αργότερα. Το [Μαρκαδόρος για τον αναγνώστη: ένα απόσπασμα, ένα χρώμα](https://postext.dev/el/cookbook/reader-highlighter.md) κρατά χρωματιστές επισημάνσεις πάνω στις ίδιες άγκυρες· μια σημείωση μπορεί να ξεκινήσει ως μία από αυτές.

### Εξαγωγή του τετραδίου σε Markdown

Οι άγκυρες κρατούν τις λέξεις κάθε αποσπάσματος, οπότε το τετράδιο γράφεται ως φύλλο επανάληψης σε λίγες γραμμές.

```js
const sheet = notes.map(({ range, body }) => `> ${plain(range)}\n\n${body}`).join('\n\n');
```

## Ευχαριστίες

- Συνταγή: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- Γραμματοσειρές: Source Serif 4 (OFL-1.1), Source Sans 3 (OFL-1.1)
- Κώδικας: MIT · Δείγμα περιεχομένου: CC-BY-4.0

## Σχετικές συνταγές

- [Αρ. 215 · Σημειώσεις στο περιθώριο, με αναδυόμενο από τη σελίδα](https://postext.dev/el/cookbook/margin-notes-with-popovers.md): Οι σημειώσεις χρωματίζουν τις λέξεις τους και βάζουν σημαία στο περιθώριο· ένα πάτημα τις ανοίγει σε αναδυόμενο με rangeRects και pageToClient. · Επίπεδο 2 (Μεσαίο) · Κατάλογοι
- [Αρ. 212 · Επιλογή στη σελίδα, ανάγνωση εύρους και κειμένου Markdown](https://postext.dev/el/cookbook/selection-as-markdown-range.md): Το postext-viewer αναφέρει μια επιλογή στις σελιδοποιημένες σελίδες ως εύρος του Markdown, με το Markdown που καλύπτει και τα κομμάτια της ανά γραμμή. · Επίπεδο 1 (Βασικό) · Περιοδικά και fanzines
- [Αρ. 217 · Άγκυρες μετά την αναθεώρηση: μετακινημένες, αμφίσημες](https://postext.dev/el/cookbook/anchors-through-a-revision.md): Η textAnchor αποθηκεύει κάθε σημείωση με τις λέξεις και τα συμφραζόμενά της· η resolveAnchor τη βρίσκει στην επόμενη εκδοχή του κειμένου. · Επίπεδο 2 (Μεσαίο) · Εγχειρίδια, οδηγοί και έργα αναφοράς
