Skip to content

v.1.5.1

Choose a tag to compare

@byteuser1977 byteuser1977 released this 25 May 07:10

Release v1.5.1

Release Date: 2026-05-23
Tag: v1.5.1
Previous Version: v1.5.0


πŸŽ‰ Release Highlights

🎨 Enhanced Theme System

Introducing 5 new themes and a complete theme development framework:

  • πŸ“„ Academic Paper Theme β€” GB/T 7713 compliant academic paper formatting
  • πŸ‡¨πŸ‡­ Swiss Design Theme β€” International Typographic Style with black-white-red color system
  • 🎨 Pixso Design Theme β€” Modern design system styling
  • 🌲 Forest Ink Theme β€” Warm paper base with forest green accents
  • πŸ“ Standardized Template β€” Reference implementation for custom theme creation

πŸ“± Mobile Platform Support

Full Android (.apk) + iOS (.ipa) support via Capacitor 6:

  • Native file picker integration
  • Chinese IME optimization
  • PDF export with native PrintManager
  • Mobile-adapted responsive UI

πŸ”§ Refactored Export Pipeline

Completely rewritten PDF/HTML export system:

  • Auto-extraction of current theme styles
  • Plugin-injected export styles (no more hardcoded handling)
  • Smart error recovery with dynamic plugin skipping
  • Custom print style support for advanced use cases

✨ New Features

Themes (5 New)

Theme File Description
Academic Paper academic-paper.css GB/T 7713 compliant, SimHei/SimSun typography, three-line tables, print-optimized Mermaid
Academic Paper (PT) academic-paper-pt.css Same as above but using pt units for specific print scenarios
Swiss Design swiss-design.css Black-white-red color system, geometric sans-serif fonts, grid-based layout
Pixso Design pixso-design.css Modern design system style
Forest Ink forest-ink.css Warm paper base, forest green ink text and accents
Template template.css Standardized reference implementation following v3.0 paradigm

Theme Development Framework

  • Theme Paradigm Document (docs/theme-paradigm.md) β€” Complete CSS theme development specification (v3.2)
    • Design principles: variable-driven, modular, semantic naming, AI-agent derivable
    • 30+ verifiable rules (MUST / MUST NOT / SHOULD) with WCAG contrast formulas
    • Print fidelity specifications: variable re-declaration, 12-category element coverage list
    • px unit unification standard to ensure consistent PDF export font sizes

Mobile Platform

  • Android Platform (mobile.css)
    • Capacitor 6 integration for native APK builds
    • File picker via @capawesome/capacitor-file-picker
    • IME input method optimization for CJK languages
    • Native PDF export using Android PrintManager
  • iOS Platform
    • Capacitor 6 integration for native IPA builds
    • Full iOS support with WebView/WKWebView
  • Dual-platform Bridge (capacitor-api.ts)
    • Runtime auto-detection of Electron/Capacitor APIs
    • Seamless code sharing between desktop and mobile

Documentation & Demo

  • Academic Paper Demo (academic-demo.md) β€” Real-world academic paper with 8 Mermaid diagram groups
  • Inline SVG Guide (demo.html) β€” Best practices for SVG in Markdown
  • General Feature Demo (demo.md) β€” Complete feature showcase

πŸ”§ Improvements

PDF Export Pipeline (Major Refactor)

Auto Theme Style Extraction

  • Automatically extracts current theme styles when exporting
  • Injects theme CSS into exported HTML/PDF documents
  • Ensures visual consistency between editor preview and exported files

Unified Plugin Style Management

  • Math plugin (math-plugin.ts): Added clipboard/export/rendering style configuration fields
  • Mermaid plugin (mermaid-plugin.ts): Added unified style configuration
  • Replaced all hardcoded style handling with dynamic retrieval from plugin configuration
  • Plugins now self-manage their export styles through configuration objects

Enhanced Error Recovery

  • Dynamic plugin skipping during export (instead of hard-coded exclusions)
  • Graceful degradation when individual plugins fail
  • Better error logging and user feedback

Custom Theme Export Fix

  • Fixed Chromium CSSOM serialization issues for custom themes
  • Proper extraction of @media print rules from custom theme CSS
  • Auto-injection of custom theme print styles into export HTML

