Skip to content

Instantly share code, notes, and snippets.

@GitMurf
GitMurf / RemNote-css-block-quotes.css
Created March 1, 2023 02:00
RemNote CSS for block quotes
/* line up quotes with other bullets */
span.rem.relative.rn-editor__rem.rn-quote,
div.rem.relative.rn-editor__rem.rn-quote {
padding-left: 0px;
margin-left: -4px;
}
span.rem.relative.rn-editor__rem.rn-quote > div > div.rem-button__container,
div.rem.relative.rn-editor__rem.rn-quote > div.rem-button__container {
left: -48px !important;
@GitMurf
GitMurf / RemNote-css-reference-links-formattings.css
Created March 1, 2023 01:57
Custom CSS for tweaking the formatting of Rem references, URL links and pasted website links.
@GitMurf
GitMurf / obsidian.templater.operation.outliner.select-list-items.js
Last active October 1, 2023 18:00
Add a couple Outliner capability features to Obsidian's native list handling: Hotkey to select all text in current bullet, select all children bullets, select entire line of non list item text.
<%*
const editor = app.workspace.activeLeaf.view.editor;
const getCurSelection = editor.getSelection();
const getCur = editor.getCursor("from");
const curLineNo = getCur.line;
const curLineText = editor.getLine(curLineNo);
const matchBullet = curLineText.match(/^[ \t]*[-\*] (.*)/);
let foundContent = "";
if(matchBullet) {
foundContent = matchBullet[1];
<%*
// v0.1
/* START OF USER DEFINED SETTINGS */
// template to use
const templateFolder = "templates";
const templateName = "template_anthony.md";
// creating the new file
const newFileFolder = "test/meetings";
const openNewFile = false;
@GitMurf
GitMurf / obsidian.templater.query.section.keyword-page-name.js
Created May 30, 2022 05:53
When using headings with a [[page name]] in it, create a "search embed query" with all those headings expanded
<%*
const noteName = tp.file.title;
let queryKeyword = await tp.system.prompt("Keyword for Section search query (do NOT add [ ] brackets around it)", noteName);
if(queryKeyword) {
// Un-comment the next line if you want the keyword to require [] brackets around it for backlinks matching purposes
queryKeyword = `\\[\\[${queryKeyword}[\\|\\]]`; // the | pipe check accounts for alias links
tR = `
# Keyword Section Query
\`\`\`query
<%*
let startDate = await tp.system.prompt('Start Date');
let endDate = await tp.system.prompt('End Date');
const nlDatesPlugin = app.plugins.getPlugin('nldates-obsidian');
function getNldDate(nlDatesPlugin, dateString) {
let parseResultLink = null;
let parseResult = nlDatesPlugin.parseDate(dateString);
if(parseResult){ parseResultLink = parseResult.formattedString };
if(parseResultLink === "Invalid date") { parseResultLink = null }
<%*
//Set to false if you do NOT want to ask for a custom title or whether foldable or not
const bCustomTitle = true;
const bFoldable = true;
const calloutOptions = ['note', 'abstract', 'summary', 'tldr', 'info', 'todo', 'tip', 'hint', 'important', 'success', 'check', 'done', 'question', 'help', 'faq', 'warning', 'caution', 'attention', 'failure', 'fail', 'missing', 'danger', 'error', 'bug', 'example', 'quote', 'cite'];
let calloutType = await tp.system.suggester(calloutOptions, calloutOptions, false);
if(!calloutType) { return };
calloutType = calloutType.toUpperCase();
<%*
const search = app.workspace.getLeavesOfType("search")[0];
let keyword = await tp.system.prompt('Keyword', '[' + '[Journal');
keyword = keyword.replace(/(\[|\])/g, "\\$1");
const searchQuery = `section:(/^#+ ${keyword}.*\\n+\\S[\\s\\S]*[^\\n]/) OR section:(/^#+ ${keyword}.*/ section:(/[\\s\\S]*[^\\n]/))`;
//Collapse=true, Expand=false
search.view.setCollapseAll(false);
//Show Extra Context: true or false
search.view.setExtraContext(false);
//SortOrder Options: alphabeticalReverse, alphabetical, byModifiedTime, byModifiedTimeReverse, byCreatedTime, byCreatedTimeReverse