Giter Club home page Giter Club logo

obsidian_utils's Introduction

Obsidian Utils

Various scripts and utilities for Obsidian.md

Usage

journal.rb

To run:

ruby journal.rb

Journal.rb simply creates a file following the YYYY-MM-DD.md naming convention that Obsidian uses for daily notes. This file will be created in your notes directory following a template that's listed in the script. Currently, it pulls some weather data from Environment Canada, adds some boilerplate tasks for the day, and embeds links to the previous five days of daily notes.

Note that it will not overwrite the daily note for today if it already exists. It will only ever append to it.

todo.rb

To run:

ruby todo.rb

Todo.rb will loop through all of the markdown files in your notes directory (including subdirectories) to find any lines that follow the syntax for empty checklists. Then it writes them all (as a copy, not an embed) to a file called TODO.md in your notes directory.

This script will work for the *, -, and + bullet syntaxes in Markdown.

* [ ] This is a todo
- [ ] This is a todo
+ [ ] This is a todo

NOTE - this script overwrites the TODO.md file each time it is run. If you manually write any notes to TODO.md and then run this script, those notes will be lost.

clean.rb

To run:

ruby clean.rb

Clean.rb will loop through all ofthe markdown files in your notes directory (including subdirectories) to find any files that are both 1) empty (filesize = zero), and 2) unlinked in any other note. If it finds notes that fit those criteria, it deletes them from your filesystem.

NOTE - this script is intentionally destructive! It is highly recommended that you have your notes under version control or backed up somehow before runing this script. Cleaned files are not moved to the trash - they are immediately deleted!

How to run Ruby scripts

You'll need to have ruby installed on your machine. Type ruby -v to see if it's already set up. If you need to install it, check out https://www.ruby-lang.org/en/documentation/installation/

Once you have ruby installed, you should be able to execute any of the scripts by going to the directory where the script is stored and typing ruby scriptname.rb, replacing scriptname.rb with the actual name of the script i.e. journal.rb or todo.rb.

Notes

  • Back up your vault before executing any of these scripts! They might be destructive and could wipe out all of your notes.
  • I keep all of my notes in one folder that's in a Notes folder in my home folder. I try to keep a variable for the notes_path in each of the scripts that you can edit for your local setup.

Disclaimer

Note that I've built all of these for my own use. Weather is for my local city, pathing is for my machine. You may need to fork the repo and update the scripts for your own use. Buyer beware! I try to make the scripts as safe as I can, but I won't take responsibility if your notes get deleted or overwritten by these scripts.

obsidian_utils's People

Contributors

mm53bar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

obsidian_utils's Issues

Add cli arg for note_path

I think we should be able to pass the path of the notes folder as a cli argument to the scripts

something like this
ruby todo.rb ~/my_notes_path

Adapting todo.rb to done.rb

Thank you so much for these amazing utilities. I am using Obsidian.md in a non-traditional way -- to take meeting minutes, business notes, and manage todos.

I am successfully using todo.rb to aggregate all of my todos from various notes into one place.

I am trying to modify the script for a done.md file, which would return everything with "-[x]" instead of just "- [ ]".

Any tips or advice on how to do this would be appreciated. I am currently looking at todo.rb lines 16-26 to try and find this out on my own.

Convert the date format in recent.rb

Hello Sir,

Thank you so much @mm53bar for this wonderful script. Especially the recent.rb and todo.rb .
This is a Feature Request. I just want to change the date format from YYYY-MM-DD in the recent .rb to DD-MM-YYYY .
I am not a developer. If you could do this, it will be a great help.

Kudos to your efforts. Really appreciate it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.