From 34e7e9fe29d6e158864a1ed0a1533a3b46aa5ef0 Mon Sep 17 00:00:00 2001 From: sradics Date: Sat, 3 May 2025 12:31:50 +0200 Subject: [PATCH] Prepare for community plugin --- LICENSE | 22 +++++++++++++--- README.md | 45 ++++++++++++++++++++++++++++++++- manifest.json | 2 +- node_modules/.package-lock.json | 2 +- package.json | 6 ++--- 5 files changed, 68 insertions(+), 9 deletions(-) diff --git a/LICENSE b/LICENSE index 287f37a..a127cef 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,21 @@ -Copyright (C) 2020-2025 by Dynalist Inc. +MIT License -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. +Copyright (c) 2025 Sebastian Kamilli -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index d0efe46..e0f3e1a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ -# obsidian-course-module-loader +# Course Module Loader +This plugin for Obsidian allows users, such as course attendees, to easily download and unzip course materials directly into their vault from a provided URL. + +## Features + +* **Download from URL:** Downloads a zip file containing course materials from any direct download URL (including Dropbox links formatted for direct download). +* **Unzip into Vault:** Automatically unzips the downloaded content into a specified folder within the current Obsidian vault. +* **Configurable Target Folder:** Users can select the target folder using a searchable folder list in the plugin settings. +* **Skip Existing Files:** If a file with the same name already exists in the target folder, the plugin will skip extracting that file from the zip, preserving existing user data. +* **Folder Creation:** Automatically creates necessary subfolders within the target folder as defined in the zip file structure. +* **Ignores Metadata Files:** Automatically skips macOS-specific metadata files (`__MACOSX` folders and `.DS_Store` files) during extraction. + +## How to Use + +1. **Install the Plugin:** Once available, install the plugin from the Obsidian Community Plugins browser. +2. **Configure Settings:** + * Go to Obsidian `Settings` -> `Community Plugins` -> `Course Module Loader` (or the name you chose). + * Click the `Change Folder` button next to the "Target Folder" setting. + * A searchable list of your vault folders will appear. Search for and select the desired folder where you want course materials to be saved (e.g., "My Course Notes/Modules", "Downloads"). The root folder `/` is also selectable. + * The selected folder path will be displayed. +3. **Download a Module:** + * Open the Obsidian Command Palette (default `Ctrl+P` or `Cmd+P`). + * Search for and run the command: `Download and Unzip Course Module`. + * A modal window will appear asking for the URL of the zip file. + * Paste the direct download URL for the course module zip file (e.g., a Dropbox link ending in `?dl=1`). + * Click `Download and Unzip`. +4. **Check Results:** The plugin will show notices indicating download progress and completion. The files will be extracted into your chosen target folder, skipping any files that already existed. + +## Compatibility + +Requires Obsidian version 1.0.0 or newer. + +## Installation (From Community Plugins) + +1. Open `Settings` -> `Community Plugins`. +2. Make sure "Safe mode" is **off**. +3. Click `Browse` community plugins. +4. Search for "Course Module Loader". +5. Click `Install`. +6. Once installed, close the community plugins window and **enable** the plugin under "Installed plugins". + +## License + +This plugin is released under the [MIT License](LICENSE). diff --git a/manifest.json b/manifest.json index 2e6423d..1def5e2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "Course Module Loader", "version": "1.0.0", "minAppVersion": "0.15.0", - "description": "Downloads course modules from a given URL and loads them into Obsidian.", + "description": "Downloads and unzips course module zip files from a URL into a specified vault folder, skipping existing files.", "author": "Sebastian Kamilli", "authorUrl": "https://www.linkedin.com/in/sebastiankamilli/", "isDesktopOnly": false diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index a82d67d..b6cfa26 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,5 +1,5 @@ { - "name": "obsidian-sample-plugin", + "name": "obsidian-course-module-loader", "version": "1.0.0", "lockfileVersion": 3, "requires": true, diff --git a/package.json b/package.json index 32f79ef..94ba35e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "obsidian-sample-plugin", + "name": "obsidian-course-module-loader", "version": "1.0.0", - "description": "This is a sample plugin for Obsidian (https://obsidian.md)", + "description": "Downloads course modules from a given URL and loads them into Obsidian.", "main": "main.js", "scripts": { "dev": "node esbuild.config.mjs", @@ -9,7 +9,7 @@ "version": "node version-bump.mjs && git add manifest.json versions.json" }, "keywords": [], - "author": "", + "author": "Sebastian Kamilli", "license": "MIT", "devDependencies": { "@types/node": "^16.11.6",