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
.
Configuration
The first step is to configure the app.
- Browse for your Obsidian's vault path.
- Create a folder where you can store everything related to downloaded's snippet. This folder can be everywhere on your computer, including in your
.obsidian/snippets
. - Browse the "Folder Manager" and look for the new created folder.
- Click on save !
Limitation of executable release
Information about executable release:
- It will don't install the CLI command, so you won't have the Obsidian-Shell auto-update.
- The executable don't use the same environment file as the package : You need to configure two times if you use the two (CLI + executable released)
- Delete the release delete the environment file. Beware when you update your executable.
You can select the files you want to update or clone. Also, you can only use some specific file from update, instead of entire folder. You can exclude them from futur update using the exclude button.
Note about windows alert
For some reason, windows will warn you about untrustable executable. Also, it's possible that your antivir' doesn't like it either. The executable is built using GitHub Action : I don't touch it. You can, also, check every file in the download if you don't trust me. The only data send to internet is for git clone and push.
The (short) story about certification and untrustable executable : Microsoft want me to pay a lot to sign a little executable. More information about signing on Microsoft Docs
A free signing will always force end-user to manually install the certificate on their machine
If you don't trust me : You can build yourself the executable using :
pyinstaller Obsidian_Snippeter/GUI.py --name "Obsidian-Snippet-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*;Obsidian_Snippeter/src/gui_bin/' --distpath artifact
after cloning.
You will see the same error.
I have too this error.
(Note that you won't see it using the terminal commands 😊)
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 [repository_url] --excluded
This command work also for file :obsnipe clone [repository_url] --excluded file.css
. This file will be added toexclude.yml
. - Updating everything :
obsnipe
- Updating only a repository :
obsnipe update folder_name
The folder name is the folder that you wish to update the snippet!
Also, you can update only a specific file withobsnipe update [foldername] --only [filename]
The script will :
- Git pull
- Git move every
.css
(unless the excluded) file in your.obsidian/snippet
folder.
Other function
obsnipe list
: List all GitHub Repository you download.obsnipe exclude [folder_name]
: Exclude a folder or a css snippet from update. You can exclude multiple value using :obsnipe exclude [folder1] [filename2]
Using-add [filename][folder]
will add these file inexclude.yml
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
File details
Details for the file Obsidian_Snippet_Manager-2.3.2.tar.gz
.
File metadata
- Download URL: Obsidian_Snippet_Manager-2.3.2.tar.gz
- Upload date:
- Size: 30.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fd03e8f86a68ec6ee317acad649767988d6c8cb46b9752c69a131d8d37e1563 |
|
MD5 | 13eb5f21ffce01f533482b8c4dbdca13 |
|
BLAKE2b-256 | 7cf60fc42f524cd132fc45e11b2acb007bdbf7f7a973257b22f794c76d0470df |
File details
Details for the file Obsidian_Snippet_Manager-2.3.2-py3-none-any.whl
.
File metadata
- Download URL: Obsidian_Snippet_Manager-2.3.2-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a4da8a38266f23c66de0131ed841e63153ae936caa8ffd8ba723d13f4d561cd |
|
MD5 | c4bc7c1dd295dd9c270d9ec3e5eb8104 |
|
BLAKE2b-256 | 621392159610992ff09737e6ef073f40d2cd24cef786e0ae271e2ee6181db824 |