Skip to content

Commit ed2d968

Browse files
committed
feat: {{Linux:}} tag — full Debian Linux terminal via WebVM
- New {{Linux:}} markdown tag with Packages: field for package badges - Opens WebVM (webvm.io) in a new browser window with full keyboard support - Toolbar 🐧 Terminal button inserts tag template - Card shows running status and Focus/Launch button - Persistent sessions via IndexedDB across page reloads New files: - js/linux-docgen.js — parsing, transform, bind, and launch logic - css/linux-terminal.css — card, badge, status, button styles - CHANGELOG-linux-terminal.md Modified: - renderer.js — transform chain + DOMPurify whitelist - main.js — CSS + module imports - index.html — CSP frame-src + toolbar button - help-mode.js — help entry - templates/coding.js — Linux Terminal template - templates/documentation.js — Feature Showcase updated - README.md — features table, technologies, release notes
1 parent 5e58c00 commit ed2d968

10 files changed

Lines changed: 439 additions & 3 deletions

File tree

CHANGELOG-linux-terminal.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CHANGELOG — Linux Terminal Tag
2+
3+
## 2026-03-08
4+
5+
### Added
6+
- **`{{Linux:}}` tag** — new markdown tag that opens a full Debian Linux terminal (WebVM) in a new browser window
7+
- `Packages:` field for specifying packages to install, rendered as visual package badges
8+
- Toolbar 🐧 Terminal button inserts the tag template
9+
- Card renders with launch/focus button and running status indicator
10+
- WebVM opens in a centered popup window with full keyboard support
11+
- Session persistence via IndexedDB across page reloads
12+
13+
### New Files
14+
- `js/linux-docgen.js` — Core component: parsing, transformation, binding, and launch logic
15+
- `css/linux-terminal.css` — Card, badge, status, and toolbar button styles
16+
17+
### Modified Files
18+
- `js/renderer.js` — Added `transformLinuxMarkdown` to transform chain and `bindLinuxPreviewActions` to post-render actions; updated DOMPurify whitelist for `data-linux-index`
19+
- `src/main.js` — CSS import (`linux-terminal.css`) and dynamic module import (`linux-docgen.js`)
20+
- `index.html` — CSP `frame-src` updated for `webvm.io`; toolbar 🐧 Terminal button added
21+
- `js/help-mode.js` — Help entry for Linux Terminal toolbar button
22+
- `js/templates/coding.js` — Linux Terminal coding template
23+
- `js/templates/documentation.js` — Feature Showcase updated with Linux Terminal
24+
- `README.md` — Features table, technologies, and release notes updated

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
| **🔌 API Calls** | `{{API:}}` REST API integration — GET/POST/PUT/DELETE methods, custom headers, JSON body, response stored in `$(api_varName)` variables; inline review panel; toolbar GET/POST buttons |
3939
| **🔗 Agent Flow** | `{{Agent:}}` multi-step pipeline — define Step 1/2/3, chain outputs, per-card model + search provider selector, live step status indicators (⏳/✅/❌), review combined output |
4040
| **🔍 Web Search** | Toggle web search for AI — DuckDuckGo (free), Brave Search, Serper.dev; search results injected into LLM context; source citations in responses; per-agent-card search provider selector |
41+
| **🐧 Linux Terminal** | `{{Linux:}}` tag opens a full Debian Linux terminal ([WebVM](https://webvm.io)) in a new window — `Packages:` field for install reminders; package badges; toolbar 🐧 Terminal button; persistent sessions via IndexedDB |
4142
| **❓ Help Mode** | Interactive learning mode — click ❓ Help to highlight all buttons, click any button for description + keyboard shortcut + animated demo video; 50% screen demo panel with fullscreen expand; 16 dedicated demo videos mapped to every toolbar button |
4243
| **Extras** | Auto-save (localStorage + cloud), table of contents, image paste, 96+ templates (12 categories: AI, Agents, Coding, Maths, PPT, Quiz, Tables, Documentation, Project, Technical, Creative, Financial), template variable substitution (`$(varName)` with auto-detect), table spreadsheet tools (sort, filter, stats, chart, add row/col, inline cell edit, CSV/MD export), content statistics, modular codebase (13+ JS modules), fully responsive mobile UI with scrollable Quick Action Bar (Files, Search, TOC, Share, Copy, Tools, AI, Model, Upload, Help) and formatting toolbar, multi-file workspace sidebar, compact header mode with collapsible Tools dropdown (Presentation, Zen, Word Wrap, Focus, Voice, Dark Mode, Preview Theme) |
4344

@@ -337,6 +338,7 @@ Headings · **Bold** · *Italic* · ~~Strikethrough~~ · Links · Images · Orde
337338
| [just-bash](https://justbash.dev/) | In-browser bash execution |
338339
| [Pyodide](https://pyodide.org/) | In-browser Python (CPython via WASM) |
339340
| [sql.js](https://sql.js.org/) | In-browser SQLite (WASM) |
341+
| [WebVM](https://webvm.io) | Full Debian Linux terminal (CheerpX x86 emulation) |
340342

341343
## 🤝 Contributing
342344

@@ -360,6 +362,7 @@ TextAgent has undergone significant evolution since its inception. What started
360362

361363
| Date | Feature / Update |
362364
|------|-----------------|
365+
| **2026-03-08** | 🐧 **Linux Terminal** — new `{{Linux:}}` tag opens a full Debian Linux terminal ([WebVM](https://webvm.io)) in a new browser window; `Packages:` field for package reminders with visual badges; persistent sessions via IndexedDB; toolbar 🐧 Terminal button; Linux Terminal coding template; fully independent module (`linux-docgen.js`) |
363366
| **2026-03-08** | 🔌 **API Component** — new standalone `{{API:}}` tag for REST API calls directly in markdown; supports GET/POST/PUT/DELETE methods, custom headers, JSON body, and `Variable:` to store response in `$(api_varName)`; toolbar GET/POST buttons insert templates; API cards render inline with method badge + URL; execute with ▶ button, review response with Accept/Regenerate/Reject; response variables accessible via ⚡ Vars table; fully independent module (`api-docgen.js`) separated from AI component |
364367
| **2026-03-08** | 🏷️ **Template display tags** — AI templates now show `AI` flavor tags; agent templates show `AI · Agent` tags on template cards for quick visual identification of template type |
365368
| **2026-03-08** | 📜 **MIT License** — changed project license from Apache 2.0 to MIT for broader compatibility and simpler terms |

css/linux-terminal.css

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/* ============================================
2+
linux-terminal.css — {{Linux:}} tag styles
3+
============================================ */
4+
5+
/* --- Terminal Card --- */
6+
.linux-terminal-card {
7+
border-color: var(--linux-accent, #22c55e) !important;
8+
}
9+
10+
.linux-terminal-card .ai-placeholder-icon {
11+
font-size: 1.3rem;
12+
}
13+
14+
.linux-terminal-card .ai-placeholder-header {
15+
background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
16+
}
17+
18+
/* --- Package badges --- */
19+
.linux-packages {
20+
display: flex;
21+
flex-wrap: wrap;
22+
gap: 6px;
23+
padding: 8px 14px 10px;
24+
border-top: 1px solid var(--border-color, rgba(125, 133, 144, 0.2));
25+
}
26+
27+
.linux-pkg-badge {
28+
display: inline-flex;
29+
align-items: center;
30+
padding: 2px 10px;
31+
font-size: 0.75rem;
32+
font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
33+
border-radius: 12px;
34+
background: rgba(34, 197, 94, 0.1);
35+
color: #22c55e;
36+
border: 1px solid rgba(34, 197, 94, 0.25);
37+
letter-spacing: 0.01em;
38+
}
39+
40+
[data-theme="light"] .linux-pkg-badge {
41+
background: rgba(34, 197, 94, 0.08);
42+
color: #15803d;
43+
border-color: rgba(34, 197, 94, 0.3);
44+
}
45+
46+
/* --- Status indicator --- */
47+
.linux-status-running {
48+
color: #22c55e;
49+
font-size: 0.7rem;
50+
font-weight: 600;
51+
margin-left: 8px;
52+
animation: linux-pulse 1.5s ease-in-out infinite;
53+
}
54+
55+
@keyframes linux-pulse {
56+
57+
0%,
58+
100% {
59+
opacity: 1;
60+
}
61+
62+
50% {
63+
opacity: 0.4;
64+
}
65+
}
66+
67+
/* --- Info text --- */
68+
.linux-info {
69+
padding: 6px 14px 8px;
70+
border-top: 1px solid var(--border-color, rgba(125, 133, 144, 0.2));
71+
color: #8b949e;
72+
font-size: 0.75rem;
73+
}
74+
75+
/* --- Launch button --- */
76+
.linux-launch {
77+
background: rgba(34, 197, 94, 0.12) !important;
78+
color: #22c55e !important;
79+
border: 1px solid rgba(34, 197, 94, 0.3) !important;
80+
font-weight: 600;
81+
padding: 3px 12px !important;
82+
border-radius: 6px !important;
83+
font-size: 0.78rem !important;
84+
transition: all 0.2s ease;
85+
}
86+
87+
.linux-launch:hover {
88+
background: rgba(34, 197, 94, 0.25) !important;
89+
transform: translateY(-1px);
90+
}
91+
92+
/* --- Toolbar button --- */
93+
.fmt-linux-btn {
94+
color: #22c55e !important;
95+
font-weight: 700;
96+
font-size: 0.7rem !important;
97+
}
98+
99+
.fmt-linux-btn:hover {
100+
background: rgba(34, 197, 94, 0.15) !important;
101+
}

index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
font-src 'self' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net;
2828
worker-src 'self' blob:;
2929
child-src 'self' blob:;
30-
frame-src 'self' blob:;
30+
frame-src 'self' blob: https://webvm.io;
3131
object-src 'none';
3232
base-uri 'self';
3333
">
@@ -621,6 +621,12 @@ <h5>Menu</h5>
621621
title="Insert POST API call">POST</button>
622622
</div>
623623
<span class="fmt-separator"></span>
624+
<div class="fmt-linux-group" title="Linux Terminal">
625+
<span class="fmt-api-group-label" style="color:#22c55e">Linux</span>
626+
<button class="fmt-btn fmt-linux-btn" data-action="linux-tag" title="Insert Linux Terminal tag">🐧
627+
Terminal</button>
628+
</div>
629+
<span class="fmt-separator"></span>
624630
<button class="fmt-btn fmt-vars-btn" id="apply-vars-btn"
625631
title="Apply Variables — replace all $(varName) placeholders">
626632
<i class="bi bi-braces-asterisk"></i> <span>Vars</span>

js/help-mode.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@
253253
shortcut: null,
254254
demo: 'assets/demos/15_ai_doc_tags.webp'
255255
},
256+
'[data-action="linux-tag"]': {
257+
name: 'Linux Terminal Tag',
258+
desc: 'Insert a {{Linux:}} block that embeds a full Debian Linux terminal (WebVM) in your document. Specify packages to auto-install — e.g. Packages: curl, vim, htop.',
259+
shortcut: null,
260+
demo: 'assets/demos/15_ai_doc_tags.webp'
261+
},
256262
'#docgen-fill-btn': {
257263
name: 'Fill All AI Blocks',
258264
desc: 'Process all {{AI:}}, {{Think:}}, {{Image:}}, {{Agent:}}, and {{API:}} tags in the document. Each block generates independently and can be accepted, rejected, or regenerated.',

0 commit comments

Comments
 (0)