Skip to content

Instantly share code, notes, and snippets.

View FeralFlora's full-sized avatar

FeralFlora

View GitHub Profile
@FeralFlora
FeralFlora / insertBlockEmbed.js
Last active February 28, 2025 13:39
Function for Obsidian that returns the block link and embed of a task passed as a dataview task object
async function processFile(file, line, blockID) {
const cachedData = await app.vault.cachedRead(file);
return app.vault.process(file, (data) => {
if (cachedData !== data) {
data = cachedData;
}
let lines = data.split("\n");
lines[line] += ` ^${blockID}`;
data = lines.join("\n");
@FeralFlora
FeralFlora / GTD nextActions.js
Last active February 28, 2025 13:32
Function for Obsidian to return tasks with GTD tags like #todo/next-action, then #todo/inbox if no tasks were found with the first tag, and so on.
async function nextActions(userTag = null) {
let actionTags = ["todo/next-action", "todo/inbox", "todo/someday-maybe"]
// const exclusion = "";
let nextActions;
let chosenTag = "";
if (userTag) {
actionTags.unshift(userTag);
};
for (const tag of actionTags) {
nextActions = await runQuery(tag);
@FeralFlora
FeralFlora / readme.md
Last active March 4, 2025 12:44
Task toggling function for Obsidian tasks. Useful for bulk editing tasks to toggle status, change tags and the scheduled date.

Works on Dataview task objects (for example dervied from nextActions.js) and toggles status, tags and scheduled dates of markdown tasks. Preserves Obsidian block IDs at the end of lines.

Toggles tasks done using the executeToggleTaskDoneCommand API of the Tasks plugin for Obsidian.

@FeralFlora
FeralFlora / kanban-maker-quickadd.js
Last active February 14, 2025 12:55
A Kanban generating script that uses tags to merge Zotero items into lists of a Kanban board in Obsidian, and updates the reading statuses of items in the process 🚀 Setup and usage guide: https://share.note.sx/e612da498b038c3e5e367043782e2b59 Need support? Head to https://discord.com/channels/686053708261228577/1176414557900648541 or comment below.
/*
* Zotero Kanban Reading List by FeralFlora // https://github.com/FeralFlora/
* Version 1.6.1
* Setup and usage guide at: https://share.note.sx/e612da498b038c3e5e367043782e2b59
* Support at: https://discord.com/channels/686053708261228577/1176414557900648541
*/
const fs = require('fs');
const KANBAN_PATH = "Kanban board file path";
const BIBLIOGRAPHY_PATH = "Bibliography file path";
@FeralFlora
FeralFlora / 01 Zotero Integration import template and more!.md
Last active March 14, 2025 15:56
Zotero import template for the Zotero integration plugin for Obsidian. Screenshots and usage guide over in the Obsidian forum here: https://forum.obsidian.md/t/zotero-integration-import-templates/36310/105?u=feralflora
  • ZI-main.md
    • The main Zotero Integration template
  • runImport.md
    • Template that enables updating literature notes at the click of a button, and much more.
  • Meta bind button template
    • Template for in-note button that executes runImport.md