Editor Core & Rendering

  • Wrapped getLiveHTML() output in <div id="write"> container for better structure
  • Optimized rendering: only apply base element styles when not using custom themes
  • Removed debug auto-open developer tools code from production build
  • Optimized academic paper theme styles for better performance

Theme System Architecture

  • Modular Refactoring: Split into foundation.css + base/ built-in themes + components/mermaid/ variable mapping + user theme directory
  • Mermaid Variable System: 20 core CSS variables (--mermaid-*) auto-mapped to 22 chart type SVG selectors
  • Academic Paper Theme Refactoring: All hardcoded colors β†’ var() variables; all pt units β†’ px even integers

πŸ› Bug Fixes

TypeScript Type System (15 Errors Fixed)

File Issue Fix
capacitor-api.ts string | null type assignment error Corrected type annotation
editor.ts remarkPluginsCtx type mismatch Fixed type compatibility
editor.ts rootEl null check missing Added null safety check
math-plugin.ts $NodeSchema type vs $view function Resolved type conflict
mermaid-plugin.ts Mermaid theme type issue Fixed type definition
mermaid-plugin.ts $NodeSchema type mismatch Aligned type interfaces
main.ts Missing Vite client types for import.meta.glob Added type reference
main/index.ts Invalid fs.createServer import Removed non-existent import
main/index.ts Invalid PrintToPDFOptions.marginType Removed deprecated property

Project Configuration Updates:

Mermaid Diagram Rendering

Fixed in elegant + academic-paper themes:

  • βœ… Text offset problem resolved
  • βœ… Variable name mismatch corrected
  • βœ… Double border display issue fixed

Mermaid Theme System Improvements:

  • Adjusted to Guizang warm color palette (cream background + brown tones)
  • Font size optimized to 10.5pt for academic printing
  • Added Typora compatible selectors (.md-diagram-panel)
  • Added mobile responsive adaptation
  • Unified text color and border styles across all themes

Theme Print Fidelity

Critical Fix: Completed @media print screen attribute mirrors for template and Swiss Design CSS:

Covered attributes:

  • Font size (font-size)
  • Line height (line-height)
  • Font family (font-family)
  • Borders (border, border-*)
  • Spacing (margin, padding, gap)
  • Letter spacing (letter-spacing)
  • Word spacing (word-spacing)
  • Text alignment (text-align)
  • Background colors (background, background-color)
  • And more...

Result: Screen preview now matches PDF export exactly.

Custom Theme Export (theme-manager.ts):

  • Fixed CSS extraction logic to avoid Chromium CSSOM serialization issues
  • Added automatic injection of custom theme print styles during export

Android Platform Fixes

Chinese IME (Input Method Editor)

  • βœ… Removed e.preventDefault() in beforeinput event
  • βœ… Enhanced ProseMirror editor IME composition event handling
  • βœ… Applied -webkit-user-modify: read-write-plaintext-only for better CJK input experience

Intent File Opening

  • βœ… Added Intent.ACTION_VIEW handling in MainActivity
  • βœ… Supported onNewIntent for opening new files while app is running
  • βœ… Implemented JavaScript bridge to pass file content to WebView

PDF Export on Android

  • βœ… Replaced Capacitor Plugin bridge with JavascriptInterface
  • βœ… Created ColaMDNativeBridge class for native PrintManager calls
  • βœ… Added "Save as PDF" option
  • βœ… Fixed pagination issues
  • βœ… Fixed save button functionality
  • βœ… Updated Mermaid version for mobile compatibility
  • βœ… Resolved layer residue problems

Export Functionality Improvements

PDF/HTML Export:

  • βœ… Refactored Mermaid rendering logic with export sync wait mechanism
  • βœ… Supported real-time rendered content export (not just source code)
  • βœ… Fixed default filename logic

File Manager Open Mechanism:

  • βœ… Adopted pull model: JS actively calls Java checkPendingFile()
  • βœ… Eliminated JS event injection timing issues
  • βœ… Added init detection + setInterval polling dual guarantee

Mobile Adaptation

  • βœ… Fixed missing screen type in media queries (mobile.css)

