Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetra

An offline-capable browser built in Python. HTML is ingested into a JSON DOM bundle, page scripts are translated with Js2Py, and pages can be rendered in a Qt window or a terminal (TUI) viewer.

Features

  • Fetch or load HTML and serialize a DOM + scripts bundle (www2json.py)
  • Offline Qt renderer with navigation, bookmarks, history, and media helpers (json2qt.py)
  • Interactive terminal renderer with sixel image support (json2tui.py)
  • Online browser mode that combines ingest + Qt viewing (browser.py)
  • Local test server with mock search, uploads, and webmail for XHR demos

Requirements

  • Python 3
  • Dependencies listed in requirements.txt (PyQt5, Rich, Pillow, yt-dlp, and Js2Py-related packages)

Optional for the TUI image path: a terminal that supports sixel graphics.

Setup

make setup

This creates a .venv and installs dependencies from requirements.txt.

Quick start

# Build a bundle from the sample page and open it in Qt
make run-example

# Same page in the terminal viewer
make run-example-tui

# Fetch Google (basic HTML) and open in Qt
make run-google

Generated bundles and assets live under /tmp/offline-browser/.

Common commands

Command Description
make setup Create venv and install dependencies
make test Run the full automatic test suite
make parse-example Build DOM.json from example.html
make parse-lenna Build Lenna.json (fetches Wikipedia if needed)
make run-example Open the example page in the Qt viewer
make run-google Open Google in the Qt viewer
make serve Start the localhost test webserver (port 8765)
make run-mock-search-viewer Qt viewer against the mock search home
make run-browser Combined online browser with mock mail
make clean Remove generated files under /tmp/offline-browser

Run make help for the full list of targets.

Pipeline overview

  1. Ingestwww2json.py loads HTML (file or URL), translates scripts, and writes a JSON bundle.
  2. Render (Qt)json2qt.py reads a bundle (or fetches online) and displays it with PyQt5.
  3. Render (TUI)json2tui.py renders the same bundle in the terminal.
  4. Online browserbrowser.py wires ingest + Qt viewing and can host the mock mail server.

Tests

make test

Uses an offscreen Qt platform so GUI tests can run without a display.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages