Skip to content

adegard/terminal_text_browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 

Repository files navigation

TERMINAL TEXT BROWSER

Text Web browser in terminal (also termux) in python. Perfect for small screen devices and reading like a book online with bookmarking exact page and last paragraph position (called block)

       _.-''''''-._
    .-'  _     _   '-.
  .'    (_)   (_)     '.
 /      .-'''-.         \
|     .'       `.        |
|    /  .---.    \       |
|    |  /   \ |   |      |
 \   \  \___/ /   /     /
  '.  '._   _.'  .'     /
    '-._'''''_.-'     .'
         '-.....-'

Terminal Text Browser — Features Overview

🏠 Home Screen

  • Accepts:
    • Direct URLs (https://example.com)
    • Domain shortcuts (example.com)
    • Search queries (sent to DuckDuckGo Lite, check other provider in settings)
    • Ask AI in terminal
  • Commands:
    • bm — open bookmark manager
    • ai your_question — ask ai (put groq api key in settings first)
    • q — quit the application
    • s — settings

🔍 Search

  • Uses DuckDuckGo Lite for lightweight HTML results
  • Displays:
    • Result title
    • Cleaned URL (tracking removed)
  • Commands:
    • <number> — open selected result
    • bm — open bookmark manager
    • h — return to home
    • q — quit

📄 Page View

Text Mode

  • Extracts main readable content from the page
  • Cleans paragraphs and wraps them to terminal width
  • Pagination by paragraph blocks
  • Commands:
    • SPACE/↓ — next block
    • p/↑ — previous block
    • l — switch to link mode
    • b — go back on search results
    • m — save current page and block as bookmark
    • bm — open bookmark manager
    • h — home
    • q — quit

Link Mode

  • Lists all extracted links from the page
  • Paginated in groups of 20
  • Commands:
    • <number> — open selected link
    • ENTER — next link page
    • p — previous link page
    • t — return to text mode
    • b — go back in history
    • i — show main image in terminal (block-colors)
    • bm — open bookmark manager
    • h — home
    • q — quit

🔖 Bookmark Manager

  • Stores bookmarks in ~/.tbrowser_bookmarks
  • Features:
    • List all saved URLs, with last read block
    • Open a bookmark
    • Delete a bookmark (d<number>)
  • Commands:
    • <number> — open bookmark, at last read block
    • d<number> — delete bookmark
    • q — return to previous screen

🌐 URL Handling

  • Normalizes user input into valid URLs
  • Removes DuckDuckGo tracking parameters
  • Unwraps redirect links
  • Filters ads and trackers (Safe Mode)

🧭 Navigation History

  • Maintains a stack of visited pages
  • b returns to the previous page
  • History is session‑local (not saved to disk)

🧹 Content Extraction

  • Removes:
    • Scripts
    • Styles
    • Headers/footers/navbars
  • Detects main content block by size
  • Incremental pagination (tested on Wattpad, with url change while scrolling eg. /page/2 ..etc)
  • Extracts:
    • Paragraphs
    • List items
    • Links

About

web browser in terminal (also termux) in python

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages