Skip to content

Repository files navigation

Slate 🪶⚡

The "VLC Media Player" of Code & Text Editors.
Ultra-lightweight, high-speed, portable text editor with zero external dependencies, universal file format decoding, live Markdown & LaTeX mathematics preview, table of contents generator, export suite, and native cross-platform bundles.

License: MIT Java 17+ Platform Speed


🌟 Why Slate?

Most modern text editors are built on multi-hundred-megabyte Electron runtimes that consume massive amounts of RAM and take seconds to launch. Slate takes the opposite approach:

  • Instant Launch: Starts up in milliseconds with asynchronous lazy parsing
  • Clean, crisp Light Theme aesthetic (Permanent default)
  • Zero external dependencies (Pure standard library)
  • Universal File Engine: Opens any file extension or binary without errors or crashing
  • Markdown & LaTeX Mathematics Live Preview: Instant background rendering supporting complex math formulas, tables, code blocks, and footnotes
  • Markdown Tools & Export Suite: Export standalone HTML, copy rendered HTML, generate Table of Contents, insert tables & formula templates
  • High-Performance Viewport-Only Gutter: Smooth 60+ FPS scrolling even on 100,000+ line documents
  • Self-Contained & Portable: Zero Java/JDK installation needed by end users when using native OS bundles

🚀 Key Features

1. Universal File Opening ("The VLC of Text Editors")

  • Multi-stage resilient decoding engine: UTF-8 $\to$ Windows-1252 $\to$ ISO-8859-1 $\to$ Lossless replacement fallback.
  • Opens .md, .markdown, .txt, .log, .env, .json, .csv, .py, .rs, .go, .java, .c, .cpp, .html, .xml, .sql, .sh, .yml, .ini, extensionless files, and unknown formats.
  • Binary & Hex Inspector: When opening binary files (.exe, .bin, .dat, .png), Slate seamlessly displays an organized side-by-side Hex Dump + ASCII view without hanging.

2. Markdown & LaTeX Math Live Preview (Ctrl + Shift + P)

  • LaTeX Math Engine:
    • Inline Math ($E = mc^2$) and Block Math ($$\int_0^1 x^2 \, dx = \frac{1}{3}$$).
    • Fractions (\frac{a}{b}), roots (\sqrt{x}, \sqrt[n]{x}), powers (x^2), subscripts (x_i), Greek alphabet ($\alpha, \beta, \gamma, \pi, \theta, \Omega, \Sigma$), and calculus/matrix operators.
  • Full Markdown Specification:
    • Headings (H1–H6 and underline headings), pipe tables with cell alignments, task lists (- [x], - [ ]), syntax badges on code blocks, footnotes, blockquotes, and safe HTML tags (<mark>, <kbd>, <sup>, <sub>, <center>).

3. Markdown Tool & Export Suite

  • Export to Rendered PDF (.pdf) (Ctrl + Shift + E): Generates clean, multi-page vector PDF documents directly with custom typography, math equations, code blocks, tables, headers, and footers (zero external dependencies).
  • Export to Standalone HTML (.html): Complete standalone HTML file with embedded styling and KaTeX math.
  • Export to Plain Text (.txt)
  • Copy Rendered HTML to Clipboard
  • Generate Table of Contents (Ctrl + Alt + T): Scans headings and inserts a linked TOC list at cursor.
  • Insert Helpers: Markdown Table (Ctrl + Shift + M), LaTeX Formula templates, Code blocks, Links/Images (Ctrl + K), and Checklists.

4. Syntax Highlighting

  • Built-in tokenizers for Java, Python, C / C++, JavaScript, TypeScript, HTML / XML, JSON, SQL, Shell Scripts, and Markdown.

5. Text & Developer Utilities

  • Line Tools: Sort Lines (Ascending, Descending, Case-Insensitive), Remove Duplicate Lines, Trim Trailing Whitespace (Ctrl + Shift + T), Delete Blank Lines, Join Lines, Reverse Lines.
  • Encoding & Crypto: Base64 Encode / Decode, URL Encode / Decode, Checksum Calculator (MD5, SHA-1, SHA-256 with 1-click copy).
  • Document Analysis: Deep Statistics (Ctrl + I) displaying line counts, word counts, character counts (with/without spaces), Unicode counts, byte sizes, and estimated reading times.
  • Smart Editing: Auto-indent on Enter, auto-pairing brackets & quotes () [] {} "" '', duplicate line (Ctrl + D), move line up/down (Alt + Up/Down), toggle comment (Ctrl + /).
  • Printing: Native document & rendered Markdown printing (Ctrl + P).

⌨️ Keyboard Shortcuts Reference

Shortcut Action
Ctrl + N New Tab
Ctrl + O Open Any File
Ctrl + S Save File
Ctrl + Shift + S Save As
Ctrl + W Close Active Tab
Ctrl + F Inline Find & Replace Panel
Ctrl + Shift + P Toggle Markdown & Math Live Preview
Ctrl + Shift + E Export Markdown as Rendered PDF
Ctrl + Alt + T Generate Table of Contents (TOC)
Ctrl + Shift + M Insert Markdown Table
Ctrl + K Insert Link or Image
Ctrl + G Go to Line Number
Ctrl + D Duplicate Current Line
Alt + Up / Down Move Current Line Up / Down
Ctrl + Shift + K Delete Current Line
Ctrl + / Toggle Line Comment
Ctrl + Shift + T Trim Trailing Whitespace
Ctrl + I Deep Document Statistics
Ctrl + P Print Document
Ctrl + F5 Insert Current Date & Timestamp
Ctrl + +/-/0 Zoom In / Zoom Out / Reset Zoom (100%)

📦 Download & Installation

All pre-built standalone distribution packages are available in the dist/ directory:

Platform Package File Requirements
Windows dist/Slate-Portable-Windows.zip (30 MB) None (Embedded private JRE included)
Linux dist/Slate-Linux-Portable-x64.tar.gz (70 KB) Java 17+
macOS dist/Slate-macOS-Portable.zip (70 KB) Java 17+
Universal dist/Slate-Universal.jar (70 KB) Java 17+ (java -jar Slate-Universal.jar)

🛠️ Building from Source

Prerequisites

  • JDK 17 or later (javac, jar, jlink, jpackage)

Build All Distribution Packages

# Compiles and generates all 4 platform packages in dist/
powershell -ExecutionPolicy Bypass -File .\build-all-dist.ps1

Linux

chmod +x build-linux.sh
./build-linux.sh

macOS

chmod +x build-macos.sh
./build-macos.sh

Standard Compilation

javac Slate.java
jar cfe Slate.jar Slate *.class
java -jar Slate.jar

📂 Project Structure

Slate/
├── .github/
│   └── workflows/
│       └── build-all.yml         # GitHub Actions CI/CD matrix build for Windows/Linux/macOS
├── dist/                         # Generated cross-platform packages (Windows, Linux, macOS, JAR)
├── Slate.java                    # Complete Slate application source code
├── build-all-dist.ps1            # Multi-platform distribution packager
├── build-package.ps1             # Windows build & packaging script
├── build-linux.sh                # Linux packaging script
├── build-macos.sh                # macOS packaging script
├── installer.iss                 # Inno Setup Windows installer script
├── slate_icon.ico                # Windows application icon
├── slate_icon.png                # High-res application icon
├── .gitignore                    # Git ignore file
├── LICENSE                       # MIT License
├── README.md                     # Documentation
├── CONTRIBUTING.md               # Contribution guidelines
└── SECURITY.md                   # Security reporting policy

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check out the Issues page.

  1. Fork the repository
  2. Create your branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Developed with ❤️ by Rohit Sah.

About

The VLC Media Player of Text Editors — Lightweight, blazing-fast, universal editor with live Markdown & LaTeX math preview, zero-dependency PDF export, and binary hex inspection.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages