Introduction
Note Editor is a feature-rich text editor built using PySide6. It offers functionalities such as file operations, PDF export, spell checking, word count, theme toggling, and an offline dictionary using NLTK's WordNet.
Getting Started
To run the Note Editor, ensure you have Python installed along with the required libraries. Follow these steps:
- Clone the repository or download the source code.
- Install the required dependencies using pip:
pip install -r requirements.txt
- Download NLTK's WordNet data:
python -c "import nltk; nltk.download('wordnet'); nltk.download('omw-1.4')"
- Run the application:
python main.py
Modules
- main.py: The entry point of the application.
- main_window.py: Contains the MainWindow class which orchestrates the application's main functionalities.
- widgets/
- editor.py: Defines the Editor class extending QTextEdit with additional features.
- menu_bar.py: Defines the MenuBar class managing the application's menu.
Features
- Open, create and save text files.
- Export documents to PDF.
- Spell checking with suggestions.
- Word count and basic document statistics.
- Theme toggling (light/dark).
- Offline dictionary using WordNet.
Classes & Methods
MainWindow
Main window controller of the app.
- __init__()
- Initializes the UI and connects actions.
- open_file()
- Opens a file dialog and loads the selected file.
- save_file()
- Saves the current document to disk.
- export_pdf()
- Exports the current document to a PDF file.
Editor
Text editor component.
- set_text(content)
- Sets the editor text.
- get_word_count()
- Returns the number of words in the document.
- check_spelling()
- Runs spell checking on the current text.
MenuBar
Application menu component.
- build_menus()
- Creates the menu structure and actions.
- connect_actions()
- Connects menu actions to callbacks.
Conclusion
This documentation provides an overview of the Note Editor project, its setup steps, module structure, features, and the main classes involved.