A sleek, modern, lightweight web application for writers to create, organize, and export novels. Built with Flask, this application offers a distraction-free writing environment with just the right amount of features to enhance your writing process.
- Multiple Projects: Create and manage multiple books in a single interface
- Easy Navigation: Quickly switch between your writing projects
- Automatic Saving: Your work is saved automatically every 30 seconds
- Flexible Structure: Create, delete, rename, and reorder chapters
- Quick Access: Navigate between chapters with a single click
- Content Preservation: All formatting is maintained across sessions
- Basic Formatting: Bold, italic, and underlined text
- List Support: Create bullet points and numbered lists
- Block Quotes: Format sections as block quotes
- Clean Formatting: One-click removal of all text formatting
- JSON Format: Export your entire book structure for backup
- Plain Text: Export clean, formatted text that works anywhere
- HTML: Export beautifully formatted HTML with proper spacing
- Book Settings: Customize font size and line spacing for each book
- UI Preferences: Adjust the interface to your liking
- Theme Options: Choose between light and dark themes (via extensions)
- Modular Design: Add new features through Python-based extensions
- Built-in Extensions: Dark mode, focus timer, and more
- Custom Extensions: Create your own extensions to enhance functionality
- Python 3.7 or higher
- pip (Python package manager)
- Clone or download this repository:
git clone https://github.com/Luigichopper/SimpleWriter
cd simple-writer
- Create and activate a virtual environment (recommended):
# Create virtual environment
python -m venv venv
# Activate on Windows
venv\Scripts\activate
# Activate on macOS/Linux
source venv/bin/activate
- Install required dependencies:
pip install -r requirements.txt
- Run the application:
python main.py
- Access the application:
Open your web browser and navigate to:
http://127.0.0.1:5000
start-app-batch.bat or start-app-shell.sh
- From the home screen, click the "New Book" button
- Enter a title for your book
- Click "Create Book" to be taken to the editor
- View a chapter: Click on any chapter in the sidebar
- Add a chapter: Click the "Add Chapter" button at the bottom of the sidebar
- Rename a chapter: Click the pencil icon next to the chapter name
- Delete a chapter: Click the trash icon next to the chapter name
Use the toolbar above the editor for formatting:
- B: Bold text
- I: Italic text
- U: Underline text
- •: Bullet points
- 1.: Numbered lists
- ": Block quotes
- T: Reset text formatting
- Your work is saved automatically every 30 seconds
- Click the "Save" button in the top bar to save manually
- Click the "Export" dropdown in the top menu
- Choose your preferred format:
- JSON: For backup and importing back into the application
- Text: Plain text format with Markdown-style headings
- HTML: Formatted HTML with proper spacing and styles
- Click the "Settings" gear icon in the top menu
- Adjust font size and line spacing
- Click "Save Settings" to apply changes
The application comes with two built-in extensions:
- Automatically applies a dark theme to reduce eye strain
- Toggle between light and dark mode with a floating button
- Pomodoro-style timer to help maintain writing focus
- Set 5, 15, or 25 minute focus sessions
- Get a notification when your session is complete
Extensions are Python files that enhance the functionality of the application. Here's how to create a basic extension:
def init_extension():
"""Return extension metadata."""
return {
"name": "My Extension",
"version": "1.0.0",
"description": "Description of what your extension does",
"author": "Your Name"
}
def on_load():
"""Called when the extension is loaded."""
print("My extension loaded!")
def get_css():
"""Return CSS to be injected into the editor."""
return """
/* Your CSS here */
"""
def get_js():
"""Return JavaScript to be injected into the editor."""
return """
// Your JavaScript here
"""
def inject_editor(document):
"""
Modify the editor HTML.
document: BeautifulSoup document representing the editor
return: Modified BeautifulSoup document
"""
# Add CSS
style_tag = document.new_tag('style')
style_tag.string = get_css()
document.head.append(style_tag)
# Add JavaScript
script_tag = document.new_tag('script')
script_tag.string = get_js()
document.body.append(script_tag)
return document
- Save your extension file with a
.py
extension - Place it in the
extensions
folder of the application - Restart the application (or upload through the Extensions tab)
- Activate your extension in the Extensions tab
novel-writer/
│
├── main.py # Main application file
├── requirements.txt # Python dependencies
├── README.md # This documentation file
│
├── books/ # Directory for storing books
│ └── *.json # Book data files
│
├── extensions/ # Extension modules
│ ├── dark_mode.py # Dark mode extension
│ └── focus_timer.py # Focus timer extension
│
├── templates/ # HTML templates
│ ├── index.html # Home page template
│ └── edit.html # Editor template
│
└── static/ # Static assets (if needed)
├── css/ # CSS files
└── js/ # JavaScript files
- Make sure your
templates
directory exists at the root of the project - Check that
index.html
andedit.html
are in the templates directory
- Ensure you have
beautifulsoup4
installed:pip install beautifulsoup4
- Check that your extension has an
inject_editor
function - Restart the application after adding or modifying extensions
- If creating a chapter doesn't immediately display, don't worry - it's being saved
- Click the "Save" button or refresh the page to see your new chapter
- Word Count: Track your writing progress with word and character counts
- Search: Find text within your book
- Images: Support for adding images to your book
- Offline Mode: Work without an internet connection
- Collaboration: Share and collaborate on books with other users
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Flask, a lightweight Python web framework
- Uses modern web technologies for a responsive UI
- Inspired by distraction-free writing applications
Happy Writing!