Markdown editor with CriticMarkup support and Typora theme editor
Project description
Scriptum Simplex
A desktop Markdown editor with special support for CriticMarkup syntax, built using Python, Tkinter, and TTK Bootstrap following the Model-View-Controller (MVC) architectural pattern.
Features
- Two-pane interface: Live editor on the left, rendered preview on the right
- CriticMarkup support: Full support for all CriticMarkup syntax elements
- Advanced Markdown rendering: Complete GitHub Flavored Markdown (GFM) support
- Table rendering with column alignment (left/center/right)
- Inline formatting in tables (bold, italic,
code) - Code blocks with syntax highlighting
- Lists, headings, quotes, and more
- AST-based rendering: Direct Abstract Syntax Tree rendering for better performance
- File operations: New, Open, Save, Save As functionality
- Modern UI: Built with TTK Bootstrap for a modern look and feel
- Cross-platform: Works on Windows, macOS, and Linux
CriticMarkup Syntax Supported
- Additions:
{++text to add++} - Deletions:
{--text to delete--} - Substitutions:
{~~old text~>new text~~} - Comments:
{>>comment text<<} - Highlights:
{==highlighted text==}
Table Syntax
Scriptum Simplex supports GitHub Flavored Markdown tables with column alignment:
| Left Aligned | Center Aligned | Right Aligned |
|:-------------|:--------------:|--------------:|
| Text | Text | Text |
| More | Content | 100 |
Alignment markers:
:---= Left aligned (default):---:= Center aligned---:= Right aligned
Tables support inline formatting like bold, italic, and code within cells.
Installation
-
Clone or download this repository
-
Install Python dependencies:
cd criticmarkup-editor pip install -r requirements.txt
-
Run the application:
python main.py
Dependencies
ttkbootstrap>=1.10.1- Modern Tkinter themesmarko>=2.0.0- Markdown parser with AST support and GFM extensionscriticmarkup>=0.7.0- CriticMarkup processingtk_html_widgets>=0.40- HTML rendering in Tkinter (for HTML preview)pytest>=7.4.0- Testing frameworkmypy>=1.0.0- Type checking (dev dependency)flake8>=6.0.0- Code linting (dev dependency)
Project Structure
scriptum-simplex/
├── editor/
│ ├── __init__.py
│ ├── main.py # Application entry point
│ ├── model.py # Data and business logic (Model)
│ ├── view.py # GUI components (View)
│ └── controller.py # Connects Model and View (Controller)
├── tests/
│ ├── __init__.py
│ ├── test_model.py # Unit tests for the model
│ └── test_integration.py # Integration tests
├── main.py # Main launcher script
├── requirements.txt # Python dependencies
└── README.md # This file
Architecture
The application follows the Model-View-Controller (MVC) pattern:
-
Model (
model.py): Manages data and business logic- Stores raw Markdown/CriticMarkup text
- Handles file I/O operations
- Converts text to HTML using CriticMarkup and Markdown libraries
-
View (
view.py): Manages the user interface- Creates the main window with two-pane layout
- Handles user input and displays output
- Shows dialogs and manages UI state
-
Controller (
controller.py): Coordinates between Model and View- Handles user actions (menu clicks, text changes)
- Updates the Model based on user input
- Updates the View based on Model changes
Usage
-
Start the application by running
python main.py -
Write Markdown and CriticMarkup in the left pane:
# My Document This is **bold** text with {++an addition++}. Here's a {~~mistake~>correction~~} in the text. {>>This is a comment about the document<<} {==This section is important==}
-
See the live preview in the right pane with proper styling for CriticMarkup elements
-
Use the File menu to:
- Create new documents (Ctrl+N)
- Open existing files (Ctrl+O)
- Save your work (Ctrl+S)
- Save with a new name (Ctrl+Shift+S)
-
Use the Edit menu for standard editing operations:
- Undo/Redo (Ctrl+Z/Ctrl+Y)
- Cut/Copy/Paste (Ctrl+X/Ctrl+C/Ctrl+V)
Testing
Run the test suite to verify everything works correctly:
# Run all tests
python -m pytest tests/ -v
# Run only unit tests
python -m pytest tests/test_model.py -v
# Run only integration tests
python -m pytest tests/test_integration.py -v
Development
The codebase is well-documented and follows Python best practices:
- Type hints for better code clarity
- Comprehensive docstrings
- Separation of concerns through MVC pattern
- Extensive test coverage
- Error handling and user feedback
Keyboard Shortcuts
Ctrl+N- New fileCtrl+O- Open fileCtrl+S- Save fileCtrl+Shift+S- Save asCtrl+Z- UndoCtrl+Y- RedoCtrl+X- CutCtrl+C- CopyCtrl+V- Paste
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
License
This project is open source. Feel free to use, modify, and distribute as needed.
Troubleshooting
Application won't start:
- Make sure all dependencies are installed:
pip install -r requirements.txt - Check that you're using Python 3.7 or later
Preview not updating:
- Check the console for error messages
- Verify that the CriticMarkup syntax is correct
File operations not working:
- Check file permissions
- Ensure the directory exists and is writable
For more help, check the test files for usage examples or create an issue in the repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scriptum_simplex-100.0.tar.gz.
File metadata
- Download URL: scriptum_simplex-100.0.tar.gz
- Upload date:
- Size: 117.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d11e514dc438cdf940261c188b67a0d0f6cd5d7e987fc0b729dbadeed00e549
|
|
| MD5 |
2ab8ffa6568a9b4cb8a950a98df3f660
|
|
| BLAKE2b-256 |
31daa423e9d8f0da128eefddd9be0e354d80b04aba579a7fdf5bb63ecbf6da23
|
File details
Details for the file scriptum_simplex-100.0-py3-none-any.whl.
File metadata
- Download URL: scriptum_simplex-100.0-py3-none-any.whl
- Upload date:
- Size: 103.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d432237ab7e8e00cc4dc80865b3d547538bab2496ec3f2251dabd0d33434b7ae
|
|
| MD5 |
4ed96c04bcaebc79ea7a2aa1e871dad9
|
|
| BLAKE2b-256 |
383c91e13f5e4efb81beb7c5d196a9def551898b5517be6dcaccb8a2e4dafc92
|