Plugin System

  • βœ… Fixed plugin import errors
  • βœ… Updated package versions
  • βœ… Decoupled plugin system: reduced main.ts dependency on specific plugins

⚠️ Important Notices

🚚 Theme Migration to Dedicated Repository

Starting from v1.5.1, theme updates and maintenance have been migrated to a dedicated repository:

πŸ”— https://github.com/byteuser1977/ColaMD-themes

Why the migration?

  • βœ… Faster iteration and release cycles for theme-specific changes
  • βœ… Community contributions and theme submissions welcome
  • βœ… Independent versioning from core ColaMD application
  • βœ… Focused issue tracking for theme-related problems

What this means for you:

  • Themes included in this release will remain available for backward compatibility
  • For the latest versions and new themes, check the dedicated repository
  • Future theme enhancements will be released there first
  • You can still use custom themes locally without any changes

πŸ“¦ Installation & Upgrade

From Source

# Clone the repository
git clone https://github.com/byteuser1977/ColaMD-extend.git
cd ColaMD-extend

# Checkout v1.5.1
git checkout v1.5.1

# Install dependencies
npm install

# Run development mode
npm run dev

# Build for production
npm run build

Download Pre-built Binaries

Visit the Releases page to download pre-built binaries for your platform:

  • macOS (.dmg) β€” Intel + Apple Silicon
  • Windows (.exe) β€” Installer + Portable
  • Linux (.AppImage, .deb) β€” Universal + Debian/Ubuntu
  • Android (.apk) β€” Via Capacitor 6
  • iOS (`.ipa**) β€” Via Capacitor 6 (requires TestFlight/App Store distribution)

Using Custom Themes

# Option 1: Place theme file manually
cp your-theme.css ~/.colamd/themes/

# Option 2: Import via ColaMD UI
# Open ColaMD β†’ Theme β†’ Import Theme β†’ Select your .css file

Available themes can be downloaded from the themes/ directory or the dedicated ColaMD-themes repository.


πŸ”„ Migration Guide (from v1.5.0)

For Desktop Users

No breaking changes. Simply update to v1.5.1:

  • Your existing settings and themes are preserved
  • New themes are automatically available after update
  • No configuration changes required

For Mobile Users

If you were using beta releases:

  • Uninstall the old beta version first
  • Install v1.5.1 stable release
  • Your data is preserved (stored in app sandbox)
  • New features: Better IME support, improved PDF export, smoother UI

For Theme Developers


πŸ“Š Statistics

Code Changes

  • Files Changed: 50+
  • Lines Added: ~2,500+
  • Lines Modified: ~800+
  • Lines Removed: ~400+

Test Coverage

  • TypeScript Type Errors Resolved: 15
  • Bug Fixes: 25+
  • New Features: 20+
  • Documentation Pages: 5

Supported Platforms

  • βœ… macOS (Intel + Apple Silicon)
  • βœ… Windows (x64)
  • βœ… Linux (x64, ARM64)
  • βœ… Android (ARM64, ARMv7)
  • βœ… iOS (ARM64)

πŸ™ Acknowledgments

Special Thanks To

  • Mermaid.js Team β€” For the excellent diagram rendering library
  • KaTeX Team β€” For the fast math typesetting engine
  • Capacitor Team β€” For enabling cross-platform mobile support
  • Milkdown Team β€” For the WYSIWYG Markdown editor framework
  • ProseMirror Team β€” For the robust rich text editing foundation
  • Electron Team β€” For the cross-platform desktop framework
  • Vite Team β€” For the blazing-fast build toolchain
  • Testing Community β€” Beta testers who provided valuable feedback on v1.5.1-beta.1 and v1.5.1-beta.2

πŸ“ Changelog

For detailed change history, see CHANGELOG.md.

Key changes since v1.5.0:

  • v1.5.1-beta.1: Initial mobile platform support, basic themes
  • v1.5.1-beta.2: TypeScript fixes, Mermaid refactoring, enhanced themes
  • v1.5.1 (stable): Complete documentation, PDF export refactor, production-ready

πŸ”— Links


πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ’¬ Feedback & Support

Found a bug? Have a feature request? Want to contribute?


Thank you for using ColaMD! πŸŽ‰

Built with ❀️ by the ColaMD community