This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
const search = app.workspace.getLeavesOfType("search")[0]; | |
const editor = app.workspace.activeLeaf.view.editor; | |
const getCur = editor.getCursor(); | |
const curLineNum = getCur.line; | |
const curPos = getCur.ch; | |
let thisFile = app.workspace.getActiveFile(); | |
let mdCache = this.app.metadataCache.getFileCache(thisFile); | |
let mdLinks = mdCache.links; | |
if (mdLinks) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v0.2 - bug fix: when search results match just a file name and no line contents under it | |
//User can set the following two parameters | |
const resultFilePrefix = '## '; | |
const folderLocation = '/search'; | |
const search = app.workspace.getLeavesOfType("search")[0]; | |
const searchTerms = search.view.getQuery(); | |
const arrCount = Array.from(search.view.dom.resultDomLookup); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Blocks refs and [[refs]] are the same in RemNote */ | |
body.light .rn-editor-container .rem-reference-container:not([data-rem-tags*="link"]):not([data-rem-tags*="daily-document"]) > span > .rn-rem-reference.rem-reference.button, | |
body.light .rn-editor-container .rem-reference-container:not([data-rem-tags*="link"]):not([data-rem-tags*="daily-document"]) > .rn-rem-reference.rem-reference.button { | |
color: unset; | |
border-radius: 0px; | |
border-bottom: 1px dashed black; | |
padding-bottom: 1px; | |
} | |
/* fix for Template Slots */ | |
body.light .rn-editor-container .rem-reference-container:not([data-rem-tags*="link"]) .rn-rem-reference.rem-reference.button .\!not-italic.rem-reference--pdf-highlight { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Default font-family and default 16 size */ | |
:root { | |
--bullet-one: '●'; | |
--bullet-one-pos-top: 5px; | |
--bullet-one-size: 9px; | |
--bullet-two: '■'; | |
--bullet-two-pos-top: 5px; | |
--bullet-two-size: 9px; | |
--bullet-three: '○'; | |
--bullet-three-pos-top: 3px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
const editor = app.workspace.activeLeaf.view.editor; | |
if(editor.somethingSelected() === true) { | |
let selectedText = editor.getSelection(); | |
let splitLines = selectedText.split('\n'); | |
let finalOutput = ''; | |
let listItem = false; | |
let codeBlock = false; | |
splitLines.forEach(eachLine => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.1: Changed to using the new "view.editor" instead of deprecated "view.sourceMode.cmEditor" | |
let thisFile = this.app.workspace.getActiveFile(); | |
let thisFileCache = this.app.metadataCache.getFileCache(thisFile); | |
let embedsOnPage = thisFileCache.embeds; | |
if(embedsOnPage) { | |
let cmEditorAct = this.app.workspace.activeLeaf.view.editor; | |
let curLine = cmEditorAct.getCursor().line; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.0 | |
let dueDateStr = await tp.system.prompt("Due Date"); | |
let parseResult; | |
let parseResultLink; | |
if(dueDateStr) { | |
let nlDatesPlugin = this.app.plugins.getPlugin('nldates-obsidian'); | |
parseResult = nlDatesPlugin.parseDate(dueDateStr); | |
if(parseResult){parseResultLink = '[' + '[' + parseResult.formattedString + ']]';} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
const search = app.workspace.getLeavesOfType("search")[0]; | |
const dnp = tp.date.now('YYYY-MM-DD'); | |
const dnp2 = tp.date.now('YYYY_MM_DD'); | |
search.view.setSortOrder("byCreatedTime"); | |
search.view.setCollapseAll(false); | |
search.view.setExtraContext(true); | |
//looking for backlinks only | |
let finalQuery = `/\\[\\[${dnp}(\\]\\]|\\|)/`; | |
//Optional - looking for date with underscores too |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
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 |