Skip to main content

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 pratical way to get semi-auto-update from css snippet hosted on github, in waiting of an eventually BRAT update that support that.

Get started

Requirements

  1. Git
  2. Python
  3. pip install Obsidian-Snippet-Manager

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

  1. Adding a new repo : obsnipe clone repository_url
    Additionnaly you can exclude a folder from update with adding the --exclude command : obsnipe clone --excluded [repository_url]
  2. Updating everything : obsnipe
  3. Updating only a repository : obsnipe update folder_name The foldername is the folder that you want 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 folder from auto update using the exclude.yml file, placed in your Snipper Manager folder.

Example

Using Obsidian Snippets Collection

  1. Configuration :
    • Vault is in : G:/Drive/vault
    • My Obsidian Manager Folder is in : D:/Documents/Github/Snippets Manager
  2. obsnipe --add https://github.com/Mara-Li/Obsidian-Snippet-collection
  3. Active the snippets 🎉

To update this specific snippet : obsnipe update Obsidian-Snippet-collection

In obsidian

You can create a commmand in Obsidian using Obsidian Shell.

Bonus, you can update your snippet everytime obsidian start, like BRAT !

⚠️ WARNING : Every edit on 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 !)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Obsidian_Snippet_Manager-1.1.0.tar.gz (115.1 kB view hashes)

Uploaded Source

Built Distribution

Obsidian_Snippet_Manager-1.1.0-py3-none-any.whl (20.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page