New to Saktumiva, TEI or GitHub? Start with the tutorial.
A local editing screen for critical editions in TEI, collated with Charles Li’s Saktumiva v.2. Saktumiva’s own collation code runs in the background; your decisions are written straight back into the TEI files. Everything runs on your own computer. The only outside traffic is your browser fetching manuscript images from the archives’ IIIF servers, and “Check for updates” asking GitHub for the latest release.
It was written for the Suśrutasaṃhitā and works for any project laid out as folders of TEI files, for example the Rasendramaṅgala.
Ready-made program (no Python needed): download the file for your computer from the
latest release, unzip it and run
saktumiva-editor (saktumiva-editor.exe on Windows). A terminal window opens, and the editor
opens in your web browser. Close the terminal window, or press Ctrl+C in it, to stop.
xattr -d com.apple.quarantine saktumiva-editor in a terminal. It is built for Apple
silicon (M1 and later); on an Intel Mac, install it with Python (below).With Python (3.10 or later; for Intel Macs, or if you prefer), in its own virtual environment:
python3 -m venv ~/saktumiva-editor-env
~/saktumiva-editor-env/bin/pip install git+https://github.com/sushrutaproject/saktumiva2-editor.git
Then run ~/saktumiva-editor-env/bin/saktumiva-editor in a terminal.
Updating: Help → Check for updates in the editor (or saktumiva-editor --check-updates)
tells you whether there is a newer release and gives the command or download link for the way you installed it.
saktumiva-editor # choose a project; recently used ones are listed
saktumiva-editor ~/git/Rasendramangala # choose one of the project's sections
saktumiva-editor ~/git/Sushrutasamhita_Saktumiva2/03-su.sa # edit that section straight away
Options: --port 8800 (the next free port is used if it is taken), --no-browser, --version.
The Projects button in the editor goes back to the chooser.
A section is one folder with an edition file and the witness transcriptions collated with it.
The files are TEI XML; their names may end in .xml, .txt or .tei (the editor looks inside to
see whether a file is TEI). A project is a folder of sections, for example a git repository with
one folder per chapter. Without further instructions, any folder (the project folder itself, or one
level below it) with an editor.config.json, a saktumiva.config.json or at least two TEI files is
offered as a section.
The first time you open a section, the editor proposes which file is the edition (a name containing
“edition”) and which are the witnesses (the other TEI files; files that already contain a Saktumiva
apparatus are taken to be published output, not witnesses). Check the proposal, change it if
needed, and it is saved as editor.config.json in the section folder:
<edition>_with-apparatus.xml).alignments), settingsFrom (an alignment file whose collation settings are used),
collation, apparatus, extraIgnoreTags, scriptNoteRules: see Settings below.<?xml-stylesheet?> and the XSLT polyfill script put at the
top of the published file (both are used only if the section has an edition.xsl).SS. or ch1.).A project may have a saktumiva-project.json in its top folder. Every key is optional:
{
"name": "Rasendramaṅgala",
"sections": ["chapter*", "commentary"],
"fileExtensions": [".xml", ".txt"],
"editionPattern": "provisional[-_]edition",
"defaults": {"extraIgnoreTags": ["trailer"], "apparatus": {"normlem": true, "mergerdgs": true}}
}
sections lists the section folders (patterns allowed); editionPattern is a regular expression for
recognising the edition file; defaults are settings for every section, which a section’s own
editor.config.json can override.
If the section is in a git repository, every save and every Publish is a git commit. Nothing goes
online until you push. Work cycle: edit → Publish → check the published file → git push.
lg, p and l with an xml:id. A dot marks unsaved changes.xml:id, as continuous text; the
apparatus, the notes and the witnesses’ texts are grouped under each passage’s id. Passages that must be
collated are collated in the background, each showing its progress, and appear as each is ready. use /
omit and editing an existing note work here too; for everything else (Edit text, TEI source, Add note,
Correct alignment, a witness’s edit) click a passage’s id to open it alone, or press Show one passage
(or Esc). A plain click in the list shows one passage as before. The choice is remembered for the browser session.xml:id of the first, in the edition and in every witness file (only the tags between them
are removed). Split…, with one passage shown, divides it in two: click in the edition’s text where the
second passage begins; each witness is marked at the matching place, going by the alignment, for you to check
and move; then give the two parts their ids. Notes follow their passage. Both are saved straight away to all the
files as one git commit (save your other changes first), each file’s text is checked to be letter for letter
what it was, and the passages are collated afresh. Ctrl+Z does not undo them: revert the commit in git.<anchor> and the <standOff> note are
created together with matching ids (SS.3.1.4-n1, -n2 …). Edit or delete notes in the Notes panel.alignments/<passage>.xml
(marked in its header as corrected by hand) with a git commit, and the editor uses that file from
then on. No witness’s text can be changed here, and every column keeps some text of the edition.<stemma format="nexml"> of the edition’s
teiHeader (in <xenoData>, as SplitsTree6 or Saktumiva write it) as a stemma codicum, sigla at the leaves.
Branch lengths in proportion (with a scale bar) or one step per generation; straight or right-angled lines;
a list when there are several stemmata or trees; Download SVG saves the drawing. Pointing at a branch gives
its length, at a siglum the witness. A stemma inside an XML comment is not read (the dialog says so).<edition>_with-apparatus.xml in the section folder (set "publishTo" in editor.config.json to change
it). It is your edition file exactly as written, plus the stylesheet header, the witnesses in <listWit>
and, after </text>, one <standOff type="apparatus"> per passage, made by Saktumiva’s own code exactly as
its command-line apparatus tool does. Corrected alignments are used as they are; the rest are collated if
needed (slow the first time for long prose passages; cached afterwards). Alignment files are brought up to
date and everything is one git commit. Passages without an apparatus are listed at the end.editor.config.json.
ś=s, ṇ=n.<scriptNote xml:id="…"> entries in each witness’s <scriptDesc>
apply to that witness only. script-X-Y (script-ba-va, script-śa-sa, script-na-ṇa …) makes X and Y the
same letter; svarna-nasals (or savarna-nasals) treats anusvāra and the nasal of the same class, and final
m and ṃ, as the same. Other notes can be given a rule in editor.config.json, e.g.
"scriptNoteRules": {"script-ya-ja": "y=j"}. The Settings screen lists what it found in each witness.<text> in your files, with counts; anything else can be typed in.alignments/, and makes a git commit
listing your edits. Undo (Ctrl+Z) works until you save; after that, use git (History button).Safety checks on every save: the file must not have been changed on disk meanwhile (e.g. in Oxygen),
the result must be well-formed XML, and xml:ids must stay unique. New notes that point nowhere
are reported before saving.
xml:ids).Recent projects and computed alignments (so that each passage is collated only once) are kept outside
your projects: on Linux in ~/.config/saktumiva-editor and ~/.cache/saktumiva-editor, on macOS in
~/Library/Application Support/saktumiva-editor and ~/Library/Caches/saktumiva-editor, on Windows in
%APPDATA%\saktumiva-editor and %LOCALAPPDATA%\saktumiva-editor\Cache. The cache is safe to delete.
git clone --recurse-submodules https://github.com/sushrutaproject/saktumiva2-editor.git
cd saktumiva-editor
python -m pip install -e ".[test]"
saktumiva-editor
src/saktumiva_editor/server.py: the local server (Python standard library only); cli.py, project.py
(sections, configuration, recent projects), updates.py (GitHub Releases).src/saktumiva_editor/app/: the editing screen (index.html, main.mjs …) and the project chooser (chooser.*).
multi.mjs chooses several passages from clicks in the list. restructure.mjs merges and splits passages in one file’s text. nexus.mjs makes the NEXUS matrix from alignment files; stemma.mjs reads and draws the stemmata; it needs no other file and returns plain SVG, so it can be used on a web page as well.src/saktumiva_editor/app/saktumiva/: Saktumiva, as a git submodule pinned to one commit of
chchch/saktumiva. Only its lib/ and the OpenSeadragon image viewer are
served and packaged.src/saktumiva_editor/saktumiva-patches.json: the one change the editor needs in Saktumiva’s code (a hook in
lib/apparatus.mjs through which the editor applies per-witness script notes and the extra “same letters” when
deciding whether a reading agrees with the lemma). It is applied in memory as the file is served, so the
submodule stays a clean copy of upstream.python -m pytest # the server, configuration, update check
cd tests/js && npm ci && npm test # the collation regression tests (Node 22)
The browser tests (tests/python/test_browser_several.py: choosing several passages, the combined apparatus,
going back to one passage; test_browser_restructure.py: merging and splitting passages, down to the files on disk) run with Playwright and are skipped without it:
python -m pip install -e ".[test,browser]" && python -m playwright install chromium (an installed Google Chrome
is used if Playwright’s own Chromium is missing).
The regression tests run the editor’s collation and apparatus code, with the pinned Saktumiva, on real sections
(tests/fixtures: the Suśrutasaṃhitā Śārīrasthāna and Rasendramaṅgala chapter 1) and compare the alignments,
apparatus and published <standOff> with the stored results in tests/golden. stemma.test.mjs tests the Stemma view
on the NeXML of SplitsTree6, Saktumiva and Bio::Phylo (tests/fixtures/stemma and the Rasendramaṅgala fixture);
nexus.test.mjs the NEXUS export (tests/fixtures/nexus), multi.test.mjs choosing several passages (app/multi.mjs), restructure.test.mjs merging and splitting passages (app/restructure.mjs). They also check that the patch
still fits and still matters (switching script notes off must change the apparatus of certain passages).
Dependabot proposes a pull request when Saktumiva has new commits; the tests run on it.
find in saktumiva-patches.json
(or drop the patch if Saktumiva now offers the hook itself). If the apparatus has changed and the change is an
improvement, run npm run update-golden in tests/js, review git diff tests/golden, and commit.By hand: cd src/saktumiva_editor/app/saktumiva && git fetch && git checkout <commit>, run the tests, commit.
__version__ in src/saktumiva_editor/__init__.py and add a section to CHANGELOG.md.git tag v0.2.0 && git push --follow-tags..github/workflows/release.yml then builds the wheel and the programs for Linux, macOS and Windows, checks that
each one starts, and publishes them as a GitHub Release, where Check for updates finds them.
The Saktumiva editor is free software under the GNU General Public License, version 3 (see LICENSE).
Saktumiva itself is a separate project with its own terms.
Saktumiva is by Charles Li (github.com/chchch/saktumiva); it does the
collation and makes the apparatus. The test fixtures come from the projects named in tests/fixtures/README.md;
the Rasendramaṅgala transcriptions are licensed CC BY-SA 4.0.