The .tint package
What is inside the file someone sends you when they share a project. The archive layout, how to recognise it, and what a round trip through it keeps.
A project on disk is a folder. A .tint is that same folder
packed into a single file, which is what people actually send each other when they share a
manuscript. It is also what third party cloud sync moves around, so a project living in Drive
or OneDrive is a .tint going up and down whole.
The good news, if you have one in front of you: it is a zip. Rename it, unzip it, and everything inside is plain JSON except the images.
Recognising one
The importer sniffs the first two bytes and accepts two containers, which is not obvious and is the sort of thing you get wrong once:
ZIP0x50 0x4BGZIP0x1F 0x8BA plain zip, or a zip that has been gzipped. If neither signature matches, the importer still
tries both before giving up, so a .tint with the wrong bytes at the front can still open.
Anything Tintero itself writes is a plain zip, deflated at level 9.
What is inside
project.jsonthe whole manifest, pretty printedfiles/read back on importdocs/read back on importnotes/read back on importimages/read back on importfiles/snapshots/read back on importA .tint that third party cloud sync uploaded can also carry a sync-lineage.txt at the
top, next to project.json. It is Tintero’s record of which synced states this copy descends
from, one line per state, kept out of the manifest on purpose. A file exported by hand does
not have it, and you can ignore it when reading one.
Three differences from the folder on disk, and all three matter:
- The manifest is called
project.json, not<id>.tintero. A scanner looking for*.tinterowill not find it. - Content files have no extension. Inside
files/an entry is named by its bare id, with no.jsonon the end, although the contents are the same ProseMirror JSON. - Chapters, docs and notes are separated into folders of their own, where on disk they all
share one flat
files/. On import they are flattened back together.
Audio and PDFs are not in a .tint at all. Send someone a project with narrations attached
and they get the project without them.
What a round trip keeps
Export a project and import it again and you get back its chapters, docs, notes, snapshots and images. The two gaps are smaller than they look:
- Audio and PDFs never went into the archive, as above, so they do not come back.
- Images are only written where nothing is there yet. Each image is restored under the
name the manifest gives it, as
images/<name>. Tintero’s image store is shared between projects (on the desktop it is usually one folder for every project in the same root), so if an image with that name already exists, the importer keeps the one that was there and lists it among the import warnings instead of overwriting it.
Reading one yourself
Nothing here needs Tintero. Unzip it, parse project.json against the
project format reference, and read each entry’s text from
files/<location>, docs/<location> or notes/<location> as
ProseMirror JSON.
import { readFile } from 'node:fs/promises';
import AdmZip from 'adm-zip';
const zip = new AdmZip(await readFile('Manuscript.tint'));
const project = JSON.parse(zip.readAsText('project.json'));
for (const file of project.files) {
const entry = zip.getEntry(`files/${file.location}`);
const document = entry ? JSON.parse(zip.readAsText(entry)) : null;
console.log(file.name, document?.content?.length ?? 0, 'top-level nodes');
}
The one thing to be careful about is what you write back. A project rebuilt by hand and imported goes through the app’s allow list, and anything not on it is dropped without a word.