How aziz/plaintasks works
Main components
• Sublime Text Editor Integration: This is the host platform that loads the plugin. It interacts with the plugin through the command palette, keymaps (e.g., Default (Linux).sublime-keymap, Default (OSX).sublime-keymap, Default (Windows).sublime-keymap), and menus (PlainTasks.sublime-menu, Main.sublime-menu, Context.sublime-menu).
• Core Plugin Engine: Represented mostly by the Python files (PlainTasks.py is the primary file; APlainTasksCommon.py, PlainTasksDates.py, PlainTasksToHTML.py, and plist_parser.py are supporting modules). This is where the logic for creating, toggling, archiving, and managing tasks resides.
• Configuration & Settings: The plugin uses several settings files—such as PlainTasks (Linux/OSX/Windows).sublime-settings, dependencies.json, and messages configuration files—to drive both its look-and-feel (themes in tasks-*.hidden-tmTheme) and behavior (user and default settings).
• Templates and Output Modules: The “templates” directory (export.html, template.html) and the HTML conversion aspect (command “Tasks: View as HTML” that calls PlainTasksToHTML.py) are responsible for rendering or exporting tasks.
• Testing & Documentation: Notice the existence of a “test” and “tests” directory to validate functionality, plus additional documentation provided in the README and messages folder for tutorials.
Relationships and interactions
• User interacts with Sublime Text → Sublime loads the PlainTasks plugin via its package manager.
• The command palette and key bindings trigger commands from PlainTasks.py and related modules.
• These commands call functions in the core engine to generate, update, and archive tasks, while referring to settings loaded from the various configuration files.
• The HTML export and template rendering modules (PlainTasksToHTML.py and the templates directory) process the current document to generate browsable HTML output.
• Testing components (test/test.todo, tests/test.py) validate and ensure that changes in core modules function as expected.
Architectural models and design principles
• Modular Design: The separation between the core logic, configuration, UI integration (menus, keymaps), and output (HTML conversion) suggests a modular approach.
• Integration with Host Environment: Leveraging Sublime’s extensibility (via .sublime-menu, .sublime-settings, and snippets) showcases a plugin architecture design pattern.
• Test-Driven Components: The presence of test directories implies an emphasis on unit testing and maintainability.
Relevant technologies and frameworks
• Python is the main language with its standard libraries (e.g., datetime, file handling).
• Sublime Text’s API and package conventions serve as an implicit framework.
• Configuration files such as JSON (dependencies.json) and markup files (tmPreferences, tmLanguage) are used for customization.
Details and clarity
• Be as detailed as possible to encapsulate each architectural layer.