A cyberpunk-themed terminal blog interface with integrated KaTeX support for rendering LaTeX articles from .tex files and Markdown support for .md files.
The system is built around a centralized FileSystemSync module. This module is responsible for managing a virtual filesystem, providing real-time updates for both development (using Vite's Hot Module Replacement) and production environments (by polling a filesystem.json manifest).
Key characteristics:
- Single Source of Truth: A single instance of
FileSystemSyncis created injs/main.jsand shared across all other modules that need filesystem access. - Shared Instance: Modules like
MarkdownArticleSystem,TexPaperSystem, andTerminalContentLoaderreceive theFileSystemSyncinstance in their constructors, ensuring they all work with the same data. - Efficiency: This approach avoids redundant filesystem scanning and state management, improving performance and ensuring data consistency.
This project uses Vite for development. The following npm scripts are available:
npm run dev: Starts the Vite development server. This is the standard command for running the application locally.npm run build: Builds the application for production.npm run dev:scripts: Runs the Vite development server with a special flag to execute development-time scripts, such as the filesystem manifest generator.
summer_trombone/
├── index.html # Main HTML file
├── README.md # This file
├── package.json # Project dependencies and scripts
├── vite.config.js # Vite configuration
├── css/
│ └── ... # Stylesheets
├── js/
│ ├── main.js # Main application entry point
│ └── modules/
│ ├── FileSystemSync.js # Centralized filesystem management
│ ├── MarkdownArticleSystem.js # Renders .md files
│ ├── TexPaperSystem.js # Renders .tex files
│ ├── TerminalContentLoader.js # Loads content into the terminal
│ └── ... # Other modules
└── blog/
├── posts/ # Markdown posts
└── papers/ # TeX papers
ES6 modules with clear separation of concerns:
- Manages the virtual filesystem.
- Provides real-time updates via Vite HMR in development.
- Polls a manifest file in production.
- Notifies other modules of file changes.
- Renders Markdown (
.md) files. - Uses the shared
FileSystemSyncinstance to access file content. - Supports various Markdown extensions like KaTeX, Mermaid diagrams, and more.
- Renders LaTeX (
.tex) files. - Uses the shared
FileSystemSyncinstance. - Provides KaTeX rendering for mathematical notation.
- Renders article summaries in the main terminal window.
- Uses the shared
FileSystemSyncinstance to get the list of articles.
- Manages draggable and resizable windows.
- Place
.mdfiles in theblog/posts/directory. - Place
.texfiles in theblog/papers/directory. - The system automatically detects and lists new files.
Ctrl/Cmd + 1-5: Switch between windowsCtrl/Cmd + ForF11: Toggle fullscreenCtrl/Cmd + M: Toggle matrix rain effectCtrl/Cmd + R: Refresh current windowEscape: Exit fullscreen or close modals
This project maintains the cyberpunk aesthetic while providing a professional, modular codebase suitable for academic and technical content presentation.