Nariman Jelveh 6598d798ea feat(thumbnails): JavaScript, CSS and Markdown files get a thumbnail (#4693)
* feat(thumbnails): JavaScript, CSS and Markdown files get a thumbnail

The desktop draws the start of a .js, .mjs, .cjs or .css file in a
fixed-width font with its tokens colored, and a .md or .markdown file as
the page it describes: headings, paragraphs, lists, quotes, code and
tables. Both go through the page drawer the Word readers use, which now
takes a font family per run and paragraphs that don't wrap.

Only the first 16 KiB of these files is read. The dashboard downloads
only that much when it makes a thumbnail for one that has none, so the
file size limit doesn't apply to them. An upload draws them one at a
time for at most 2 seconds; the rest keep their icon until the
dashboard shows them.

* fix(thumbnails): a <br> in Markdown breaks the line instead of joining the words around it

* fix(thumbnails): HTML headings and centered blocks in a README are drawn as GitHub shows them

An <h1> after other HTML lines was drawn as body text, joined to the lines
before it, and a block's align was ignored. HTML block tags now start and end
a block of their own, and align="center" or "right" on them, or a <center>,
is kept.

* fix(thumbnails): code fenced inside a Markdown list item is drawn as code

A fence indented four spaces under a list item was read as paragraph text,
so its backticks and lines were drawn joined on one line. A fence at any
indent now starts code, drawn under the item it belongs to without the
fence's indent.

* fix(thumbnails): every row of a Markdown table keeps the header's columns

A row with fewer or more cells than the header split the page's width its
own way, so its cells sat under the wrong headings. Rows now take the
header's columns, an escaped bar stays in its cell, and each column is
aligned as the row under the header says.

* fix(thumbnails): text after a Markdown table is spaced from it as from a paragraph

The line after a table sat as close to its last row as the rows sit to each
other, so it read as another row.

* fix(thumbnails): an empty Markdown heading draws nothing instead of a #

* fix(thumbnails): a Markdown task list shows boxes instead of [ ] and [x]

* fix(thumbnails): a GitHub alert in Markdown shows its title instead of [!NOTE]

* fix(thumbnails): the dashboard asks for only the first 16 KiB of a text file, whatever its listed size

A source or Markdown file listed at 16 KiB or less was downloaded whole, so
one that had grown since it was listed was fetched up to the 20 MiB cap to
read its start.

* fix(thumbnails): an HTML comment inside Markdown code is drawn as code

Comments were removed from the whole file before it was read, so a code
sample lost the <!-- file name --> comment it opens with, and an unclosed
<!-- in a code sample hid the rest of the document. Comments are now
left out only outside code.
2026-11-18 19:59:25 -07:00
…
…
…
…
…

Puter.com, The Personal Cloud Computer: All your files, apps, and games in one place accessible from anywhere at any time.

The Open-Source Internet Computer!

« LIVE DEMO »

Puter.com · App Store · AI Builder · Developers · X

screenshot


Puter

Puter is an advanced, open-source, self-hostable internet computer designed to be feature-rich, fast, and highly extensible.

For Users

Puter's goal is to provide you with every app and feature you need to work, create, and play under one roof. From a simple Notepad and Voice Recorder to Spreadsheet and Camera, Puter wants to be the all-in-one solution for your digital life.

For Developers

Puter provides everything you need to build and publish web apps and games. From AI to Cloud Storage and Database to Serverless Workers, Puter has you covered. Puter also helps you get users! Once you build your app, you can publish it on our App Store to reach and monetize users.


Getting Started

💻 Local Development

git clone https://github.com/HeyPuter/puter
cd puter
npm install
npm start

→ This should launch Puter at http://puter.localhost:4100

To run this checkout with Docker, follow Building from source. Create a local docker-compose.override.yml to select the local build; keeping these settings out of docker-compose.yml avoids conflicts when pulling updates and keeps local configuration out of pull requests.


🚀 Self-Hosting

Linux/macOS

curl -fsSL https://puter.com/selfhost | sh

Windows

irm https://puter.com/selfhost?os=windows | iex

→ For more details, see Self-Hosting Puter.


☁️ Puter.com

Puter is available as a hosted service at puter.com.


Support

Connect with the maintainers and community through these channels:

We are always happy to help you with any questions you may have. Don't hesitate to ask!


License

This repository, including all its contents, sub-projects, modules, and components, is licensed under AGPL-3.0 unless explicitly stated otherwise. Third-party libraries included in this repository may be subject to their own licenses.


Translations

Languages
TypeScript 62.3%
JavaScript 34.9%
CSS 1.6%
HTML 1.1%