From 809fce9c89ddf9203815784493385974390dad2b Mon Sep 17 00:00:00 2001 From: Jarvis Date: Sat, 20 Sep 2025 12:34:09 +0200 Subject: [PATCH] refactor: prepare plugin for Obsidian community submission MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix command name from "Clean Up Freewriting" to "Clean up text" to follow Obsidian guidelines (no plugin name in command) - Replace inline JavaScript styles with CSS classes for better theme compatibility - Add proper CSS styles in styles.css for textarea and description elements - Correct license information in README from MIT to GPL v3 to match actual LICENSE file - Update README documentation to reflect new command name These changes address common Obsidian plugin review feedback: - Avoid assigning styles via JavaScript - Command names should not include plugin name - Maintain consistency between documentation and actual license 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 8 ++++---- main.ts | 4 ++-- settings.ts | 13 +++---------- styles.css | 23 ++++++++++++++++++----- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index c7ae260..bc04db1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Freewriting Cleanup [![GitHub release (latest by date)](https://img.shields.io/github/v/release/alexanderkucera/obsidian-freewriting-cleanup)](https://github.com/alexanderkucera/obsidian-freewriting-cleanup/releases) -[![License: MIT](https://img.shields.io/github/license/alexanderkucera/obsidian-freewriting-cleanup?color=yellow)](https://opensource.org/licenses/MIT) +[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![](https://img.shields.io/badge/mobile_supported-green?label=obsidian&labelColor=purple) Transform your messy freewriting into polished prose using AI. Clean up typos, improve grammar, and format your stream-of-consciousness writing into readable paragraphs with a single command. @@ -105,7 +105,7 @@ Write without the ability to delete or edit - just like pen on paper. Perfect fo ### 3. Clean Up Your Writing 1. **Select** the freewriting text you want to clean up -2. Use `Ctrl/Cmd + P` → "Clean Up Freewriting" +2. Use `Ctrl/Cmd + P` → "Clean up text" 3. The selected text will be replaced with the cleaned-up version 4. Review and make any final adjustments @@ -144,7 +144,7 @@ Write without the ability to delete or edit - just like pen on paper. Perfect fo ## Commands -### Clean Up Freewriting +### Clean up text The main command that transforms your selected text: @@ -287,7 +287,7 @@ Contributions are welcome! Please feel free to submit a Pull Request. ## License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details. ## Support diff --git a/main.ts b/main.ts index 30b4820..72f1d69 100644 --- a/main.ts +++ b/main.ts @@ -49,8 +49,8 @@ export default class FreewritingCleanupPlugin extends Plugin { private registerCommand() { this.addCommand({ - id: 'cleanup-freewriting', - name: 'Clean Up Freewriting', + id: 'cleanup-text', + name: 'Clean up text', editorCallback: async (editor: Editor, view: MarkdownView) => { await this.executeCleanupCommand(editor, view); } diff --git a/settings.ts b/settings.ts index f8e6cc4..c0df4b2 100644 --- a/settings.ts +++ b/settings.ts @@ -90,8 +90,7 @@ export class FreewritingCleanupSettingTab extends PluginSettingTab { // Style the textarea textArea.inputEl.rows = 4; - textArea.inputEl.style.width = '100%'; - textArea.inputEl.style.minHeight = '100px'; + textArea.inputEl.addClass('freewriting-cleanup-textarea'); }); // MARK: - Commentary Configuration @@ -142,18 +141,12 @@ export class FreewritingCleanupSettingTab extends PluginSettingTab { // Style the textarea textArea.inputEl.rows = 3; - textArea.inputEl.style.width = '100%'; - textArea.inputEl.style.minHeight = '80px'; + textArea.inputEl.addClass('freewriting-cleanup-textarea-small'); }); } else { // Show the current preset for reference const presetText = COMMENTARY_PRESETS[this.plugin.settings.commentaryStyle as Exclude]; - const descDiv = containerEl.createDiv({ cls: 'setting-item-description' }); - descDiv.style.marginLeft = '0'; - descDiv.style.padding = '10px'; - descDiv.style.backgroundColor = 'var(--background-secondary)'; - descDiv.style.borderRadius = '5px'; - descDiv.style.fontSize = '0.9em'; + const descDiv = containerEl.createDiv({ cls: 'setting-item-description freewriting-cleanup-description' }); descDiv.innerHTML = `Selected style: ${presetText}`; } } diff --git a/styles.css b/styles.css index 71cc60f..1f60344 100644 --- a/styles.css +++ b/styles.css @@ -1,8 +1,21 @@ -/* +/* Freewriting Cleanup Plugin Styles */ -This CSS file will be included with your plugin, and -available in the app when your plugin is enabled. +/* Settings page textarea styling */ +.freewriting-cleanup-textarea { + width: 100% !important; + min-height: 100px !important; +} -If your plugin does not need CSS, delete this file. +.freewriting-cleanup-textarea-small { + width: 100% !important; + min-height: 80px !important; +} -*/ +/* Commentary style description box */ +.freewriting-cleanup-description { + margin-left: 0 !important; + padding: 10px !important; + background-color: var(--background-secondary) !important; + border-radius: 5px !important; + font-size: 0.9em !important; +}