TEI-scholar-Codium-plugin

TEI Scholar

A VS Code extension for editing TEI P5 texts, built for Indological work. It runs on top of Red Hat’s XML extension, which does the schema validation (with Jing, the same validator oXygen uses).

Install

  1. Install VS Code.
  2. In VS Code: Extensions view → ⋯ menu → Install from VSIX… → choose tei-scholar-0.5.0.vsix. Red Hat’s XML extension is installed automatically (needs internet once).
  3. Open a TEI file. If it has no schema declaration you will be offered one.

Footnotes

Action Windows / Linux Mac
Insert footnote at cursor Ctrl+Alt+N ⌘⌥N
Edit footnote (cursor on the anchor) Ctrl+Alt+E ⌘⌥E
Save note (and return to the text) / cancel Ctrl+Enter / Esc ⌘Enter / Esc
Jump from anchor to its note, and back Ctrl+Alt+J ⌘⌥J
Next / previous footnote Ctrl+Alt+↓ / ↑ ⌘⌥↓ / ↑

Inserting places <anchor xml:id="XXX-n1"/> at the cursor, where XXX is the xml:id of the nearest enclosing element, and opens the Footnote pane at the bottom of the window. Saving writes

<standOff corresp="#XXX" type="Note">
    <note xml:lang="en" target="#XXX-n1">Text of the note.</note>
</standOff>

after </text> and before </TEI>. Further notes in the same passage become -n2, -n3 … Cancelling a new note removes its anchor; deleting the last note in a <standOff> removes the <standOff>.

Note types. The pane’s type list sets the <standOff>’s @type: Note, Emendation, Testimonia, or Custom… (any single word, e.g. Parallel). Each type gets its own <standOff> per passage, so one verse can have type="Note", type="Emendation" and type="Testimonia" blocks side by side. All types share one -nN sequence, so ids never clash. Changing the type of a saved note moves it to the right block (creating or removing blocks as needed). New notes start with the type you used last. Blocks are ordered by passage, then by type. On screen, notes are numbered separately per type: ¹ ² for Note, ᵉ¹ for Emendation, ᵗ¹ for Testimonia. The list of types is in Settings → TEI Scholar → Footnotes: Stand Off Types.

TEI help and validation

Fonts and scripts

Click the font name in the status bar (or TEI: Choose Font Profile) to switch profiles: Markup (monospace), IAST reading, Devanagari, Tibetan, South Indian scripts, or a custom font. Profiles apply to XML files only and to the footnote pane. Each is a fallback list, so a Latin font handles IAST and a Devanagari font handles Devanagari in the same line. Edit the list under Settings → TEI Scholar → Font Profiles.

Recommended free fonts: Noto Serif Devanagari and Noto Sans Mono (fonts.google.com/noto), Gentium Plus and Charis SIL (software.sil.org).

Transliteration (select text, right-click → TEI): IAST → Devanagari, Devanagari → IAST, Harvard-Kyoto → IAST, Velthuis → IAST. Tags and entity references inside the selection are left alone.

Notes