Skip to main content

A tiny local web app for highlighting and commenting on plain text files.

Project description

txthighlight

A tiny local web app for highlighting and commenting on plain text files.

Installation

pip install txthighlight

Usage

Run it like this:

txthighlight --host 0.0.0.0 --port 8080 somefile.txt

Then open:

http://0.0.0.0:8080

Highlight metadata is stored next to the source file in:

somefile.txt.json

What it does

  • renders a plain text file in the browser
  • lets you select text and highlight it
  • lets you add comments to highlights
  • lets you remove highlights
  • stores annotation data locally in a JSON sidecar file
  • works with desktop and mobile browsers

Why this exists

There are many tools for annotating PDFs, rich text documents, and web pages. There are very few simple tools for annotating a raw local text file.

Plain text is still a common working format for:

  • transcripts
  • logs
  • OCR output
  • legal or policy text
  • prompt corpora
  • research notes
  • interview notes
  • exported chat histories

This project fills that narrow gap: plain text in, annotations in a nearby JSON file, no database required.

The niche

This tool lives in an awkward but useful niche.

Most annotation tools assume one of these:

  • HTML pages annotated by a browser extension
  • rich text documents like Word or Google Docs
  • PDF with built-in annotation support
  • note-taking apps with their own storage format

But sometimes you do not want any of that. Sometimes you have a .txt file and want to keep working with a .txt file.

Data format

Annotations are stored in <text-file>.json.

Example:

{
  "source_file": "/path/to/somefile.txt",
  "annotations": [
    {
      "id": "3d7278a2-6d67-4e1c-a0c8-4a0a7d3b0e40",
      "start": 12,
      "end": 42,
      "comment": "Important passage",
      "created_at": 1713350000,
      "updated_at": 1713350123
    }
  ]
}

Offsets are character offsets into the text file as loaded by the app.

Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

txthighlight-0.1.0a1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

txthighlight-0.1.0a1-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file txthighlight-0.1.0a1.tar.gz.

File metadata

  • Download URL: txthighlight-0.1.0a1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for txthighlight-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 8a32aa495b39d360e8278c4a006c62133e8c70c194a7fc443f9372ca279ef99b
MD5 dcc4f20b18f81e7d6534228f17394679
BLAKE2b-256 3c7a71cb2e0f79a8d8353fb483946ba29e8ac8c735809092f60e03bce361c721

See more details on using hashes here.

File details

Details for the file txthighlight-0.1.0a1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for txthighlight-0.1.0a1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8f6eb44c6febee2490e1eef5913cc524b979e7456566abfb2a6c7ec626945dcd
MD5 4f659e593c52f47185a8cdf073f9cdd9
BLAKE2b-256 6754457ee369d7712e436f5abcf86d69a1111ac7f60d68e2956b98b2d9d08c7f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page