Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

The New Printer

Reading on paper just feels better. It's slow. It's embedded in the physical. It invites raw notes.

The New Printer is a web app that turns any article URL into a clean, print-ready layout β€” no account, no install, no PDF export. Just open, paste, and print from your browser.

Live at thenewprinter.vercel.app

How it works

  1. Paste an article URL on the home page
  2. Choose 2 or 3 columns
  3. Adjust column breaks by dragging handles on the print layout
  4. Hit Print

The app fetches the article server-side, strips away clutter with Readability, and runs a custom text layout engine to fill columns with correctly-wrapped lines before any paint happens.

Stack

  • Next.js 16 (App Router, server components)
  • @chenglou/pretext β€” font-aware text segmentation used by the layout engine
  • @mozilla/readability β€” article extraction
  • sanitize-html β€” server-side HTML sanitization
  • linkedom β€” lightweight DOM for server-side parsing
  • Tailwind CSS v4
  • Deployed on Vercel

Project structure

thenewprinter/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx            # Home β€” URL input form
β”‚   β”œβ”€β”€ print/page.tsx      # Print view (server component)
β”‚   └── api/extract/        # Article extraction API
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ PrintLayout.tsx     # Full print canvas
β”‚   β”œβ”€β”€ Column.tsx          # Single column renderer
β”‚   β”œβ”€β”€ ColumnBreakHandle.tsx  # Draggable break points
β”‚   β”œβ”€β”€ ArticleBlock.tsx    # Block-level renderer
β”‚   └── UrlForm.tsx         # Home form
└── lib/
    β”œβ”€β”€ extract.ts          # Fetch + Readability + sanitize
    β”œβ”€β”€ parse-blocks.ts     # HTML β†’ typed block tree
    β”œβ”€β”€ layout-engine.ts    # Column layout (line-level)
    └── types.ts

Development

cd thenewprinter
npm install
npm run dev

Open http://localhost:3000.

Contributing

Contributions are welcome. Fork the repo, create a branch, open a PR.


The New Printer β€” because sometimes the best way to read online is offline.

About

The New Printer - Because sometimes the best way to read online is offline.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages