A script to magically update your obsidian snippets hosted on github.
Project description
Obsidian Snippet Manager is a python script that git pull and move CSS file in your .obsidian/snippet
folder.
The goal is to provide a practical way to get semi-auto-update from CSS snippet hosted on GitHub, in waiting of an eventual BRAT update that support that.
Get started
Requirements
GUI
You can use the application with an interface, using (in terminal): snipetter
.
Alternatively, you can download and unzip the latest release for your OS. But, beware : the exe prevent you to get the cli command, so you can't use the autoupdate from obsidian-shell. Also, the release executable will don't save the environment file at the same place of the package, so you need to save it before update it !
CLI
Environment
The plugin needs :
- The absolute path of your vault, as :
G:\Drive\Vault
- A folder that contains all the snippet you want to get the update.
This folder can be everywhere on your computer (yes, it can be in
.obsidian
too.). It will contain all folder of the snippet hosted on GitHub you want to use.
In case of the folder doesn't exist, the script will create it!
How to use
- Adding a new repo :
obsnipe clone repository_url
Additionally, you can exclude a folder from update with adding the--exclude
command :obsnipe clone --excluded [repository_url]
- Updating everything :
obsnipe
- Updating only a repository :
obsnipe update folder_name
The folder name is the folder that you wish to update the snippet!
The script will :
- Git pull
- Git move every
.css
file in your.obsidian/snippet
folder.
Other function
obsnipe list
: List all GitHub Repository you download.obsnipe exclude [folder_name]
: Exclude a folder from update. You can exclude multiple value using :obsnipe exclude [folder1] [folder2]
Note : You can exclude a folder from auto-update using the exclude.yml
file, placed in your Snippet Manager folder.
You need to add the folder name as a yaml list :
- foldername1
- foldername2
Example
Using Obsidian Snippets Collection
- Configuration :
- Vault is in :
G:/Drive/vault
- My Obsidian Manager Folder is in :
D:/Documents/Github/Snippets Manager
- Vault is in :
obsnipe clone https://github.com/Mara-Li/Obsidian-Snippet-collection
- Activate the snippets 🎉
To update this specific snippet : obsnipe update Obsidian-Snippet-collection
In obsidian
You can create a command in Obsidian using Obsidian Shell.
Bonus, you can update your snippet every time obsidian start, like BRAT!
⚠️ WARNING : Every edit on a snippet downloaded by this way will break the script. Please, DON'T EDIT these file, and use another snippet. (Or, use a fork and commit before.)
Credit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Obsidian_Snippet_Manager-2.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b83b8545bea1486b94f6044a165e368f595f3091bea18801013292cb92344098 |
|
MD5 | ee876cdd5d0fde4d98b4854568f0ffc4 |
|
BLAKE2b-256 | c75724ca1b3782ad4ea74c03f29aaa4deff8e4088151bbbbb2da169393d6e126 |
Hashes for Obsidian_Snippet_Manager-2.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a211e317ed4c6bd5ad0a20ea9eec04d0f6b4fd3a41fd682a4a521deba0da12c |
|
MD5 | 4560f732df176f8299edecaccaff968e |
|
BLAKE2b-256 | da60061b15e114168d525f657134476be0bccfc35f082b7da1d6e285fab8a05c |