├── Community-Templates └── README.md ├── original-base-template_by-WebClipper.json ├── LICENSE ├── README.md └── generate_templates.py /Community-Templates/README.md: -------------------------------------------------------------------------------- 1 | Optional Area for community submissions for templates that work well for you. submit pull request. will process in order of receipt as we're able. 2 | -------------------------------------------------------------------------------- /original-base-template_by-WebClipper.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": "0.1.0", 3 | "name": "Default", 4 | "behavior": "create", 5 | "noteContentFormat": "{{content}}", 6 | "properties": [ 7 | { 8 | "name": "title", 9 | "value": "{{title}}", 10 | "type": "text" 11 | }, 12 | { 13 | "name": "source", 14 | "value": "{{url}}", 15 | "type": "text" 16 | }, 17 | { 18 | "name": "author", 19 | "value": "{{author|split:\", \"|wikilink|join}}", 20 | "type": "multitext" 21 | }, 22 | { 23 | "name": "published", 24 | "value": "{{published}}", 25 | "type": "date" 26 | }, 27 | { 28 | "name": "created", 29 | "value": "{{date}}", 30 | "type": "date" 31 | }, 32 | { 33 | "name": "description", 34 | "value": "{{description}}", 35 | "type": "text" 36 | }, 37 | { 38 | "name": "tags", 39 | "value": "clippings", 40 | "type": "multitext" 41 | } 42 | ], 43 | "triggers": [], 44 | "noteNameFormat": "{{title}}", 45 | "path": "Clippings" 46 | } 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 TheDavidYoungblood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Obsidian WebClipper Template Generator 2 | 3 | The **Obsidian WebClipper Template Generator** is a Python utility that automates the creation of JSON template files for the Obsidian WebClipper Chrome extension. In addition to generating the necessary folder structure and templates for various clipping scenarios, it also produces a comprehensive `README_IMPORT_GUIDANCE.txt` to help you seamlessly import and manage your templates. 4 | 5 | Whether you’re new to the Obsidian ecosystem or looking to customize your clipping workflow, this tool and the curated resources below will get you up and running quickly. 6 | 7 | --- 8 | 9 | ## Table of Contents 10 | 11 | 1. [Features](#features) 12 | 2. [Installation](#installation) 13 | 3. [Usage](#usage) 14 | 4. [Repository Structure](#repository-structure) 15 | 5. [Obsidian WebClipper Settings & Configuration](#obsidian-webclipper-settings--configuration) 16 | 6. [User Guidance & Resources](#user-guidance--resources) 17 | - [Guides on Creating & Managing Templates](#guides-on-creating--managing-templates) 18 | - [Video Tutorials](#video-tutorials) 19 | - [Template Repositories](#template-repositories) 20 | - [Key Template Management Features](#key-template-management-features) 21 | 7. [Additional Resources](#additional-resources) 22 | - [Official Documentation & Installation Sources](#official-documentation--installation-sources) 23 | - [Guides and Tutorials](#guides-and-tutorials) 24 | - [Community Resources](#community-resources) 25 | - [Developer Resources](#developer-resources) 26 | - [Additional Information](#additional-information) 27 | 8. [Obsidian WebClipper Templates](#obsidian-webclipper-templates) 28 | 9. [License](#license) 29 | 10. [Contact](#contact) 30 | 11. [Acknowledgements](#acknowledgements) 31 | 32 | --- 33 | 34 | ## Features 35 | 36 | - **Automated Directory & File Generation** 37 | Creates a structured set of subdirectories and JSON files for various clipping scenarios: 38 | - `Clippings/` — Core template. 39 | - `Clippings/Summaries/` — For summary templates. 40 | - `Clippings/Research/` — For research & AI insights templates. 41 | - `Clippings/Translations/` — For translation templates. 42 | - `Clippings/Articles/` — For news/blog article templates. 43 | - `Clippings/Highlights/` — For highlights-only templates. 44 | - `Clippings/GitHub/` — For GitHub page templates. 45 | - `Clippings/Medium/` — For Medium article templates. 46 | - `Clippings/Generic/` — For fallback generic templates. 47 | 48 | - **Guided Import Process** 49 | Automatically generates a `README_IMPORT_GUIDANCE.txt` with step-by-step instructions for importing your templates into Obsidian WebClipper. 50 | 51 | - **Minimal Dependencies** 52 | Requires only Python 3.7 or higher and uses only the standard library. 53 | 54 | - **Comprehensive User Guidance** 55 | Leverages curated resources—from detailed guides and video tutorials to community repositories—to help you master custom template creation and management. 56 | 57 | --- 58 | 59 | ## Installation 60 | 61 | 1. **Ensure Python 3.7+ is installed.** 62 | 63 | 2. *(Optional)* Set up a virtual environment to isolate dependencies: 64 | 65 | ```bash 66 | python -m venv .venv 67 | source .venv/bin/activate # Windows: .venv\Scripts\activate 68 | ``` 69 | 70 | 3. **Clone this repository and navigate into it:** 71 | 72 | ```bash 73 | git clone https://github.com/thedavidyoungblood/Obsidian-WebClipper-Template-Generator.git 74 | cd Obsidian-WebClipper-Template-Generator 75 | ``` 76 | 77 | --- 78 | 79 | ## Usage 80 | 81 | Run the script from your terminal: 82 | 83 | ```bash 84 | python generate_templates.py 85 | ``` 86 | 87 | When prompted, enter the full **VAULT-ROOT-PATH** where you want the templates and guidance file to be generated. The script will: 88 | 89 | 1. Create the required subdirectories. 90 | 2. Populate each folder with its designated JSON template. 91 | 3. Generate `README_IMPORT_GUIDANCE.txt` with detailed instructions for importing the templates into Obsidian WebClipper. 92 | 93 | After execution, navigate to your specified vault root to review the created structure and guidance documentation. 94 | 95 | --- 96 | 97 | ## Repository Structure 98 | 99 | ``` 100 | . 101 | ├── generate_templates.py 102 | └── README.md 103 | ``` 104 | 105 | After running the script, your vault root will have a structure similar to: 106 | 107 | ``` 108 | vault-root/ 109 | ├── Clippings/ 110 | │ ├── Custom_Default_Verbatim_Clone_Clean.json 111 | │ ├── Summaries/ 112 | │ │ └── Custom_Summary.json 113 | │ ├── Research/ 114 | │ │ ├── Custom_Research_AI_Insights.json 115 | │ │ └── Research_Academic.json 116 | │ ├── Translations/ 117 | │ │ └── Custom_Translation.json 118 | │ ├── Articles/ 119 | │ │ ├── Custom_News_Blog_Article.json 120 | │ │ └── Article_Blog.json 121 | │ ├── Highlights/ 122 | │ │ └── Custom_Highlights_Only.json 123 | │ ├── GitHub/ 124 | │ │ └── GitHub_Page.json 125 | │ ├── Medium/ 126 | │ │ └── Medium_Article.json 127 | │ └── Generic/ 128 | │ └── Generic_Web_Clip.json 129 | └── README_IMPORT_GUIDANCE.txt 130 | ``` 131 | 132 | --- 133 | 134 | ## Obsidian WebClipper Settings & Configuration 135 | 136 | For advanced configuration of your Obsidian WebClipper extension, use the following settings URLs based on your installation type: 137 | 138 | ### Native Extension Settings 139 | If you have installed the native extension, access its settings directly by entering this URL into your browser’s address bar: 140 | 141 | ```plaintext 142 | chrome-extension://cnjifjpddelmedmihgijeibhnjfabmlf/settings.html?section=general 143 | ``` 144 | 145 | This page allows you to adjust general settings—such as template import options and clipping behavior—to tailor the extension to your workflow. 146 | 147 | ### Browser-Specific Configurations (Chromium-Based) 148 | For users running a Chromium-based browser (e.g., Chrome, Brave, Arc, etc.), manage the extension’s configuration through your browser’s built-in extensions page. Replace `{browser}` in the URL below with your browser’s protocol: 149 | 150 | ```plaintext 151 | {browser}://extensions/?id=cnjifjpddelmedmihgijeibhnjfabmlf 152 | ``` 153 | 154 | For example, in Chrome, use: 155 | 156 | ```plaintext 157 | chrome://extensions/?id=cnjifjpddelmedmihgijeibhnjfabmlf 158 | ``` 159 | 160 | This interface enables you to enable/disable the extension, review permissions, and perform any browser-specific configuration. 161 | 162 | --- 163 | 164 | ## User Guidance & Resources 165 | 166 | This section is designed to help you explore advanced template management techniques and get the most out of Obsidian WebClipper. 167 | 168 | ### Guides on Creating & Managing Templates 169 | 170 | - **Step-by-Step Guide to Custom Templates** 171 | Learn how to create custom templates, define unique names, and specify behaviors like creating new notes or appending to existing ones. 172 | [Sascha D. Kasper's Guide](https://sascha-kasper.com/step-by-step-guide-to-the-obsidian-web-clipper/) 173 | 174 | - **Effective Web Clipping with Custom Templates** 175 | Detailed instructions for tailoring templates to specific web pages (e.g., PubMed articles) using metadata fields like `PMID`. 176 | [Kristian Freeman's Guide](https://kristianfreeman.com/custom-obsidian-clippings) 177 | 178 | - **Obsidian Help Documentation** 179 | Official documentation on creating, editing, importing, and exporting templates—including advanced features like URL-based triggers. 180 | [Obsidian Help](https://help.obsidian.md/web-clipper/templates) 181 | 182 | ### Video Tutorials 183 | 184 | - **YouTube Walkthrough on Custom Templates** 185 | A comprehensive video guide covering default templates, custom template creation, and advanced trigger features. 186 | [Watch on YouTube](https://www.youtube.com/watch?v=oEtSLrfEj5o) 187 | 188 | - **Custom Template Setup and Triggers** 189 | Explains how to configure templates with properties, variables, and triggers for automating content capture. 190 | [Watch on YouTube](https://www.youtube.com/watch?v=Kesi8sp2x7M) 191 | 192 | ### Template Repositories 193 | 194 | - **Community Template Collections** 195 | Access pre-defined templates created by the Obsidian community for clipping highlights, saving metadata, and organizing research notes. 196 | 197 | - **Clipper-Templates Repository** 198 | A dedicated GitHub repository featuring example templates for various clipping scenarios with instructions for import/export. 199 | [Clipper-Templates Repo](https://github.com/kepano/clipper-templates) 200 | 201 | ### Key Template Management Features 202 | 203 | - **Importing/Exporting Templates** 204 | Easily import JSON files or export your custom templates for backup or sharing. 205 | 206 | - **Template Triggers** 207 | Automate template selection based on URL patterns or metadata. 208 | 209 | - **Variables and Properties** 210 | Utilize variables (e.g., `title`, `URL`, `date`) to dynamically populate note content during clipping. 211 | 212 | --- 213 | 214 | ## Additional Resources 215 | 216 | For a deeper dive into the Obsidian WebClipper ecosystem, explore these curated resources: 217 | 218 | ### Official Documentation & Installation Sources 219 | 220 | - **Obsidian WebClipper GitHub Repository** 221 | Official instructions, developer resources, and feature roadmaps. 222 | [obsidianmd/obsidian-clipper](https://github.com/obsidianmd/obsidian-clipper) 223 | 224 | - **Obsidian Help Site** 225 | Detailed documentation on using the WebClipper including highlighting, filters, and troubleshooting. 226 | [Obsidian Help](https://help.obsidian.md/web-clipper) 227 | 228 | - **Browser Extension Stores** 229 | Install the extension directly from: 230 | - [Chrome: Chrome Web Store](https://chromewebstore.google.com/detail/obsidian-web-clipper/cnjifjpddelmedmihgijeibhnjfabmlf) 231 | - [Firefox: Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/web-clipper-obsidian/) 232 | - [Safari: Obsidian WebClipper on Safari Extensions](https://obsidian.md/clipper) 233 | - [Edge: Microsoft Edge Add-ons](https://chromewebstore.google.com/detail/obsidian-web-clipper/cnjifjpddelmedmihgijeibhnjfabmlf) 234 | 235 | ### Guides and Tutorials 236 | 237 | - **Step-by-Step Guide by Sascha D. Kasper** 238 | Comprehensive instructions covering installation, configuration, and usage. 239 | [Step-by-Step Guide](https://sascha-kasper.com/step-by-step-guide-to-the-obsidian-web-clipper/) 240 | 241 | - **YouTube Tutorial** 242 | A video guide for setting up and using the Obsidian WebClipper effectively, including mobile support. 243 | [Watch on YouTube](https://www.youtube.com/watch?v=icsQeiqDa34) 244 | 245 | - **Supercharge Your Workflow Blog Post** 246 | Insights on capturing content efficiently using templates, highlighters, and filters. 247 | [Read the Blog Post](https://www.dsebastien.net/supercharge-your-knowledge-capture-workflow-with-the-obsidian-web-clipper/) 248 | 249 | ### Community Resources 250 | 251 | - **Reddit Discussions** 252 | User experiences and tips on using the Obsidian WebClipper. 253 | [Reddit Thread](https://www.reddit.com/r/ObsidianMD/comments/1hatxd1/my_obsidian_web_clipper/) 254 | 255 | - **Obsidian Forum Threads** 256 | Troubleshooting, alternative clippers, and community support: 257 | - [Troubleshooting Thread](https://forum.obsidian.md/t/obsidian-web-clipper-add-to-obsidian-not-working/91124) 258 | - [Reliable Web Clippers Discussion](https://forum.obsidian.md/t/reliable-web-clipper-for-daily-notes-with-emphasis-on-reliable/36944) 259 | 260 | ### Developer Resources 261 | 262 | - **Developer Setup Instructions** 263 | Build the extension locally with Node.js and npm. 264 | [obsidianmd/obsidian-clipper](https://github.com/obsidianmd/obsidian-clipper) | [mvavassori/obsidian-web-clipper](https://github.com/mvavassori/obsidian-web-clipper) 265 | 266 | - **Feature Roadmap** 267 | Planned enhancements include template validation, local image saving, markdown previews, and more. 268 | 269 | ### Additional Information 270 | 271 | - **Obsidian Blog Announcement** 272 | Learn about the WebClipper’s features and its impact on note-taking workflows. 273 | [Read the Blog Post](https://obsidian.md/blog/save-the-web/) 274 | 275 | - **App Store Reviews** 276 | See what users are saying about customization and performance. 277 | [Apple App Store – Obsidian WebClipper](https://apps.apple.com/us/app/obsidian-web-clipper/id6720708363) 278 | 279 | --- 280 | 281 | ## Obsidian WebClipper Templates [OFFICIAL] 282 | 283 | Templates for [Obsidian Web Clipper](https://github.com/obsidianmd/obsidian-clipper) work seamlessly with the templates in [my Obsidian vault](https://github.com/kepano/kepano-obsidian). 284 | To install templates, see the instructions in the official [Obsidian Web Clipper documentation](https://help.obsidian.md/web-clipper/templates). 285 | 286 | ### Templates 287 | 288 | Generic and schema-based templates: 289 | 290 | - [Recipes](https://github.com/kepano/clipper-templates/blob/main/templates/recipes-clipper.json) 291 | - [Product](https://github.com/kepano/clipper-templates/blob/main/templates/product-clipper.json) — e.g. Shopify 292 | 293 | Specific Websites: 294 | 295 | - [Arxiv](https://github.com/kepano/clipper-templates/blob/main/templates/arxiv-clipper.json) 296 | - [Goodreads](https://github.com/kepano/clipper-templates/blob/main/templates/goodreads-clipper.json) 297 | - [Google Maps](https://github.com/kepano/clipper-templates/blob/main/templates/google-maps-clipper.json) 298 | - [IMDB](https://github.com/kepano/clipper-templates/blob/main/templates/imdb-clipper.json) 299 | - [IMDB (reference view)](https://github.com/kepano/clipper-templates/blob/main/templates/imdb-reference-clipper.json) 300 | - [Letterboxd](https://github.com/kepano/clipper-templates/blob/main/templates/letterboxd-clipper.json) 301 | - [Redfin](https://github.com/kepano/clipper-templates/blob/main/templates/redfin-clipper.json) 302 | - [Wikipedia](https://github.com/kepano/clipper-templates/blob/main/templates/wikipedia-clipper.json) 303 | - [Youtube](https://github.com/kepano/clipper-templates/blob/main/templates/youtube-clipper.json) 304 | 305 | For a complete view of the repository, visit the [clipper-templates GitHub repository](https://github.com/kepano/clipper-templates). 306 | 307 | --- 308 | 309 | ## License 310 | 311 | This project is licensed under the MIT License. 312 | 313 | ``` 314 | MIT License 315 | 316 | Copyright (c) 2025 David Youngblood 317 | 318 | Permission is hereby granted, free of charge, to any person obtaining a copy 319 | of this software and associated documentation files (the "Software"), to deal 320 | in the Software without restriction, including without limitation the rights 321 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 322 | copies of the Software, and to permit persons to whom the Software is 323 | furnished to do so, subject to the following conditions: 324 | 325 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 326 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 327 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 328 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 329 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 330 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 331 | SOFTWARE. 332 | ``` 333 | 334 | --- 335 | 336 | ## Contact 337 | 338 | - **Email:** [opensource@louminai.com](mailto:opensource@louminai.com) 339 | - **Website:** [louminai.com](http://louminai.com/) 340 | - **GitHub:** [thedavidyoungblood/Obsidian-WebClipper-Template-Generator](https://github.com/thedavidyoungblood/Obsidian-WebClipper-Template-Generator) 341 | 342 | --- 343 | 344 | ## Acknowledgements 345 | 346 | Special thanks to the Obsidian team, the open source community, and contributors like AI (ChatGPT) for inspiring and supporting this project. 347 | 348 | *Happy Clipping!* 349 | -------------------------------------------------------------------------------- /generate_templates.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | r""" 4 | § - "meRead" - as a 'mini-Readme,' in the script itself - § 5 | 6 | # Header Metadata 7 | 8 | **Script Name**: Obsidian WebClipper Template Generator 9 | **Author**: David Youngblood 10 | **Creation Date**: 2025-02-18 11 | **Last Modified Date**: 2025-02-19 12 | **Version**: 1.2.1 13 | **Dependencies**: 14 | - Python 3.7 or higher 15 | 16 | ## **CHANGELOG:** 17 | - **v1.2.1:** 18 | - Added functionality to clone each generated JSON template into a centralized repository at `{VAULT-ROOT}/Clippings/TEMPLATES` for unified management. 19 | - Updated the "meRead" section to include a sterilized example of the expected terminal output. 20 | - Enhanced user guidance and overall script robustness. 21 | 22 | **Description**: 23 | This script automates the creation of JSON template files for Obsidian WebClipper. It prompts the user for a VAULT-ROOT-PATH and recursively generates the required directory structure along with all the JSON templates in their respective subdirectories. Additionally, it produces a `README_IMPORT_GUIDANCE.txt` file with detailed instructions on how to import these templates into the Obsidian WebClipper Chrome extension. 24 | 25 | Moreover, after generating each template in its designated folder, the script also clones every template into a centralized repository located at: 26 | 27 | **{VAULT-ROOT}/Clippings/TEMPLATES** 28 | 29 | This repository is intended for managing all templates in one place. 30 | 31 | **Usage**: 32 | 33 | 1. **Set up the environment** (if desired): 34 | ```bash 35 | python -m venv .venv 36 | source .venv/bin/activate # On Windows: .venv\Scripts\activate 37 | ``` 38 | 39 | 2. **Run the Script**: 40 | Execute the script from your terminal or command prompt: 41 | ```bash 42 | python generate_templates.py 43 | ``` 44 | When prompted, enter the full VAULT-ROOT-PATH where you want the templates and documentation generated. 45 | 46 | 3. **Importing Templates**: 47 | After the script finishes, navigate to the specified vault root. Review the generated `README_IMPORT_GUIDANCE.txt` for step‑by‑step instructions on importing the JSON templates into Obsidian WebClipper. 48 | 49 | **Expected Terminal Output (Sterilized Example)**: 50 | 51 | ```shell 52 | PS C:\Vaults\ExampleVault> python generate_templates.py 53 | Enter the VAULT-ROOT-PATH where templates should be generated: C:\Vaults\ExampleVault 54 | Created template 'Custom Default - Verbatim Clone (Clean)' at: C:\Vaults\ExampleVault\Clippings\Custom_Default_Verbatim_Clone_Clean.json 55 | Cloned template 'Custom Default - Verbatim Clone (Clean)' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Custom_Default_Verbatim_Clone_Clean.json 56 | Created template 'Custom Summary' at: C:\Vaults\ExampleVault\Clippings\Summaries\Custom_Summary.json 57 | Cloned template 'Custom Summary' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Custom_Summary.json 58 | Created template 'Custom Research & AI Insights' at: C:\Vaults\ExampleVault\Clippings\Research\Custom_Research_AI_Insights.json 59 | Cloned template 'Custom Research & AI Insights' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Custom_Research_AI_Insights.json 60 | Created template 'Custom Translation' at: C:\Vaults\ExampleVault\Clippings\Translations\Custom_Translation.json 61 | Cloned template 'Custom Translation' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Custom_Translation.json 62 | Created template 'Custom News/Blog Article' at: C:\Vaults\ExampleVault\Clippings\Articles\Custom_News_Blog_Article.json 63 | Cloned template 'Custom News/Blog Article' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Custom_News_Blog_Article.json 64 | Created template 'Custom Highlights Only' at: C:\Vaults\ExampleVault\Clippings\Highlights\Custom_Highlights_Only.json 65 | Cloned template 'Custom Highlights Only' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Custom_Highlights_Only.json 66 | Created template 'GitHub Page' at: C:\Vaults\ExampleVault\Clippings\GitHub\GitHub_Page.json 67 | Cloned template 'GitHub Page' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\GitHub_Page.json 68 | Created template 'Medium Article' at: C:\Vaults\ExampleVault\Clippings\Medium\Medium_Article.json 69 | Cloned template 'Medium Article' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Medium_Article.json 70 | Created template 'Research / Academic' at: C:\Vaults\ExampleVault\Clippings\Research\Research_Academic.json 71 | Cloned template 'Research / Academic' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Research_Academic.json 72 | Created template 'Article / Blog' at: C:\Vaults\ExampleVault\Clippings\Articles\Article_Blog.json 73 | Cloned template 'Article / Blog' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Article_Blog.json 74 | Created template 'Generic Web Clip' at: C:\Vaults\ExampleVault\Clippings\Generic\Generic_Web_Clip.json 75 | Cloned template 'Generic Web Clip' into repository at: C:\Vaults\ExampleVault\Clippings\TEMPLATES\Generic_Web_Clip.json 76 | 77 | Created import guidance documentation at: C:\Vaults\ExampleVault\README_IMPORT_GUIDANCE.txt 78 | 79 | All templates generated and cloned successfully. 80 | PS C:\Vaults\ExampleVault\Clippings> 81 | ``` 82 | 83 | > MONO-SCRIPT to generate Obsidian WebClipper JSON template files 84 | 85 | This script: 86 | 1. Prompts for a VAULT-ROOT-PATH. 87 | 2. Creates the necessary subdirectories for each template. 88 | 3. Writes each JSON template (using json.dumps from a Python dictionary) into its designated folder. 89 | 4. Clones all generated templates into the central repository at `{VAULT-ROOT}/Clippings/TEMPLATES`. 90 | 5. Creates a supporting documentation file with guidance for importing these templates into the Obsidian WebClipper browser extension. 91 | """ 92 | # BEGIN SCRIPT EXECUTION 93 | 94 | import os 95 | import sys 96 | import json 97 | 98 | # Each template is now defined as a Python dictionary under the key "content_dict". 99 | TEMPLATES = [ 100 | { 101 | "name": "Custom Default - Verbatim Clone (Clean)", 102 | "filename": "Custom_Default_Verbatim_Clone_Clean.json", 103 | "subfolder": os.path.join("Clippings"), 104 | "content_dict": { 105 | "schemaVersion": "0.1.0", 106 | "name": "Custom Default - Verbatim Clone (Clean)", 107 | "behavior": "create", 108 | "noteContentFormat": '{{fullHtml|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 109 | "properties": [ 110 | {"name": "title", "value": "{{title}}", "type": "text"}, 111 | {"name": "source", "value": "{{url}}", "type": "text"}, 112 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 113 | {"name": "published", "value": "{{published}}", "type": "date"}, 114 | {"name": "created", "value": "{{date}}", "type": "date"}, 115 | {"name": "description", "value": "{{description}}", "type": "text"}, 116 | {"name": "tags", "value": "web-clip, verbatim", "type": "multitext"} 117 | ], 118 | "triggers": [], 119 | "noteNameFormat": "{{title}}", 120 | "path": "Clippings" 121 | } 122 | }, 123 | { 124 | "name": "Custom Summary", 125 | "filename": "Custom_Summary.json", 126 | "subfolder": os.path.join("Clippings", "Summaries"), 127 | "content_dict": { 128 | "schemaVersion": "0.1.0", 129 | "name": "Custom Summary", 130 | "behavior": "create", 131 | "noteContentFormat": '## Summary\n{{"Summarize the main points of this page in three bullet points."|blockquote}}\n\n---\n**Captured on:** {{time}}', 132 | "properties": [ 133 | {"name": "title", "value": "{{title}}", "type": "text"}, 134 | {"name": "source", "value": "{{url}}", "type": "text"}, 135 | {"name": "tags", "value": "web-clip, summary", "type": "multitext"} 136 | ], 137 | "triggers": [], 138 | "noteNameFormat": "{{title}}", 139 | "path": "Clippings/Summaries" 140 | } 141 | }, 142 | { 143 | "name": "Custom Research & AI Insights", 144 | "filename": "Custom_Research_AI_Insights.json", 145 | "subfolder": os.path.join("Clippings", "Research"), 146 | "content_dict": { 147 | "schemaVersion": "0.1.0", 148 | "name": "Custom Research & AI Insights", 149 | "behavior": "create", 150 | "noteContentFormat": '## Research Insights\n{{"Extract key research and AI insights from this page concisely."|blockquote}}\n\n---\n**Captured on:** {{time}}\n\n## Full Content\n{{fullHtml|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}', 151 | "properties": [ 152 | {"name": "title", "value": "{{title}}", "type": "text"}, 153 | {"name": "source", "value": "{{url}}", "type": "text"}, 154 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 155 | {"name": "published", "value": "{{published}}", "type": "date"}, 156 | {"name": "created", "value": "{{date}}", "type": "date"}, 157 | {"name": "tags", "value": "web-clip, research, AI", "type": "multitext"} 158 | ], 159 | "triggers": [], 160 | "noteNameFormat": "{{title}}", 161 | "path": "Clippings/Research" 162 | } 163 | }, 164 | { 165 | "name": "Custom Translation", 166 | "filename": "Custom_Translation.json", 167 | "subfolder": os.path.join("Clippings", "Translations"), 168 | "content_dict": { 169 | "schemaVersion": "0.1.0", 170 | "name": "Custom Translation", 171 | "behavior": "create", 172 | "noteContentFormat": '## Original Content\n{{fullHtml|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n## Translated Content\n{{"Translate the above content into [Target Language] in clear, concise Markdown."|blockquote}}\n\n---\n**Captured on:** {{time}}', 173 | "properties": [ 174 | {"name": "title", "value": "{{title}}", "type": "text"}, 175 | {"name": "source", "value": "{{url}}", "type": "text"}, 176 | {"name": "tags", "value": "web-clip, translation", "type": "multitext"} 177 | ], 178 | "triggers": [], 179 | "noteNameFormat": "{{title}}", 180 | "path": "Clippings/Translations" 181 | } 182 | }, 183 | { 184 | "name": "Custom News/Blog Article", 185 | "filename": "Custom_News_Blog_Article.json", 186 | "subfolder": os.path.join("Clippings", "Articles"), 187 | "content_dict": { 188 | "schemaVersion": "0.1.0", 189 | "name": "Custom News/Blog Article", 190 | "behavior": "create", 191 | "noteContentFormat": '## Article Content\n{{selectorHtml:article|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 192 | "properties": [ 193 | {"name": "title", "value": "{{title}}", "type": "text"}, 194 | {"name": "source", "value": "{{url}}", "type": "text"}, 195 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 196 | {"name": "published", "value": "{{published}}", "type": "date"}, 197 | {"name": "tags", "value": "web-clip, news, blog", "type": "multitext"} 198 | ], 199 | "triggers": [], 200 | "noteNameFormat": "{{title}}", 201 | "path": "Clippings/Articles" 202 | } 203 | }, 204 | { 205 | "name": "Custom Highlights Only", 206 | "filename": "Custom_Highlights_Only.json", 207 | "subfolder": os.path.join("Clippings", "Highlights"), 208 | "content_dict": { 209 | "schemaVersion": "0.1.0", 210 | "name": "Custom Highlights Only", 211 | "behavior": "create", 212 | "noteContentFormat": '{{highlights|map: item => item.text|join:"\\n\\n"}}\n\n---\n**Captured on:** {{time}}', 213 | "properties": [ 214 | {"name": "title", "value": "{{title}}", "type": "text"}, 215 | {"name": "source", "value": "{{url}}", "type": "text"}, 216 | {"name": "tags", "value": "web-clip, highlights", "type": "multitext"} 217 | ], 218 | "triggers": [], 219 | "noteNameFormat": "{{title}}", 220 | "path": "Clippings/Highlights" 221 | } 222 | }, 223 | { 224 | "name": "GitHub Page", 225 | "filename": "GitHub_Page.json", 226 | "subfolder": os.path.join("Clippings", "GitHub"), 227 | "content_dict": { 228 | "schemaVersion": "0.1.0", 229 | "name": "GitHub Page", 230 | "behavior": "create", 231 | "noteContentFormat": '{{fullHtml|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 232 | "properties": [ 233 | {"name": "title", "value": "{{title}}", "type": "text"}, 234 | {"name": "source", "value": "{{url}}", "type": "text"}, 235 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 236 | {"name": "published", "value": "{{published}}", "type": "date"}, 237 | {"name": "created", "value": "{{date}}", "type": "date"}, 238 | {"name": "description", "value": "{{description}}", "type": "text"}, 239 | {"name": "tags", "value": "web-clip, github", "type": "multitext"} 240 | ], 241 | "triggers": [ 242 | "startsWith:https://github.com/" 243 | ], 244 | "noteNameFormat": "{{title}}", 245 | "path": "Clippings/GitHub" 246 | } 247 | }, 248 | { 249 | "name": "Medium Article", 250 | "filename": "Medium_Article.json", 251 | "subfolder": os.path.join("Clippings", "Medium"), 252 | "content_dict": { 253 | "schemaVersion": "0.1.0", 254 | "name": "Medium Article", 255 | "behavior": "create", 256 | "noteContentFormat": '{{selectorHtml:article|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 257 | "properties": [ 258 | {"name": "title", "value": "{{title}}", "type": "text"}, 259 | {"name": "source", "value": "{{url}}", "type": "text"}, 260 | {"name": "tags", "value": "web-clip, medium", "type": "multitext"} 261 | ], 262 | "triggers": [ 263 | "startsWith:https://medium.com/" 264 | ], 265 | "noteNameFormat": "{{title}}", 266 | "path": "Clippings/Medium" 267 | } 268 | }, 269 | { 270 | "name": "Research / Academic", 271 | "filename": "Research_Academic.json", 272 | "subfolder": os.path.join("Clippings", "Research"), 273 | "content_dict": { 274 | "schemaVersion": "0.1.0", 275 | "name": "Research / Academic", 276 | "behavior": "create", 277 | "noteContentFormat": '## Abstract\n{{selectorHtml:#abstract|remove_html:("header,footer,nav")|markdown}}\n\n---\n## Full Content\n{{fullHtml|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 278 | "properties": [ 279 | {"name": "title", "value": "{{title}}", "type": "text"}, 280 | {"name": "source", "value": "{{url}}", "type": "text"}, 281 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 282 | {"name": "published", "value": "{{published}}", "type": "date"}, 283 | {"name": "created", "value": "{{date}}", "type": "date"}, 284 | {"name": "tags", "value": "web-clip, research, academic", "type": "multitext"} 285 | ], 286 | "triggers": [ 287 | "startsWith:https://arxiv.org/", 288 | "startsWith:https://www.researchgate.net/", 289 | "regex:/.*(research|journal|paper).*/i" 290 | ], 291 | "noteNameFormat": "{{title}}", 292 | "path": "Clippings/Research" 293 | } 294 | }, 295 | { 296 | "name": "Article / Blog", 297 | "filename": "Article_Blog.json", 298 | "subfolder": os.path.join("Clippings", "Articles"), 299 | "content_dict": { 300 | "schemaVersion": "0.1.0", 301 | "name": "Article / Blog", 302 | "behavior": "create", 303 | "noteContentFormat": '{{selectorHtml:article|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 304 | "properties": [ 305 | {"name": "title", "value": "{{title}}", "type": "text"}, 306 | {"name": "source", "value": "{{url}}", "type": "text"}, 307 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 308 | {"name": "published", "value": "{{published}}", "type": "date"}, 309 | {"name": "tags", "value": "web-clip, article, blog", "type": "multitext"} 310 | ], 311 | "triggers": [ 312 | "regex:/^https:\\/\\/(www\\.)?(nytimes|techcrunch|theverge|blogspot|medium)\\./i" 313 | ], 314 | "noteNameFormat": "{{title}}", 315 | "path": "Clippings/Articles" 316 | } 317 | }, 318 | { 319 | "name": "Generic Web Clip", 320 | "filename": "Generic_Web_Clip.json", 321 | "subfolder": os.path.join("Clippings", "Generic"), 322 | "content_dict": { 323 | "schemaVersion": "0.1.0", 324 | "name": "Generic Web Clip", 325 | "behavior": "create", 326 | "noteContentFormat": '{{fullHtml|remove_html:("header,footer,nav,aside,.ad,.advertisement")|markdown}}\n\n---\n**Captured on:** {{time}}', 327 | "properties": [ 328 | {"name": "title", "value": "{{title}}", "type": "text"}, 329 | {"name": "source", "value": "{{url}}", "type": "text"}, 330 | {"name": "author", "value": '{{author|split:", "|wikilink|join}}', "type": "multitext"}, 331 | {"name": "published", "value": "{{published}}", "type": "date"}, 332 | {"name": "created", "value": "{{date}}", "type": "date"}, 333 | {"name": "description", "value": "{{description}}", "type": "text"}, 334 | {"name": "tags", "value": "web-clip, generic", "type": "multitext"} 335 | ], 336 | "triggers": [ 337 | "default" 338 | ], 339 | "noteNameFormat": "{{title}}", 340 | "path": "Clippings/Generic" 341 | } 342 | } 343 | ] 344 | 345 | # Documentation text for importing templates into Obsidian WebClipper 346 | IMPORT_GUIDANCE = '''Obsidian WebClipper Template Import Guidance 347 | ============================================= 348 | 349 | The following steps will help you import the JSON templates into Obsidian WebClipper: 350 | 351 | 1. Open your Obsidian Vault in your file explorer. The vault root is the folder you specified when running this script. 352 | 2. Within the vault, you will see a “Clippings” folder with various sub-folders (e.g. Summaries, Research, Translations, Articles, Highlights, GitHub, Medium, and Generic) and a central repository folder at Clippings/TEMPLATES. 353 | 3. In your web browser (Chrome or compatible), open the Obsidian WebClipper extension settings. 354 | 4. Look for the option to “Import Templates” (or similar). 355 | 5. When prompted, navigate to the vault root and then drill down to the appropriate subfolder or to Clippings/TEMPLATES to select the JSON template file(s) you wish to import. 356 | 6. Follow any on‑screen instructions to complete the import. 357 | 7. Once imported, these templates will be available within the WebClipper for creating new notes directly in your Obsidian Vault. 358 | 359 | For any questions or troubleshooting, consult the Obsidian WebClipper documentation or support resources. 360 | ''' 361 | 362 | def main(): 363 | try: 364 | # Prompt user for vault root path 365 | vault_root = input("Enter the VAULT-ROOT-PATH where templates should be generated: ").strip() 366 | if not vault_root: 367 | print("Error: No path provided. Exiting.") 368 | sys.exit(1) 369 | if not os.path.isdir(vault_root): 370 | create = input(f"Directory '{vault_root}' does not exist. Create it? (y/n): ").strip().lower() 371 | if create == 'y': 372 | os.makedirs(vault_root, exist_ok=True) 373 | print(f"Created directory: {vault_root}") 374 | else: 375 | print("Aborted by user.") 376 | sys.exit(1) 377 | 378 | # Create central repository folder for cloning templates 379 | repo_folder = os.path.join(vault_root, "Clippings", "TEMPLATES") 380 | os.makedirs(repo_folder, exist_ok=True) 381 | 382 | # Process each template: write to designated folder and clone into repo_folder 383 | for tpl in TEMPLATES: 384 | target_dir = os.path.join(vault_root, tpl["subfolder"]) 385 | os.makedirs(target_dir, exist_ok=True) 386 | file_path = os.path.join(target_dir, tpl["filename"]) 387 | content_json = json.dumps(tpl["content_dict"], indent=2, ensure_ascii=False) 388 | with open(file_path, "w", encoding="utf-8") as f: 389 | f.write(content_json) 390 | print(f"Created template '{tpl['name']}' at: {file_path}") 391 | 392 | # Clone into central repository 393 | clone_path = os.path.join(repo_folder, tpl["filename"]) 394 | with open(clone_path, "w", encoding="utf-8") as f: 395 | f.write(content_json) 396 | print(f"Cloned template '{tpl['name']}' into repository at: {clone_path}") 397 | 398 | # Write the import guidance documentation at the vault root 399 | guidance_path = os.path.join(vault_root, "README_IMPORT_GUIDANCE.txt") 400 | with open(guidance_path, "w", encoding="utf-8") as f: 401 | f.write(IMPORT_GUIDANCE) 402 | print(f"\nCreated import guidance documentation at: {guidance_path}") 403 | print("\nAll templates generated and cloned successfully.") 404 | 405 | except Exception as e: 406 | print(f"An error occurred: {e}") 407 | sys.exit(1) 408 | 409 | if __name__ == "__main__": 410 | main() 411 | --------------------------------------------------------------------------------