<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Read with AI 📖⚡️🖋️: Obsidian+PR Cookbook]]></title><description><![CDATA[How to do various things with Obsidian and Plugin Repl]]></description><link>https://readwithai.substack.com/s/cookbook</link><image><url>https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png</url><title>Read with AI 📖⚡️🖋️: Obsidian+PR Cookbook</title><link>https://readwithai.substack.com/s/cookbook</link></image><generator>Substack</generator><lastBuildDate>Sat, 02 May 2026 16:28:41 GMT</lastBuildDate><atom:link href="https://readwithai.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Read with ai]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[readwithai@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[readwithai@substack.com]]></itunes:email><itunes:name><![CDATA[Read with ai]]></itunes:name></itunes:owner><itunes:author><![CDATA[Read with ai]]></itunes:author><googleplay:owner><![CDATA[readwithai@substack.com]]></googleplay:owner><googleplay:email><![CDATA[readwithai@substack.com]]></googleplay:email><googleplay:author><![CDATA[Read with ai]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Quickly jumping to Obsidian from anywhere on your desktop]]></title><description><![CDATA[@readwithai - X - blog - machine-aided reading]]></description><link>https://readwithai.substack.com/p/quickly-jumping-to-obsidian-from</link><guid isPermaLink="false">https://readwithai.substack.com/p/quickly-jumping-to-obsidian-from</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Wed, 16 Apr 2025 16:50:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>@readwithai</strong> - <strong><a href="https://x.com/readwithai">X</a></strong> - <strong><a href="https://readwithai.substack.com/">blog</a></strong> - <strong><a href="https://www.reddit.com/r/machineAidedReading/">machine-aided reading</a></strong></p><p>This is part of my <strong><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian and Plugin REPL Cookbook</a></strong></p><p>A key feature of my Obsidian setup (though not the default one!) is being able to quickly open the Obsidian window while doing other things. This allows me to do <a href="https://readwithai.substack.com/p/drive-by-note-taking-in-obsidian">quick one-off note taking</a>. To do this I have a global desktop hotkey which pops up the Obsidian window.</p><p>This isn&#8217;t supported out of the box but is provided by <a href="https://github.com/dragonwocky/obsidian-tray">the Tray Plugin</a>. To install this go to settings  (Ctrl + ,) then community plugins, enable community plugins, search for the tray plugin, and install it then enable it. If you go to its settings (again in settings Ctrl + ,) you will find it has a setting for Toggle window focus hotkey. </p><p>Tray works pretty well. At the time of writing it has one bug where if you reload Obsidian (which can be quite common when developing plugins) it creates multiple icons in the tray and the hotkey stops working. You can fix this by exiting Obsidian and starting it again. Because of this - and because I tend to have <a href="https://readwithai.substack.com/p/shortcuts-to-jump-between-applications">hotkeys to switch between apps in general</a> I use a different approach on linux - but this requires you to use linux and have a bit of command-line knowledge. So if you aren&#8217;t doing plugin development Tray should work fine.</p><p>This is part of a cookbook on Obsidian and Plugin REPL plugin in the section on configuring basic Obsidian. You might like to <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">look at other recipes</a>.</p><p><em>I am not affiliated with Obsidian. I am the author of Plugin REPL</em></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Using NPM in JavaScript in Obsidian]]></title><description><![CDATA[This is part of a cookbook of tips and tricks in Obsidian by readwithai (X, blog)]]></description><link>https://readwithai.substack.com/p/using-npm-in-javascript-in-obsidian</link><guid isPermaLink="false">https://readwithai.substack.com/p/using-npm-in-javascript-in-obsidian</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Fri, 14 Mar 2025 19:10:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This is part of a <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of tips and tricks</a> in <a href="https://readwithai.substack.com/p/what-exactly-is-obsidian">Obsidian</a> by readwithai (<a href="https://x.com/readwithai">X</a>, <a href="https://readwithai.substack.com/">blog</a>)</em></p><p>It is possible to do JavaScript scripting in Obsidian in <a href="https://readwithai.substack.com/p/scripting-obsidian">various ways</a> (including using my plugin, <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a>) and this can do a lot of things. However, for some more complicated tasks it can be nice to use libraries that other people have created, which tend to be uploaded as <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">an NPM library</a>. Because of how Obsidian works - even though Obsidian has its own npm modules provided in a <strong>node_modules </strong>directory you cannot add to these modules. A work around is needed.</p><h1>How plugins do it</h1><p>One approach is to <a href="https://docs.obsidian.md/Home">use a plugin</a>. The way that plugins work is use a JavaScript bundler to include the source code for modules in the <strong>main.js </strong>that a plugin provides. This plugin can then provide access to this module - although it normally uses it internally. A nice trick here is to use the following syntax in TypeScript:</p><pre><code>import * as name from 'name'
...
this.name = name</code></pre><p>You can then hang <strong>name </strong>of  your plugin, and then get access to it from Obsidian using:</p><pre><code>app.plugins.plugins["my-id"].name</code></pre><h1>If you just want something that works</h1><p>However, you probably don&#8217;t want to create your own plugin every time you use a library. If you are doing your Obsidian JavaScript scripting with Plugin REPL then plugin repl provides a system to use plugins, <a href="https://docs.obsidian.md/Home">plugin REPL imports</a>. With this you can: check out a repo, add the NPM library to a list, run a command, and then you can use a funciton <strong>replRequire</strong> to get at the NPM library.</p><p>You can likely do something similar with <a href="https://docs.obsidian.md/Home">user scripts in Templater</a>.</p><h2>Finishing up</h2><p>I hope this is useful. If you found this intereting I might suggest you:</p><ol><li><p>Have a look at <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">some more recipes in my Obsidian cookbook</a></p></li><li><p>Read about <a href="https://readwithai.substack.com/p/scripting-obsidian">scripting in Obsidian</a>.</p></li><li><p>Read my <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">somewhat academic review of note taking in Obsidian</a>.</p></li></ol><p>You can also follow me on <a href="https://x.com/readwithai">X</a>, where I write about various things, or follow my <a href="https://readwithai.substack.com/">blog</a> where I mostly write about tools for reading and research.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Converting inline properties to frontmatter properties with a keypress in Obsidian]]></title><description><![CDATA[@readwithai - X - Obsidian Cookbook - Blog]]></description><link>https://readwithai.substack.com/p/converting-inline-properties-to-frontmatter</link><guid isPermaLink="false">https://readwithai.substack.com/p/converting-inline-properties-to-frontmatter</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Thu, 13 Mar 2025 20:56:31 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ef5ed6c2-61bd-400c-908e-af6f4491574e_802x434.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>@readwithai</strong> - <strong><a href="https://x.com/readwithai">X</a></strong> - <strong><a href="https://readwithai.substack.com/">blog</a> - <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian Cookbook</a></strong> - </p><div><hr></div><p>I use <a href="https://readwithai.substack.com/p/creating-typed-links-in-obsidian">properties as a form of typed link</a> in Obsidian which I then use to create <a href="https://readwithai.substack.com/p/slowly-turning-your-automated-maps">automated maps of content</a>. This all works pretty well but the inline typed links can be a little ugly and detract from the flow of a note.</p><pre><code>up:: [[Parent]]</code></pre><p>You could instead add this as a property to the beginning of the note but this can require too much clicking for those used to being able to do everything with a keyboard. </p><p>This is the sort of problem well suited to my plugin <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> where you can use a dash of JavaScript to make your life easier. </p><p>If you <a href="https://readwithai.substack.com/p/plugin-repl-executing-code">execute the following snippet</a> using Plugin REPL (after installing it) - by highlighting the code and running <strong>Plugin REPL: Execute the current line or selection</strong></p><pre><code>newCommand(function frontmatter_property(){
&#9;const [name, newValue] = lineAtPoint().split(/ *:: */)
&#9;if (!newValue) return
&#9;const old =  view.metadataEditor.properties[name]
&#9;if (view.metadataEditor.properties.filter((x) =&gt; x.key === name).length === 0) {
&#9;&#9;view.metadataEditor .insertProperties({[name]: newValue})
&#9;} else if (Array.isArray(value)) {
&#9;&#9;view.metadataEditor.insertProperties({[name]: [...old, newValue]})
&#9;}  else {
&#9;&#9;view.metadataEditor.insertProperties({[name]: [old, newValue]})
&#9;}
&#9;killLine()
})
</code></pre><p>You can then use the command <strong>Plugin REPL: frontmatter property </strong>to move an inline property to the frontmatter at the beginning of the file.</p><p>If you find this useful - you can run it every time Obsidian starts by <a href="https://readwithai.substack.com/p/plugin-repl-startup-file">adding it to your repl.md file</a>. </p><p>I did this using my plugin Plugin REPL, but there are other ways to run JavaScript which you <a href="https://readwithai.substack.com/p/adapting-plugin-repl-scripts-to-other">could use to adapt this script.</a></p><div><hr></div><p>This is part of a <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of useful things</a> you can do in Obsidian and with Plugin REPL (of which I am the author).</p><p>If you find this interesting and useful you might like to:</p><ol><li><p>Read this page about <a href="https://readwithai.substack.com/p/slowly-turning-your-automated-maps">how to make half-automated maps of content in Obsidian</a>.</p></li><li><p>Read this somewhat academic <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">review of  note taking in Obsidian</a>.</p></li><li><p>Look at <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">some of the other Obsidian tricks</a>.</p></li></ol><p>You can also follow me on <a href="https://x.com/readwithai">X</a> or my <a href="https://readwithai.substack.com">blog</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://readwithai.substack.com/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dQ2d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 424w, https://substackcdn.com/image/fetch/$s_!dQ2d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 848w, https://substackcdn.com/image/fetch/$s_!dQ2d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 1272w, https://substackcdn.com/image/fetch/$s_!dQ2d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dQ2d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png" width="128" height="192" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:192,&quot;width&quot;:128,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54288,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://readwithai.substack.com/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://readwithai.substack.com/i/159021958?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dQ2d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 424w, https://substackcdn.com/image/fetch/$s_!dQ2d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 848w, https://substackcdn.com/image/fetch/$s_!dQ2d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 1272w, https://substackcdn.com/image/fetch/$s_!dQ2d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97f46b9f-62ca-4683-8d5e-ec1927e3b22f_128x192.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Insert a link to the previous page in your history]]></title><description><![CDATA[This post is part of a cookbook of tricks for Obsidian, the markdown note taking app.]]></description><link>https://readwithai.substack.com/p/insert-a-link-to-the-previous-page</link><guid isPermaLink="false">https://readwithai.substack.com/p/insert-a-link-to-the-previous-page</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sat, 22 Feb 2025 16:22:30 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d40b1c84-fbbf-4b93-9e0a-f56442e73c78_772x439.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><strong>This post is part of a <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of tricks</a> for <a href="https://readwithai.substack.com/p/what-exactly-is-obsidian">Obsidian</a>, the markdown note taking app. If you are <a href="https://readwithai.substack.com/p/what-exactly-is-obsidian">new to Obsidian start here</a>.</strong></em></p><p>When inserting notes in Obsidian I often want to both build a web of links between articles as well as maintain a<a href="https://readwithai.substack.com/p/slowly-turning-your-automated-maps"> Map of Content</a>. Because I do this a lot, it can start to feel like a bit like a stream of  <em>continuous paper cuts </em>if . The completion on link insertion with <strong>[[ </strong>helps. But another thing that can be useful is inserting links based upon your history.</p><p>For these snippets you first need to install the <a href="https://github.com/pjeby/pane-relief">Pane Relief plugin</a>. </p><p>This snippet in <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a><strong> </strong>helps by either inserting a link to the previous note in your history.</p><pre><code>newCommand(function link_history() {
&#9;let stack = view.leaf["pane-relief:history-v1"].stack
&#9;let pos = view.leaf["pane-relief:history-v1"].pos
&#9;insert("[[" + stack[pos + 1].path.replace(/\..*/, "") + "]]")
})</code></pre><p>If you have installed plugin REPL you can paste it anywhere and then <a href="https://readwithai.substack.com/p/plugin-repl-executing-code">execute it with</a> <strong>Plugin REPL: Execute the current line or selection</strong> . Then if you like it you can add it to plugin REPL&#8217;s <a href="https://readwithai.substack.com/p/plugin-repl-startup-file">repl.md startup  file</a>.</p><h2>Looking at the last few files</h2><p>Sometime sit can be useful to insert a link to the file in the recent history. You can use a snippet for this.</p><pre><code>newCommand(async function link_history_select() {
&#9;let stack = view.leaf["pane-relief:history-v1"].stack
&#9;let pos = view.leaf["pane-relief:history-v1"].pos
&#9;let path = await fuzzySelect(stack.slice(pos +1, pos + 10).map((x) =&gt; x.path))
&#9;insert("[[" + path.replace(/\..*/, "") + "]]")
})
</code></pre><h2>Shortcuts</h2><p>After executing this code you can run this from the <a href="https://readwithai.substack.com/p/obsidian-all-based-around-commands">command palette or create a shortcut</a>. I use <strong>Ctrl-Alt-L</strong> and <strong>Ctrl-Alt-Shift-L.</strong></p><h2>You don&#8217;t need to use Plugin REPL</h2><p>I wrote Plugin REPL and find it useful. However, you could <a href="https://readwithai.substack.com/p/adapting-plugin-repl-scripts-to-other">adapt these scripts</a> for Templater or Dataview.</p><h1>Finishing up</h1><p>I hope you found this interesting. If you did you might like to read about</p><ol><li><p>The <a href="https://readwithai.substack.com/p/slowly-turning-your-automated-maps">trade off between automated and hand-crafted maps of content</a></p></li><li><p>My <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">review of how people take notes in Obsidian.</a></p></li><li><p><a href="https://readwithai.substack.com/p/automating-processes-with-obsidian">Automating processes with Obsidian</a></p><p></p></li></ol><div><hr></div><p><em>I am readwithai. I make tools related to reading and agency sometimes to do with Obsidian and write about this.  I am the author of Plugin REPL</em></p><p><em>If this sounds interesting you can follow me on <a href="https://x.com/readwithai">X</a> or <a href="https://readwithai.substack.com/">read my blog.</a></em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!djt9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!djt9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 424w, https://substackcdn.com/image/fetch/$s_!djt9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 848w, https://substackcdn.com/image/fetch/$s_!djt9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 1272w, https://substackcdn.com/image/fetch/$s_!djt9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!djt9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png" width="176" height="178" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:178,&quot;width&quot;:176,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:68292,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://readwithai.substack.com/i/157680931?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!djt9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 424w, https://substackcdn.com/image/fetch/$s_!djt9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 848w, https://substackcdn.com/image/fetch/$s_!djt9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 1272w, https://substackcdn.com/image/fetch/$s_!djt9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99348c6-560f-434c-bc4e-8bf1bb1d62bf_176x178.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div>]]></content:encoded></item><item><title><![CDATA[Adapting Plugin REPL scripts to other Plugins]]></title><description><![CDATA[This is a page about Obsidian in my cookbook of tips for Obsidian .]]></description><link>https://readwithai.substack.com/p/adapting-plugin-repl-scripts-to-other</link><guid isPermaLink="false">https://readwithai.substack.com/p/adapting-plugin-repl-scripts-to-other</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Fri, 21 Feb 2025 15:31:01 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bdDZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This is a page about <a href="https://readwithai.substack.com/p/what-exactly-is-obsidian">Obsidian</a> in my <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of tips for Obsidian</a> .</em> </p><p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> is a tool I wrote for easy in-editor <a href="https://readwithai.substack.com/p/scripting-obsidian">scripting</a> for Obsidian. In many of the tips and tricks here I use Plugin REPL because it is easy - that&#8217;s why I wrote it!. However, you don&#8217;t <em>need </em>to use Plugin REPL and it feels a bit wrong to offer no alternative. Rather than explaining the alternative to Plugin REPL, in every post (which takes quite a bit of typing because the alternatives are a little involved), I&#8217;m going to do it once here.</p><p>Plugin REPL is just JavaScript with some convenience functions. There are other tools that give you access to JavaScript.</p><h2>Dataview</h2><p>If you are just doing something on one page. Then dataview may be one approach. An issue (which at times is a benefit) with dataview is that it frequently reruns the script in a Dataview block whenever code changes. Another issue is that dataview does not allow you to run scripts on startup - for this you can user user scripts and templater - but this prevents you from doing everything from with Obsidian.</p><p>Nevertheless, you often want to do things on just one page and dataview can work well for this</p><p>Plugin REPL is more designed to do things once in Obsidian when you say so. However, what you can do in dataview is create a button or command that you can press once. </p><p>This snippet creates a button that prints a message.</p><pre><code>```dataviewjs
function click() {
&#9;new Notice("hello")
}
let button = dv.el("button", "hello", {"onclick": click})
```</code></pre><p>You will need to do a little work adapting objects and plugins from plugin REPL, as <a href="https://readwithai.substack.com/i/157618739/getting-hold-of-objects">described here</a>.</p><p>You can also add commands to the dataview plugin object from within dataview and then set keybindings.</p><pre><code>```dataviewjs
let plugin = app.plugins.getPlugin("dataview")
plugin.addCommand(
{
            id: 'say-hello',
            name: 'Say hello',
            editorCallback: (editor, view) =&gt; {
                new Notice("hello")
            }
        }
)
```</code></pre><p>This command will be added to Dataview&#8217;s commands. A downside of this approach is that you need to open the page with this snippet before this snippet will be defined.</p><h1>Scripts that run on startup</h1><p>Plugin REPL can <a href="https://readwithai.substack.com/p/plugin-repl-startup-file">run scripts on startup </a>that can <a href="https://readwithai.substack.com/p/obsidian-defining-a-custom-command">define commands</a>. Dataview can&#8217;t really support this (apart perhaps from having a daily note with dataview components) However, this <em>can</em> be achieved with Templater and scripts. This requires a bit of setup and the use of an external editor. </p><p>After installing Templater,  you can go to the &#8220;User script functions&#8221; settings in Templater.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bdDZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bdDZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 424w, https://substackcdn.com/image/fetch/$s_!bdDZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 848w, https://substackcdn.com/image/fetch/$s_!bdDZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 1272w, https://substackcdn.com/image/fetch/$s_!bdDZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bdDZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png" width="887" height="895" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:895,&quot;width&quot;:887,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:164213,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://readwithai.substack.com/i/157618739?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bdDZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 424w, https://substackcdn.com/image/fetch/$s_!bdDZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 848w, https://substackcdn.com/image/fetch/$s_!bdDZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 1272w, https://substackcdn.com/image/fetch/$s_!bdDZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbc7488e-4b94-4cfd-88c2-0a97cb4c22ae_887x895.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Then in another editor you can edit <strong>.js</strong> files in  <strong>$VAULT/scripts . </strong></p><p>If you create a file call <strong>hello.js</strong> in <strong>$VAULT/scripts:</strong></p><pre><code>function loadHello (app) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;app.plugins.getPlugin("templater-obsidian").addCommand({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id: "say-hello-templater",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: "Say hello with templater",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;editorCallback: &nbsp;(editor, view) &nbsp;=&gt; {  
                        new require('obsidian').Notice("hello")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})  
}

module.exports = loadHello
</code></pre><p>You can then add a &#8220;startup template&#8221; that calls this function</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FjyA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FjyA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 424w, https://substackcdn.com/image/fetch/$s_!FjyA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 848w, https://substackcdn.com/image/fetch/$s_!FjyA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 1272w, https://substackcdn.com/image/fetch/$s_!FjyA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FjyA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png" width="905" height="967" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:967,&quot;width&quot;:905,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:172109,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://readwithai.substack.com/i/157618739?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FjyA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 424w, https://substackcdn.com/image/fetch/$s_!FjyA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 848w, https://substackcdn.com/image/fetch/$s_!FjyA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 1272w, https://substackcdn.com/image/fetch/$s_!FjyA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c4cad31-9121-422a-aaef-97dc9fe85468_905x967.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Then add the following script in <strong>templater-startup.md</strong></p><pre><code>&lt;% tp.user.hello(app) %&gt;</code></pre><p>Obviously this has a lot of moving parts, each of which can wrong and each of which can be difficult to debug without proper output. In Plugin REPL you can get bugs in <strong>repl.md </strong>file - but then you can rerun it line by line by hand. You can rerun all of <strong>templater-startup.md </strong>from the command panel with <strong>Templater: Open insert template modal</strong>. </p><h1>Getting hold of objects and functions</h1><p>Plugin REPL gives you access to various useful pieces of state as well as convenience functions. </p><p>You can <a href="https://github.com/talwrii/plugin-repl/blob/master/src/main.ts">view the source</a> code for the convenience functions to reimplement them outside of Plugin REPL or potentially just copy them. </p><p>To get access to the state you can use the following snippet:</p><pre><code>editor = app.workspace.getLeaf().view.editor
view = app.workspace.getLeaf().view</code></pre><h2><br>Finishing up</h2><p>I hope this was interesting, and perhaps shows what Plugin REPL is good for. You might like to:</p><ol><li><p>Have a look at some more recipes in <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">my Obsidian Cookbook</a>.</p></li><li><p>Read about <a href="https://readwithai.substack.com/p/scripting-obsidian">scripting Obsidian</a></p></li><li><p>Read about <a href="https://readwithai.substack.com/p/what-is-reading-broadly-defined">"reading broadly defined&#8221;</a> which is part of my interested in this blog</p></li></ol><div><hr></div><p><em>I am readwithai. I am making tools in related to reading, broadly defined, and productivity, sometimes around Obsidian.</em></p><p><em>You can follow me on <a href="https://x.com/readwithai">X</a> or my <a href="https://readwithai.substack.com/">blog</a>.</em> </p><p></p>]]></content:encoded></item><item><title><![CDATA[Keeping track of your progress with an activity using a button]]></title><description><![CDATA[From my Obsidian + Plugin REPL Cookbook]]></description><link>https://readwithai.substack.com/p/keeping-track-of-your-progress-with</link><guid isPermaLink="false">https://readwithai.substack.com/p/keeping-track-of-your-progress-with</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sun, 09 Feb 2025 16:48:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>From my <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian + Plugin REPL Cookbook</a></p><p>Sometimes you want to keep track of your progress on a task or project in Obsidian, which you might represent with a note. One approach is just to dump your thoughts into the note tag it with a timestamp or date (possible with the help of <a href="https://github.com/joycode-hub/datepicker-plugin">DatePicker</a>) and tidy up later. However, if you note is quite long this can be start to be a pain particularly as you have to jump around to find your progress updates&#8230; and it can be nice to keep things neat.</p><p>One approach that I&#8217;ve used is to have a button in your note to create a child note, which you track with a <a href="https://blacksmithgu.github.io/obsidian-dataview/">dataview</a> query.</p><p>I use the following <a href="https://github.com/mProjectsCode/obsidian-meta-bind-plugin">meta bind</a> button which I created with its fancy builder.</p><pre><code>```meta-bind-button
label: Progress
icon: ""
hidden: false
class: ""
tooltip: ""
id: ""
style: default
actions:
  - type: templaterCreateNote
    templateFile: progress-reports/create-progress-report.md
    folderPath: /
    fileName: ""
    openNote: true
    openIfAlreadyExists: false
```</code></pre><p>This then uses a Templater template to create a note with the date in the title and a tag.</p><pre><code>&lt;% await tp.file.rename("Progress on "+ tp.date.now("YYYY-MM-DD"))%&gt;
&lt;% tp.file.cursor() %&gt;

#progress-report</code></pre><p>Then I also have a Dataview query in the note to track a task:</p><pre><code>```dataview
LIST FROM #progress-report
```</code></pre><p>I found someone doing something similar (with a more complete script) <a href="https://www.reddit.com/r/ObsidianMD/comments/13ijeyc/buttonstemplaterdataview_create_new_notes_with_a/">on reddit</a>.</p><p></p><p>I am @readwithai. I&#8217;m creating tools related to reading and productivity sometimes in Obsidian. Follow me on <a href="https://x.com/readwithai">X</a> or subscribe to the <a href="https://readwithai.substack.com/">blog</a>:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://readwithai.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://readwithai.substack.com/subscribe?"><span>Subscribe now</span></a></p><p>:</p>]]></content:encoded></item><item><title><![CDATA[Slowly making your Obsidian automated maps of content hand-crafted]]></title><description><![CDATA[I have started using Obsidian, it&#8217;s a fun note taking app that lets you build your own &#8220;web&#8221; of knowledge sort of like Wikipedia.]]></description><link>https://readwithai.substack.com/p/slowly-turning-your-automated-maps</link><guid isPermaLink="false">https://readwithai.substack.com/p/slowly-turning-your-automated-maps</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sat, 08 Feb 2025 22:29:53 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/e60d80cb-dfc7-4d17-8ce0-47ab06f1bb52_752x394.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This is a post about Maps of content an idea in the <a href="https://readwithai.substack.com/p/the-theory-of-obsidian">theory of Obsidian</a> by readwithai (<a href="https://x.com/readwithai">X</a>,<a href="https://reawithai.substack.com"> blog</a>).</em></p><p>I have started using <a href="https://readwithai.substack.com/p/making-better-notes-with-obsidian?triedRedirect=true">Obsidian</a>: it&#8217;s a fun note taking app that lets you build your own &#8220;web&#8221; of knowledge sort of like Wikipedia. This note is about using Obsidian better but if this makes no sense and you are still interested you might like to <a href="https://readwithai.substack.com/p/making-better-notes-with-obsidian?triedRedirect=true">start here</a>.</p><p>When you start making notes on a topic you often don&#8217;t know what structure you should have in your knowledge base to store them, so it can be convenient to quickly add a tag or a parent to a note so your notes have a bit of structure. You also don&#8217;t necessarily want to be distracted from the note that you are taking by maintaining structure. For this sort of thing, <a href="https://readwithai.substack.com/p/automated-maps-of-content-in-obsidian">automated maps of content</a> can work well, and  are fairly straightforward to create with a saved <a href="https://obsidian.rocks/dataview-in-obsidian-a-beginners-guide/">dataview</a> template like so:</p><pre><code>```dataview
LIST WHERE contains(parent, this.file.link)
```</code></pre><p>However over time it can be good to actually make these maps of content more &#8220;hand-crafted&#8221;. By hand-crafted I mean a map of content in which you have created the links by hand. The notes are then often ordered better, so that similar links are together and you have been made to think about how these ideas relate to one another. Also every time you look at this hand-crafted MOC  you will remind yourself of this ordering and the process of making it.</p><p>One nice way of creating these handcrafted maps of meaning is to have a little sentence like the first paragraph in Wikipedia. It might looks something like this</p><pre><code>Node is a [[runtime]] for the programming language called [[JavaScript]]. It funs on the server and can [[extensions written in C]]. It also supports [[JavaScript imports|imports]]</code></pre><h2>Going from automated MOCs to hand-crafted MOCs</h2><p>An approach I have found of slowly moving between automated MOCs and hand-crafted maps is to have a dataview query at the end of your notes of all the child notes of your note that have not been manually added to a note (or a child note). This can be done with this query:</p><pre><code>```dataview
LIST WHERE contains(parent, this.file.link) AND !contains(this.file.outlinks. file.link)
```</code></pre><p>I then put this at the bottom of my MOC. Over time and when I think I understand the structure enough. I can add these links to the handcrafted part of a note and the links disappear.</p><h2>A bit about the rule of seven</h2><p>One thing you might like to do when you have too many notes with the same parent is add child &#8220;structure&#8221; notes to keep your links, so that you have a tree of notes. There is an idea that humans can hold between 5 and 9 things in working memory at the same time, so having around 7 links in each note in your map of content can work well. Of course, sometimes it good to have a nice long list as well</p><p>You can still output the complete tree under a top node with the following code:</p><pre><code>```dataviewjs
function contains(property, link) {
&#9;if (property === undefined) {
&#9;&#9;return false
&#9;}
&#9;if (property.hasOwnProperty("0")) {
&#9;&#9;return property.map((x) =&gt; x.path).contains(link.path)
&#9;}
&#9;return property.path == link.path
}

function children(p) {
&#9;return p.file.inlinks.filter((x) =&gt; contains(dv.page(x).parent, p.file.link))
}

function makeTree(root, depth) {
&#9;if (depth == 0) {
&#9;&#9;return root.file.link
&#9;}
&#9;return [root.file.link, children(root).map((x) =&gt; makeTree(dv.page(x), depth - 1))]
}

dv.paragraph(makeTree(dv.current(), 2))
```
</code></pre><h2>Finishing up</h2><p>I hope you find this idea useful. If you are interested in this sort of thing you might like to:</p><ol><li><p>Look at <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">my review of note taking</a> in Obsidian</p></li><li><p>Read my page on <a href="https://readwithai.substack.com/p/automated-maps-of-content-in-obsidian">automated maps of content</a> in Obsidian, </p></li><li><p>Look at<a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook"> my cookbook of tips and tricks</a> for Obsidian. </p></li></ol><p>You can also follow me on <a href="https://x.com/readwithai">X</a> where I post about various things. Or subscribe to my <a href="https://readwithai.substack.com">blog</a> where I mostly write about research and reading with Obsidian. </p><h2>Bibliography</h2><p>Also <a href="https://www.linkingyourthinking.com/">linking your thinking</a> has a lot of ideas about how note taking and thinking interacts</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://readwithai.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://readwithai.substack.com/subscribe?"><span>Subscribe now</span></a></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Manual maps of content as form of spaced repetition]]></title><description><![CDATA[If the scheduling of spaced repetition is too much for you maybe replace it with maintaining a map of content]]></description><link>https://readwithai.substack.com/p/manual-maps-of-content-as-form-of-85f</link><guid isPermaLink="false">https://readwithai.substack.com/p/manual-maps-of-content-as-form-of-85f</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Fri, 07 Feb 2025 15:32:34 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/43312287-e6a4-4aa3-bc0c-5c57b54b775b_745x348.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://www.youtube.com/watch?v=WUq8Pun28FI">Maps of content</a> (or MOCs) is a buzzword in the <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">lore of Obsidian</a>, the popular markdown editor and knowledge base. The concept of MOCs describes creating one or more hierarchies of notes containing links to your other notes. This is similar to a table of context or index for a book. A slight difference is that you can have as many notes as your want.</p><p>A map of content might like something like:</p><pre><code># Wars

* [[ World war 1]]

# World war 1

* [[Battle of the Somme]]

# Battle of the Somme

Some details about the battle</code></pre><p><br>The key thing is that the notes in your maps of content are mostly about linking to other notes - though they can have a little bit of information.</p><p>One upside maintaining maps of content is that it can  acts as tool to help you memorize your content through repeatedly exposing you to it.</p><p><a href="https://readwithai.substack.com/p/manual-maps-of-content-as-form-of-85f">Read more about this in this blog post.</a></p><div><hr></div><p><em>I am <a href="https://readwithai.substack.com/p/what-is-reading-broadly-defined">readwithai</a>. I am making tools for reading (amongst <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">other things</a>), sometimes using <a href="https://readwithai.substack.com/p/what-exactly-is-obsidian">Obsidian</a>.</em></p><p><em>If you are intersted in this you might like to read my <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">Review of note taking in Obsidian</a>.</em></p><p><em>Note that this is a duplicate post for reddit because I need to change the thumbnail.<br><br>You can follow me on <a href="https://x.com/readwithai">X</a> on subscribe here.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://readwithai.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://readwithai.substack.com/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item><item><title><![CDATA[Creating typed links in Obsidian using properties]]></title><description><![CDATA[One thing that I&#8217;ve found myself wanting in Obsidian is links with a type so you can say how one note is related to another.]]></description><link>https://readwithai.substack.com/p/creating-typed-links-in-obsidian</link><guid isPermaLink="false">https://readwithai.substack.com/p/creating-typed-links-in-obsidian</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Thu, 06 Feb 2025 23:51:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!m3Pb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One thing that I&#8217;ve found myself wanting in Obsidian is links with a type so you can say how one note is related to another. A common use case is having one or more parent notes for one note. Another example is for language learning: I am learning Danish in Obsidian and I create nodes for new words I learn and then I create typed links for words related to a word, for a &#8220;topic&#8221; that the words belongs to, for opposite words etc. </p><p>There&#8217;s <a href="https://forum.obsidian.md/t/add-support-for-link-types/6994/17">a long forum post</a> on the Obsidian forums talking about how typed links might be represented in Obsidian. None of the ideas there have been implemented really - but the approach presented here using <a href="https://obsidian.rocks/an-introduction-to-obsidian-properties/">Obsidian properties</a> work well.</p><h2>How to represent typed links in Obsidian</h2><p>One way to represent a typed link between one Obsidian note and another is to use a property. You can either represent this within your note using the <code>:: </code>syntax, like so:</p><p><code>parent:: [[Parent Note]]</code></p><p>A nice thing about this syntax is that you can add it anywhere in your note. A  downside is that you can&#8217;t cleanly embed this syntax within a paragraph of text link you can with normal links. One approach is to place your types links like this after a paragraph like so:</p><pre><code>A cat is a type of [[Mammal]] which hunts [[Mice]].
hunts:: [[Mice]]
typeof:: [[Mammal]]
</code></pre><p>You can also add a property to the <a href="https://obsidian.rocks/an-introduction-to-obsidian-properties/">frontmatter</a> of your note using the <code>[[</code>syntax inside a property.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m3Pb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m3Pb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 424w, https://substackcdn.com/image/fetch/$s_!m3Pb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 848w, https://substackcdn.com/image/fetch/$s_!m3Pb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 1272w, https://substackcdn.com/image/fetch/$s_!m3Pb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m3Pb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png" width="820" height="455" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:455,&quot;width&quot;:820,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53764,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!m3Pb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 424w, https://substackcdn.com/image/fetch/$s_!m3Pb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 848w, https://substackcdn.com/image/fetch/$s_!m3Pb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 1272w, https://substackcdn.com/image/fetch/$s_!m3Pb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e94ec4-d99c-4429-81d4-a437fff37a29_820x455.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>You can have more than one parent or more than one link</h2><p>I&#8217;ve found that having more than parent for a node can be quite useful particularly as nodes become more general. For example, a topic might be relevant for a particular project, documentation and an overarching goal. For other forms of relations, it&#8217;s very natural to have multiple links.</p><p>With the breadcrumb <code>:: </code>syntax you can repeat the same &#8220;link type&#8221; multiple times in your note</p><pre><code>parent:: [[Plan for next week]]

More writing...

parent:: [[Evergreen note 1 ]]</code></pre><p>If you are using properties you can set the property type to a list and then add multiple links with <code>[[.</code></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ipk2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ipk2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 424w, https://substackcdn.com/image/fetch/$s_!ipk2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 848w, https://substackcdn.com/image/fetch/$s_!ipk2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 1272w, https://substackcdn.com/image/fetch/$s_!ipk2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ipk2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png" width="520" height="218" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:218,&quot;width&quot;:520,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19670,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ipk2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 424w, https://substackcdn.com/image/fetch/$s_!ipk2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 848w, https://substackcdn.com/image/fetch/$s_!ipk2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 1272w, https://substackcdn.com/image/fetch/$s_!ipk2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45ab4904-52cc-4ea8-8819-f2a15b7668be_520x218.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B3iv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B3iv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 424w, https://substackcdn.com/image/fetch/$s_!B3iv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 848w, https://substackcdn.com/image/fetch/$s_!B3iv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 1272w, https://substackcdn.com/image/fetch/$s_!B3iv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B3iv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png" width="818" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:818,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:80764,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B3iv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 424w, https://substackcdn.com/image/fetch/$s_!B3iv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 848w, https://substackcdn.com/image/fetch/$s_!B3iv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 1272w, https://substackcdn.com/image/fetch/$s_!B3iv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6a51b1-b915-4a4c-9c46-2db053f9a0c5_818x300.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>Using typed links</h2><p>But what&#8217;s the use of these properties. The first think you can do is click on them with a mouse!  You can also add them Obsidian&#8217;s graph view using the useful <a href="https://github.com/natefrisch01/Graph-Link-Types">Graph Link Types plugin</a> by Frisch.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!18t_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!18t_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 424w, https://substackcdn.com/image/fetch/$s_!18t_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 848w, https://substackcdn.com/image/fetch/$s_!18t_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 1272w, https://substackcdn.com/image/fetch/$s_!18t_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!18t_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png" width="419" height="414" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:419,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16717,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!18t_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 424w, https://substackcdn.com/image/fetch/$s_!18t_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 848w, https://substackcdn.com/image/fetch/$s_!18t_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 1272w, https://substackcdn.com/image/fetch/$s_!18t_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d9f746-d9e3-42c4-aa8c-98ef9ed07a34_419x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>I also often create <a href="https://www.reddit.com/r/ObsidianMD/comments/199nkqb/dataview_query_on_properties_of_type_list/">dataview property queries</a> to create <a href="https://readwithai.substack.com/p/automated-maps-of-content-in-obsidian">Automated Maps of Content</a> as part of my maps of content, with the following query:</p><pre><code>```dataview
LIST WHERE contains(parent, [[Current Node]])
```</code></pre><p>Here contains work both if a node has a single parent or multiple parents.</p><p>You can create a Templater template for this like so:</p><pre><code>```dataview
LIST WHERE contains(parent, [[&lt;% tp.file.title %&gt;]])
```</code></pre><h2>Finishing up</h2><p>I hope that was useful or interesting. If it was you might like to:</p><ol><li><p>Read my page about how to <a href="https://readwithai.substack.com/p/automated-maps-of-content-in-obsidian">automated maps of content in Obsidian</a>.</p></li><li><p> Read my slightly academic <a href="https://readwithai.substack.com/publish/posts/detail/154415108?referrer=%2Fp%2Fnote-taking-with-obsidian-much-of">review of note taking in Obsidian</a>.</p></li></ol><p>You can also subscribe to this blog where I write about reading and Obsidian, or follow me on <a href="https://x.com/readwithai">X</a> where I write about various thinks - but sometimes Obsidian.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://readwithai.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://readwithai.substack.com/subscribe?"><span>Subscribe now</span></a></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Exploring Obsidian's app object from within Obsidian]]></title><description><![CDATA[Your use of Obsidian can often be improved with a little bit of scripting. However you script Obsidian, if you want to make Obsidian do something you will likely find yourself interacting with the App object .]]></description><link>https://readwithai.substack.com/p/exploring-obsidians-app-object-from</link><guid isPermaLink="false">https://readwithai.substack.com/p/exploring-obsidians-app-object-from</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Thu, 06 Feb 2025 16:16:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9LLJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Your use of Obsidian can often be improved with <a href="https://readwithai.substack.com/p/scripting-obsidian">a little bit of scripting</a>. However you script Obsidian, if you want to make Obsidian do something you will likely find yourself interacting with <a href="https://docs.obsidian.md/Reference/TypeScript+API/App">the App object</a> . </p><p>One way to do this is through <a href="https://docs.obsidian.md/Reference/TypeScript+API/App">reading the documentation</a>, or looking at the <a href="https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts">source code</a> that plugins use to bind to Obsidian. You could also <a href="https://forum.obsidian.md/">browse the forum</a>, which contains various snippets or ask questions there.</p><p>However, one problem is that many of the methods available on the <code>app</code> object are not documented, yet are necessarily to do what you want to do, and are in fact at times used by plugins in practice to get their job done. Examples are interacting with commands and plugins. Also it can be good to &#8220;experiment at bit&#8221; while coding by interacting with these the app Object directly.</p><h2>Using the Developer console</h2><p>You can get at a developer console (like a browser uses) by pressing Ctrl+Shift+I. This has a &#8220;Console&#8221; tab which you can use to execute JavaScript - and has access to an app object. The shell is quite slick - since lots of people use JavaScript. It has completion with fuzzy search and previews values. When you have an object it displays it in a way that lets you collapse and expand different variables </p><p></p><h2>Using Plugin REPL (of which I am the author)</h2><p>You can also <a href="https://github.com/talwrii/plugin-repl?tab=readme-ov-file#installation">install Plugin REPL</a> a tool for in-editor scripting that follows some of the norms of the venerable Emacs editor, to execute JavaScript expressions from within an Obsidian note. This has a couple of benefits - it permanently keeps your history, and allows you to copy and paste results, and can be quite good for &#8220;building up expressions&#8221;, and generally one is a bit more &#8220;free&#8221; outside of a the single line of a prompt.</p><p>To list the properties on an object you can use <code>dir(app) </code>or to get a fuzzy selector listing values you can use <code>fuzzyDir(app).</code></p><p>You can also use <a href="https://gist.github.com/talwrii/afeb32fd3b8ad05ac9f2d95e45310ffe">this snippet</a> to &#8220;complete&#8221; properties on app.</p><p>Here&#8217;s a demo:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9LLJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9LLJ!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 424w, https://substackcdn.com/image/fetch/$s_!9LLJ!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 848w, https://substackcdn.com/image/fetch/$s_!9LLJ!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 1272w, https://substackcdn.com/image/fetch/$s_!9LLJ!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9LLJ!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12202759,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9LLJ!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 424w, https://substackcdn.com/image/fetch/$s_!9LLJ!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 848w, https://substackcdn.com/image/fetch/$s_!9LLJ!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 1272w, https://substackcdn.com/image/fetch/$s_!9LLJ!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c5403-251a-47ac-9635-c48a3059ca02_960x1036.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><h3></h3><p></p><p></p><p></p><div><hr></div><p><em>I am readwithai. I make tools and write about things related to reading and productivity in Obsidian. If you liked this post you might be interested in my <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of things</a> you can do in Obsidian and Plugin REPL. Or, if you are feeling in an &#8220;academic mood&#8221; perhaps you want to read my <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">review of note taking</a> in Obsidian.</em></p><p>Follow me on <a href="https://x.com/readwithai">X</a>. Follow my progress and thinking on <a href="https://readwithai.substack.com/">my blog</a>.</p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Complete attributes on JavaScript objects with Plugin REPL]]></title><description><![CDATA[@readwithai - X - Blog - Plugin REPL - Cookbook]]></description><link>https://readwithai.substack.com/p/complete-attributes-on-objects-with</link><guid isPermaLink="false">https://readwithai.substack.com/p/complete-attributes-on-objects-with</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sat, 01 Feb 2025 17:57:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!p66u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>@readwithai - <a href="https://x.com/readwithai">X</a> - <a href="https://readwithai.substack.com/">Blog</a> - <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> - <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Cookbook</a></p><p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> in Obsidian lets you script obsidian with JavaScript directly within Obsidian. A common thing to want to do is explore objects to work out how you can use this.  Plugin REPL provides a <strong>dir </strong>and <strong>fuzzyDir </strong>method for this purpose:<br><br><code>dir(app)<br>fuzzyDir(app)</code></p><p>However, after a while I got bored to typing this. I could have added dot completion like an editor to Plugin REPL, but plugin REPL doesn&#8217;t quite &#8220;own&#8221; dot in Obsidian - because you can write and execute code anywhere with Plugin REPL.</p><p>Instead I quickly hacked up a couple of commands so that I could have a hotkey for looking up and inserting attributes.</p><p></p><p><code>newCommand(async function fuzzy_dir_line() {</code></p><p><code>   let attr = await fuzzyDir(eval(lineAtPoint()))</code></p><p><code>&#9;endOfLine()</code></p><p><code>&#9;if (! isNaN(attr)) {</code></p><p><code>&#9;&#9;insert("[" + attr + "]")</code></p><p><code>&#9;} else {</code></p><p><code>&#9;&#9;insert(".")</code></p><p><code>&#9;&#9;insert(attr)</code></p><p><code>&#9;}</code></p><p><code>})</code></p><p></p><p><code>newCommand( function delete_back_to_dot () { </code></p><p><code>&#9;let end = point()</code></p><p><code>&#9;backwardRegexp(/\./)</code></p><p><code>&#9;kill(point(), end)</code></p><p><code>})</code></p><p></p><p>Then I bind some hotkeys to these.</p><p></p><p>Here&#8217;s a demo of this working.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p66u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p66u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 424w, https://substackcdn.com/image/fetch/$s_!p66u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 848w, https://substackcdn.com/image/fetch/$s_!p66u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 1272w, https://substackcdn.com/image/fetch/$s_!p66u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p66u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4901651,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p66u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 424w, https://substackcdn.com/image/fetch/$s_!p66u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 848w, https://substackcdn.com/image/fetch/$s_!p66u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 1272w, https://substackcdn.com/image/fetch/$s_!p66u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6629edfb-4de1-4f17-b89b-6b3b958f1462_920x1036.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><p>This is part of a <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of cool things</a> you can do with Obsidian and Plugin REPL.</p><div><hr></div><p><em>I am @readwithai. I make <a href="https://readwithai.substack.com/p/tools-to-increase-agency">tools</a> in <a href="https://readwithai.substack.com/p/what-exactly-is-obsidian">Obsidian</a> related to <a href="https://readwithai.substack.com/p/automating-processes-with-obsidian">productivity</a>, <a href="https://readwithai.substack.com/p/reading-and-agency">agency</a> and <a href="https://readwithai.substack.com/p/what-is-reading-broadly-defined">reading</a> and <a href="https://readwithai.substack.com/">write</a> about them. If that sounds interesting you can follow me on <a href="https://x.com/readwithai">X</a> or <a href="http://readwithai.substack.com">substack</a>.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://readwithai.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://readwithai.substack.com/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Scripting Obsidian]]></title><description><![CDATA[Make what you want to do in Obsidian easier with a dash of JavaScript.]]></description><link>https://readwithai.substack.com/p/scripting-obsidian</link><guid isPermaLink="false">https://readwithai.substack.com/p/scripting-obsidian</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sun, 12 Jan 2025 00:04:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian+PR Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Obsidian Docs</a></p><p>Obsidian is at its core an extensible markdown editor. You can extend it with plugins, but sometimes there is no plugin to do what you want, often because your tasks is quite specific to what you are trying to do. I wrote <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> to help you quickly script Obsidian for some tasks.</p><p>For this, you might want to do a tiny bit of scripting. From my perspective there are three sorts of thinks you might want to automate in Obsidian.</p><ul><li><p>Content that gets generated based on content you have already made</p></li><li><p>Templates</p></li><li><p>Code that you want to run from the Command Palette or hotkeys</p></li></ul><h1>Generated content</h1><p>For this you tend to want to &#8220;embed&#8221; the code to generate the content into your page. People tend to use <a href="https://blacksmithgu.github.io/obsidian-dataview/">dataview</a> for this. Dataview has two languages - a query language inspired by SQL and JavaScript language for more general scripting. </p><p>Here is a query which outputs all nodes with two tags. </p><pre><code>```dataview
LIST from #howto AND #javascript
```
</code></pre><p>This can be good to add to &#8220;index / structure notes&#8221; to index other notes.</p><p>JavaScript queries can do more complicated and dynamic things. For example the query below returns the number of pages with identically tags to the current page.</p><pre><code>```dataviewjs
let pageTabs = dv.current().tags
let matchingQuery = "LIST FROM " + pageTabs.map((x) =&gt; "#" + x).join(" AND ")
let result = await dv.query(matchingQuery)
dv.paragraph(result.value.values.length)
```</code></pre><p>A thing to bear in mind about this code is that it is reexecuted when you reopen the page or when things change so it should not have side effects. For example, you for sometihng like a command you might want it to prompt for text. </p><h1>Templates</h1><p>It is quite common to want to generate content in a consistent form (potentially depending upon custom values and insert it into your document). <a href="https://github.com/SilentVoid13/Templater">Templater</a> is a good tool for this.</p><h2>Custom Commands</h2><p>If you want to run a command that can do things and that you call often (such as creating new notes, or inserting them into your document) then you can use <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a>. </p><p>Here is <a href="https://readwithai.substack.com/p/obsidian-defining-a-custom-command">a command</a> to insert the current timestamp in Plugin REPL.</p><pre><code>newCommand(function insert_timestamp() {
&#9;insert((new Date()).toISOString())
})
</code></pre><p>People also have used Templater templates to for &#8220;commands&#8221; since when executed they can run javascript code which can have side effects.  If you have more complicated functionality or want to share your code you might want to <a href="https://docs.obsidian.md/Home">write your own plugin</a>.</p><p></p><p></p><div><hr></div><p><em>This is part of a <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">cookbook of things that you can do</a> with Obsidian and Plugin REPL. If you found this interesting you might like to <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">read some other pages</a> I might looking at some examples of thinks you can do by automating Obsidian, such as <a href="https://readwithai.substack.com/p/creating-a-timeline-of-my-tweets">this timeline of twitter posts</a>. </em></p><p><em>I am not afilliated with Obsidian, I am the author of Plugin REPL. I am <a href="http://x.com/readwithai">@readwithai</a> - read about me <a href="https://readwithai.substack.com/">here</a>.</em></p>]]></content:encoded></item><item><title><![CDATA[Jumping straight to Community Plugin Search in Obsidian]]></title><description><![CDATA[Obsidian+PR Cookbook - &#120143; - YouTube - Official Obsidian Docs]]></description><link>https://readwithai.substack.com/p/jumping-straight-to-community-plugin</link><guid isPermaLink="false">https://readwithai.substack.com/p/jumping-straight-to-community-plugin</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Tue, 07 Jan 2025 21:19:20 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/dc730aa4-fdcd-4894-aaff-6f36df5242e4_811x537.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian+PR Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Obsidian Docs</a></p><p>A common thing that you want to do in Obsidian, especially when starting out, is to search <a href="https://obsidian.md/plugins">Obsidian&#8217;s community plugins</a> to see if there a plugin to help you with your current task. In practice this is a few clicks away: you have to open the settings, find community plugins, click the tab, then go to the search box. What would be cool would be to have a keybinding to jump straight to search.</p><h2>How to code this up</h2><p>Writing Obsidian plugins is interesting, plugins start off very &#8220;API&#8217;y&#8221; by defining callbacks using <a href="https://docs.obsidian.md/Home">Obsidian API</a> but then when you start defining a user interface they can turn into website coding using JavaScript, HTML and the document object model.  I&#8217;ve found that sometimes to automate things,  I almost start doing &#8220;screen scraping&#8221;  because there is no API for what I want to do.</p><p>This is what I had to do to implement this, but I did have to do that much screen scraping - just find a browse button a click it.  Here is <a href="https://readwithai.substack.com/p/obsidian-defining-a-custom-command">custom command</a> in Plugin REPL will open the Community plugins settings page and then find the button with &#8220;Browse&#8221; written in and click it. (Note that I&#8217;m the author of Plugin REPL)</p><pre><code>newCommand(async function open_community_plugins() {
&#9;await openSetting("Community plugins")
    document.evaluate('//button[text()="Browse"]', app.setting.containerEl).iterateNext().click()
})
</code></pre><p>This uses the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/evaluate">document.evaluate</a> method of the standard JavaScript document object model.</p><p>Once you&#8217;ve written this command you can <a href="https://readwithai.substack.com/p/plugin-repl-executing-code">evaluate it with Plugin REPL</a> and optionally add it to your <a href="https://readwithai.substack.com/p/plugin-repl-startup-file">repl.md startup file</a>.</p><h2>Demo</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3S6J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3S6J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 424w, https://substackcdn.com/image/fetch/$s_!3S6J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 848w, https://substackcdn.com/image/fetch/$s_!3S6J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 1272w, https://substackcdn.com/image/fetch/$s_!3S6J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3S6J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif" width="960" height="690" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:960,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1615770,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3S6J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 424w, https://substackcdn.com/image/fetch/$s_!3S6J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 848w, https://substackcdn.com/image/fetch/$s_!3S6J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 1272w, https://substackcdn.com/image/fetch/$s_!3S6J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3bb53c99-9b4a-4afd-80af-6bffe3deff96_960x690.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>The old fashioned Templater way</h2><p>You don&#8217;t have to use Plugin REPL for this - although it makes things easy if you do. Instead you could use Templater by creating the following plugin in your template directory called plugins. </p><pre><code>&lt;%* 
&#9;tp.app.setting.open()
&#9;await tp.app.setting.open()
&#9;await tp.app.setting.openTabById(tp.app.setting.settingTabs.filter((tab) =&gt;  tab.name === "Community plugins")[0].id)
&#9;document.evaluate('//button[text()="Browse"]', app.setting.containerEl).iterateNext().click()
%&gt;
</code></pre><p>You can then add this template as a command under Template hotkeys in Templater&#8217;s settings.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nDKF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nDKF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 424w, https://substackcdn.com/image/fetch/$s_!nDKF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 848w, https://substackcdn.com/image/fetch/$s_!nDKF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 1272w, https://substackcdn.com/image/fetch/$s_!nDKF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nDKF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png" width="756" height="415" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:415,&quot;width&quot;:756,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49086,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nDKF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 424w, https://substackcdn.com/image/fetch/$s_!nDKF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 848w, https://substackcdn.com/image/fetch/$s_!nDKF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 1272w, https://substackcdn.com/image/fetch/$s_!nDKF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b10865-a5cc-44eb-acac-cb76a5503dfc_756x415.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And then define a hotkey for the Insert command. This approach is a bit more effort to debug (Templater doesn&#8217;t give particularly useful error output). Also Templater does not really support assignment - hence the inlining of <code>tp.app.setting.openTabById(tp.app.setting.settingTabs.filter((tab) =&gt;  tab.name === "Community plugins")[0].id).</code></p><p>But it does work!</p><p><em>P.S You could also use <a href="https://www.thoughtasylum.com/2021/09/12/automating-your-obsidian-workspace/#step-3---build-a-script">Quickadd to add a script</a> (which does not have the limitations that Templater has) - also templater supports user script. Both approaches involve using another editor and a fair amount of clicking.</em></p><h2>Finishing up</h2><p>I hope you found that useful. I enjoy using this keybinding and it makes installing plugins more fun. If you found this page interesting you might like read.</p><ol><li><p>This page about <a href="https://readwithai.substack.com/p/some-useful-custom-hotkeys-for-obsidian">some useful hotkeys I used in Obsidian (including this one)</a></p></li><li><p>This page about <a href="https://readwithai.substack.com/p/automated-maps-of-content-in-obsidian">automated maps of content using dataview</a></p></li><li><p>This kind of  <a href="https://readwithai.substack.com/p/note-taking-with-obsidian-much-of">academic summary of note taking in Obsidian that I made</a></p></li></ol><p>Also you can follow me on <a href="https://x.com/readwithai">X</a> or <a href="https://readwithai.substack.com">substack</a> if you like.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ln-y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ln-y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 424w, https://substackcdn.com/image/fetch/$s_!Ln-y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 848w, https://substackcdn.com/image/fetch/$s_!Ln-y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 1272w, https://substackcdn.com/image/fetch/$s_!Ln-y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ln-y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png" width="176" height="178" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:178,&quot;width&quot;:176,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:68292,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ln-y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 424w, https://substackcdn.com/image/fetch/$s_!Ln-y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 848w, https://substackcdn.com/image/fetch/$s_!Ln-y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 1272w, https://substackcdn.com/image/fetch/$s_!Ln-y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec51a0f-774f-48c4-81aa-3c6f6f6a6b98_176x178.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><div><hr></div><p></p><p><em>Interesting? The is <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">a whole &#8220;Cookbook&#8221; here of similar Obsidian tricks</a>. Also I am creating tool in Obsidian, some of it for automated reading. If you are interested maybe <a href="https://readwithai.substack.com/">check out the blog</a>.</em></p><p><em>I am not affiliated with Obsidian. I am the author of Plugin REPL</em></p>]]></content:encoded></item><item><title><![CDATA[Creating a timeline of my tweets in Obsidian]]></title><description><![CDATA[Obsidian+PR Cookbook - &#120143; - YouTube - Official Obsidian Docs]]></description><link>https://readwithai.substack.com/p/creating-a-timeline-of-my-tweets</link><guid isPermaLink="false">https://readwithai.substack.com/p/creating-a-timeline-of-my-tweets</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Tue, 07 Jan 2025 04:23:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_Nf-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian+PR Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Obsidian Docs</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://x.com/readwithai/status/1876437504452436302" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Nf-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 424w, https://substackcdn.com/image/fetch/$s_!_Nf-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 848w, https://substackcdn.com/image/fetch/$s_!_Nf-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 1272w, https://substackcdn.com/image/fetch/$s_!_Nf-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Nf-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png" width="585" height="364" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:364,&quot;width&quot;:585,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:100170,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://x.com/readwithai/status/1876437504452436302&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_Nf-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 424w, https://substackcdn.com/image/fetch/$s_!_Nf-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 848w, https://substackcdn.com/image/fetch/$s_!_Nf-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 1272w, https://substackcdn.com/image/fetch/$s_!_Nf-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29a64dc3-fa30-45a3-8fca-2baff3092beb_585x364.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I like to plan the things that I am going to tweet on twitter in an Obsidian note. That way I can avoid either spamming people too much or note saying anything at all. Whenever I have something I want to share with the world I open an Obsidian note and then note it down. Then at a later time I add a timestamp of when I want to send it and send it. </p><p>I felt a little nerdy and decided I wanted a timeline of the tweets I had sent so decided to hack up a timeline for this. Obsidian has a couple of tools for timelines but they weren&#8217;t quite what what I wanted. Obsidian has native support for timelines with a the <a href="https://www.google.com/search?client=ubuntu-sn&amp;channel=fs&amp;q=mermaid+timelines">diagramming domain specific language mermaid</a> - but the boxes on this were a bit too big and the timeline didn&#8217;t have a continue time axis. There is a plugin for it - but the plugins wanted to read dates from notes whereas I had lines labelled with times.</p><p>So as I was already using a little JavaScript code in Plugin REPL to get out the times of all my tweets I decided to use the JavaScript library <a href="https://github.com/visjs/vis-timeline">vis</a>.  Plugin REPL has features to <a href="https://readwithai.substack.com/p/using-javascript-libraries-with-plugin">import JavaScript libraries</a>, so I used that to pull in vis after installing it.</p><pre><code>vis = replRequire('vis')</code></pre><p>Then I have the horrible following expression to parse out dates.</p><pre><code>var lines = bufferString().split("\n").filter((x) =&gt; return  x.startsWith("~~202") ).map((x) =&gt; [x.split(" ")[0].replace(/~/g, ""), x.split(" ").slice(1).join(" ").replace(/~/g, "")]).sort()
</code></pre><p>I should probably split this up. But it basically gets all the struck through lines that start with a date and then gets rid of the striking and splits the date from the rest of line .</p><p>Then I used the following Plugin REPL code block </p><pre><code>```plugin-repl
var data = lines.map(([x, y]) =&gt; ({start: x, content: ".", id: x}))
var lineById = Object.fromEntries(lines)

dataset = new vis.DataSet(data)
timeline = new vis.Timeline(el, dataset, {})

var currentItem
timeline.on('mouseOver', function (properties) {&nbsp;
if (properties.item === null) {
&#9;return
}

if (properties.item != currentItem)
&#9;message(lineById[properties.item]);  

currentItem = properties.item
});

zoom = document.createElement("button")
zoom.appendText("zoom")
zoom.onclick = (() =&gt; timeline.zoomIn(1))

unzoom = document.createElement("button")
unzoom.appendText("zoom out")
unzoom.onclick = (() =&gt; timeline.zoomOut(1))

el.appendChild(zoom)
el.appendChild(unzoom)
```</code></pre><p><br>To draw the graph, the <strong>el</strong> variable is an html element that gets drawn after the code runs. I tell vis to render into this element and then add a couple of buttons with <strong>appendChild </strong>to zoom in and out.<strong> </strong>I use <strong>message</strong> to display a tweet&#8217;s text when I mouse over it in the timeline. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2t4f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2t4f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 424w, https://substackcdn.com/image/fetch/$s_!2t4f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 848w, https://substackcdn.com/image/fetch/$s_!2t4f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 1272w, https://substackcdn.com/image/fetch/$s_!2t4f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2t4f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png" width="820" height="519" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:519,&quot;width&quot;:820,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36099,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2t4f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 424w, https://substackcdn.com/image/fetch/$s_!2t4f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 848w, https://substackcdn.com/image/fetch/$s_!2t4f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 1272w, https://substackcdn.com/image/fetch/$s_!2t4f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4c9c392-6766-4cfd-b5f5-5d4bf975c2c4_820x519.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I can then see when I should post tweets to avoid spamming people too much and look at what I am posting about to avoid changing the topic too much.</p><p>One interesting plugin that was drawn to my attention after writing this was the <a href="https://github.com/clairefro/obsidian-plugin-chronos">chronos</a> plugin. The documentation for this suggests <a href="https://github.com/clairefro/obsidian-plugin-chronos?tab=readme-ov-file#advanced-usage">generating a chronos code block</a> from a a (dataview) code block in order to produce dynamic timelines.</p><div><hr></div><p>This is part of <em>my <a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian and Plugin REPL</a></em><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook"> </a><em><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Cookbook</a> </em>where I give examples of how to make Obsidian do various useful things. I am generally interested in making tools for Obsidian and particularly targetting tools for <a href="https://readwithai.substack.com/p/what-is-reading-broadly-defined">reading</a>. If you are interested you can subscribe on <a href="https://readwithai.substack.com/subscribe">substack</a> or <a href="https://x.com/readwithai">X</a>. </p><p><em>I am not affiliated with Obsidian. I am the author of Plugin REPL</em></p><p></p>]]></content:encoded></item><item><title><![CDATA[Using JavaScript NPM libraries with Plugin REPL in Obsidian]]></title><description><![CDATA[Obsidian+PR Cookbook - &#120143; - YouTube - Official Obsidian Docs]]></description><link>https://readwithai.substack.com/p/using-javascript-libraries-with-plugin</link><guid isPermaLink="false">https://readwithai.substack.com/p/using-javascript-libraries-with-plugin</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Tue, 07 Jan 2025 03:53:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian+PR Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Obsidian Docs</a></p><p>Plugin REPL provides a convenience functions to do a lot of the normal things you would do while editing Obsidian allowing you to automate various tasks. But at some point you might find yourself wanting to do something complicated or something graphical and there might be JavaScript libraries that magically do want you want. </p><p>Plugin REPL provides a means of using third-party JavaScript code inside Obsidian - similar to how plugins using the <strong>replRequire</strong> method but this takes a little work and requires you to know a little bit amount the command line. </p><h1>How this works</h1><p>You need to check out a &#8220;library installer&#8221; into your vault with git. Then install the libraries you want there. Then Plugin REPL can find them when you run <strong>replRequire(&#8220;LIBRARY&#8221;) .</strong></p><p>To install libraries you first checkout this github repository into your vault directory with:</p><pre><code>git clone git@github.com:talwrii/plugin-repl-imports.git
</code></pre><p>Then you edit the <strong>imports.txt</strong>  file in this directory to add the libraries that you want.</p><p>Then you fetch the libraries you want with </p><pre><code>cd plugin-repl-imports; npm run run</code></pre><p> Then you can import them in Obsidian.</p><div><hr></div><p><em>I am not affiliated with Obsidian. I am the author of Plugin REPL</em></p><p></p>]]></content:encoded></item><item><title><![CDATA[JavaScript, Obsidian and programming]]></title><description><![CDATA[Obsidian+PR Cookbook - &#120143; - YouTube - Official Obsidian Docs]]></description><link>https://readwithai.substack.com/p/javascript-obsidian-and-programming</link><guid isPermaLink="false">https://readwithai.substack.com/p/javascript-obsidian-and-programming</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sat, 04 Jan 2025 08:18:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian+PR Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Obsidian Docs</a></p><p>Using <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> involves writing some code in a language called <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a>. Other commonly used Obsidian plugins like <a href="https://blacksmithgu.github.io/obsidian-dataview/">Dataview</a> and <a href="https://github.com/SilentVoid13/Templater">Templater</a> make use of JavasScript (Dataview also defines it&#8217;s own programming language).  Programming is a skilled and often complex activity that some people spend their entire lives working on. But I am going to argue here that a <em>little </em>JavaScript can go a long way and you don&#8217;t need to learn all of it.</p><p>So firstly, you probably don&#8217;t need to understand that much to do the things that you want to do. I will give a summary of some of the things that you need to know here. JavaScript can be used to buid complex things, so have a bunch of complex features to handle the complexity but you don&#8217;t need this, but to get started with Plugin REPL you need a lot less</p><h2>Why program anyway</h2><p>Why program at all? You can do lots of things in Obsidian without programming. And there are many plugins that let you do things. </p><p>The value that programming provides is the ability to do similar things slightly differently by clicking together parts. Often plugins will only let you do things in one way.</p><p>Programs also allow you to express what you want to do in text, which can at times be a lot simpler than updating all the settings for Plugin.</p><h1>The basics of JavaScript</h1><p>Firstly, you may well need to understand no <em>JavaScript</em> to use JavaScript - you can find the pieces of code that you need to do what you want to do and copy and paste them into Obsidian. Alternatively, you might be able to find example code and adapt it slightly to do what you want.</p><p>If you need to actually create something new, the main thing that you need to be able for Plugiun REPL is call functions (Plugin REPL provides you with a <a href="https://github.com/talwrii/plugin-repl?tab=readme-ov-file#convenience">lot of functions to do things</a>), collect informtion from functions, and use variables.</p><h3>Functions</h3><p>To use/run/call a function called myFunction you add a pair of brackets like so:</p><pre><code>myFunction()
</code></pre><p>Sometimes the function needs some information. You can provide this information inside the brackets with commas separating each value:</p><pre><code>myFunction(1, 2)</code></pre><p>Sometimes you will want to provide this function with a piece of text, this text has to go in quotation marks.</p><pre><code>myFunction("The quick brown fox jumps over the lazy dog")</code></pre><h3>Getting information from a function</h3><p>Sometimes a function can give you information about what it has done. This is called the result of the function. You can save the result of the function in a variable. To do this you use the equals symbol like so</p><pre><code>result = myFunction()</code></pre><p>If you you are creating more complex programs there are <a href="https://www.freecodecamp.org/news/differences-between-var-let-const-javascript/">more &#8220;correct&#8221; ways </a>of doing this - but you can worry about them later.</p><h3>Using the information from a function</h3><p>Once you have collected information from a function you can use it in a function like so:</p><pre><code>otherFunction(result)
</code></pre><p>Plugin REPL also provides some &#8220;default&#8221; pieces of information such as <strong>path.</strong></p><h3>Other things</h3><p>That&#8217;s basically it for the javascript you need. Everything is calling functions and combining the results. But there are a couple of other things you need. If you want to <a href="https://readwithai.substack.com/p/obsidian-defining-a-custom-command">create a command </a> you need to use the following code</p><pre><code>newCommand(async function() {
 ... functions go here
})
</code></pre><p>The other complexity is that some functions start and &#8220;run in the background&#8221; if you want to collect information from them you have to &#8220;await&#8221; the reply like so.</p><pre><code>a = await promptString()
</code></pre><p>This is a little confusing, but it is done so that in complicated programs you can do things at the same time. </p><h3>Even more</h3><p>So if this is all you need why does JavaScript have more features. The way I think about it is that everything else is about &#8220;dealing with the complexity&#8221; of writing larger programs. If you want to do more complicated things you might need to learn these.</p><p>The first thing it would use useful to learn about are methods. These are functions that are &#8220;attached&#8221; to a piece information. You use them like</p><pre><code>result = a.f()</code></pre><p>This is like saying <strong>result = f(a) </strong> but f is attached to a so you can use it on a. This makes things a bit &#8220;neater&#8221;. An example of when you might want to use this is on the dv object:</p><pre><code>dv = getDv()
dv.pages()
</code></pre><p>To learn this you might like to get a book on JavaScript or look at examples and try to understand what the code is doing. </p><p>I would suggest you learn things in this order.</p><ul><li><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions">functions</a></p></li><li><p><a href="https://www.w3schools.com/js/js_arrays.asp">arrays</a></p></li><li><p><a href="https://www.w3schools.com/jsreF/jsref_filter.asp">filter</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">map</a></p></li><li><p><a href="https://stackoverflow.com/questions/62396360/what-does-the-dot-do-in-javascript">the &#8220;.&#8221; in javascript</a></p></li><li><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function">async functions</a></p></li><li><p>Everytthing else.</p></li><li><p>Google what you are trying to do.</p><p></p></li></ul><h2>What next</h2><p>I hope this is enough of an introduction on JavaScript that you could use it for some features of Plugin REPL. You might like to check out some examples of cool things you can do <a href="https://readwithai.substack.com/s/cookbook">in the cookbook</a> for inspiration.</p><div><hr></div><p><em>I am not affiliated with Obsidian. I am the author of plugin repl</em></p>]]></content:encoded></item><item><title><![CDATA[Obsidian: Defining new snippets as you go]]></title><description><![CDATA[Obsidian+PR Cookbook - &#120143; - YouTube - Official Obsidian Docs]]></description><link>https://readwithai.substack.com/p/obsidian-defining-new-snippets-as</link><guid isPermaLink="false">https://readwithai.substack.com/p/obsidian-defining-new-snippets-as</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Sat, 04 Jan 2025 05:22:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nNDw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian+PR Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Obsidian Docs</a></p><p>I like snippets. Snippets works by replacing a word that you just typed with a piece of text. I like snippets so much that I defined my <a href="https://github.com/facetframer/zshnip">own snippet library for zshell</a>. </p><p>Much as <a href="https://readwithai.substack.com/p/obsidian-principle-organize-as-you">organizing as you go</a> is a key part of using Obsidian, I&#8217;ve found that defining snippets as you go is a good way of actually getting around to creating snippets. Obsidian has a plugin for snippets called <a href="https://github.com/ArianaKhit/text-snippets-obsidian">Text Snippets</a> that works well enough but defining new snippets was just a bit too much effort for me to make it &#8220;automatic&#8221;. Fortunately a little tweaking with <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> got me what I wanted  - although the solution involved a little more "magic&#8221; that I would like.</p><p>I defined the following two <a href="https://readwithai.substack.com/publish/post/153780880">commands</a>, which I developed within Obsidian itself. </p><pre><code>
newCommand(async function expand_or_create_snippet () {
    let before = lineAtPoint()
    command('text-snippets-obsidian:text-snippets')
    if (before != lineAtPoint()) {
&#9;return&#9;
    }
    let name = wordAtPoint()
    await openSetting("Text Snippets")
    let el = document.evaluate("//*[text()='Text Snippets - Settings']/ancestor::div/descendant::textarea", document).iterateNext()
    let replacement = await promptString()
    el.value = el.value +"\n" + `${name} : ${replacement}`
    el.dispatchEvent(new Event("input"))
    app.setting.close()
    command('text-snippets-obsidian:text-snippets')
})

newCommand(async function open_snippet_settings() {
    openSetting("Text Snippets")
})
</code></pre><p>The first command command</p><ol><li><p>Tries to expand a snippet</p></li><li><p>If it fails to expand then it open the settings</p></li><li><p>Find the textbox to in the snippets plugin where snippets are defined</p></li><li><p>Prompts for a new snippet and inserts it into the textbox</p></li><li><p> (Slightly magic) ensures that Obsidian detects that the value has changed</p></li><li><p>Closes settings and expand the snippet</p></li></ol><p>The second command open the settings for if I want to change snippets. </p><p>Here is an example of the commands in use.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nNDw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nNDw!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 424w, https://substackcdn.com/image/fetch/$s_!nNDw!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 848w, https://substackcdn.com/image/fetch/$s_!nNDw!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 1272w, https://substackcdn.com/image/fetch/$s_!nNDw!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nNDw!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif" width="1007" height="730" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/634b87e2-1458-4219-beef-14170a90a340_1007x730.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:730,&quot;width&quot;:1007,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5160366,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nNDw!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 424w, https://substackcdn.com/image/fetch/$s_!nNDw!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 848w, https://substackcdn.com/image/fetch/$s_!nNDw!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 1272w, https://substackcdn.com/image/fetch/$s_!nNDw!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F634b87e2-1458-4219-beef-14170a90a340_1007x730.gif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This will probably be enough for me to use now. I may well define some commands to change snippets later - and I might end up just removing text snippet entirely since the functionality provided is quite simple. I might even end up using Templater templates instead.  But it&#8217;s good enough for now - which is one of the philosophies of organize as you go.</p><p>Regardless, this is an example of the more <strong>hacky </strong>things that you can do with Plugin Repl.</p><p></p><div><hr></div><p><em>This page is not affiliated with Obsidian. I am the author of Plugin REPL</em></p>]]></content:encoded></item><item><title><![CDATA[Obsidian: Creating a new note from selected text]]></title><description><![CDATA[Obsidian++ Cookbook - &#120143; - YouTube - Official Docs]]></description><link>https://readwithai.substack.com/p/obsidian-creating-a-new-from-selection</link><guid isPermaLink="false">https://readwithai.substack.com/p/obsidian-creating-a-new-from-selection</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Thu, 02 Jan 2025 20:38:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hFpZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian++ Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Docs</a></p><p>When working in Obsidian in can be natural to <a href="https://readwithai.substack.com/p/obsidian-principle-organize-as-you"> &#8220;organize as you go&#8221;</a>. One natural thing to want to do is right things in one note - then decide there is too much detail and create a new note with a region - and it can be helpful if this as simple as possible.</p><p>This is the sort of thing that is easy in <a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> . If you <a href="https://readwithai.substack.com/p/plugin-repl-executing-code">execute the following code</a> in plugin repl:</p><pre><code>newCommand(async function send_selection_to_file() {
&#9;let filename = await promptString("File to send selection to:")
&#9;await writeFile(filename, selection())
&#9;kill()
&#9;insert(`[[${filename}]]`)
})
</code></pre><p>then you will have a command to send a region to a new file that you can run form the </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hFpZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hFpZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 424w, https://substackcdn.com/image/fetch/$s_!hFpZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 848w, https://substackcdn.com/image/fetch/$s_!hFpZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 1272w, https://substackcdn.com/image/fetch/$s_!hFpZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hFpZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif" width="989" height="723" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:723,&quot;width&quot;:989,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:576251,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hFpZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 424w, https://substackcdn.com/image/fetch/$s_!hFpZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 848w, https://substackcdn.com/image/fetch/$s_!hFpZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 1272w, https://substackcdn.com/image/fetch/$s_!hFpZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F258681cf-e8a5-497b-86e8-7a9e561b73a3_989x723.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>You might also like the <a href="https://github.com/lynchjames/note-refactor-obsidian">Note Refactor plugin</a>, which provides similar functionality.</p><p><em>I am not affiliated with Obsidian. I am the author of plugin repl</em></p>]]></content:encoded></item><item><title><![CDATA[Obsidian: All based around commands]]></title><description><![CDATA[Obsidian++ Cookbook - &#120143; - YouTube - Official Docs]]></description><link>https://readwithai.substack.com/p/obsidian-all-based-around-commands</link><guid isPermaLink="false">https://readwithai.substack.com/p/obsidian-all-based-around-commands</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Thu, 02 Jan 2025 20:31:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian++ Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Docs</a></p><p>At it&#8217;s core Obsidian is a markdown editor with commands that get bound to hotkeys and plugins that can add commands (with the slight caveats that some of these commands can render HTML with javascript events!). This philosophy is quite similar to <a href="https://readwithai.substack.com/p/obsidian-and-emacs">Emacs</a>.</p><p>To run a command in Obsidian you can use the command palette that is usually run with <strong>Ctrl-P . </strong> This allows you to search for commands by their names and then run them. </p><p>If you use a command a lot of the time you can define a hotkey by going to the settings (you can get to them from the command palette! or ctrl-,) then if you find the the hotkeys section you can define keys.  I find myself defining hotkeys quite a lot so I have defined a key binding to <a href="https://readwithai.substack.com/p/obsidian-a-hotkey-to-create-hotkeys">jump directly to hotkeys</a>. </p><p>Sometimes it can be difficult to remember hotkeys or you can run of them. I use <a href="https://github.com/moolmanruan/obsidian-sequence-hotkeys">Sequence Hotkeys plugin</a> for this. I then have precises like Alt-D for bindings related to <a href="https://readwithai.substack.com/p/using-obsidian-for-language-learning">learning Danish in Obsidian</a>.</p><p></p><p><em> I am not affiliated with Obsidian I am the author of plugin repl</em></p>]]></content:encoded></item><item><title><![CDATA[Obsidian and Emacs]]></title><description><![CDATA[Obsidian++ Cookbook - &#120143; - YouTube - Official Docs]]></description><link>https://readwithai.substack.com/p/obsidian-and-emacs</link><guid isPermaLink="false">https://readwithai.substack.com/p/obsidian-and-emacs</guid><dc:creator><![CDATA[Read with ai]]></dc:creator><pubDate>Thu, 02 Jan 2025 20:23:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PXgF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27d164e2-31fb-4b1b-a296-5ea6264ea8d0_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl-cookbook">Obsidian++ Cookbook</a> -  <a href="https://x.comy/readwithai">&#120143;</a> - <a href="https://www.youtube.com/@readerai?app=desktop">YouTube</a> - <a href="https://help.obsidian.md/Home">Official Docs</a></p><p><a href="https://www.gnu.org/software/emacs/">Emacs</a> and  <a href="https://orgmode.org/">Org mode</a> are to some degree the "original&#8221; extensible test editor and personal knowledge base. It is unclear the extent to which Obsidian was influenced by these tools. Emacs will have influenced many of the tools that exist in the world which in turn with have influenced the Obsidian designers (potentially via VS Code). Wikipedia is clearly another influence.</p><p>A downside of Emacs is that it not necessarily that easy to use for &#8220;non-programmers&#8221; whereas Obsidian is more discoverable and easy to use. That is why I use it. But you can can inspiration from Obsidian.</p><p><a href="https://readwithai.substack.com/p/obsidian-plugin-repl">Plugin REPL</a> is inspired by the ability to quickly evaluate code to hack up features in Obsidian.</p><div><hr></div><p><em>I am not affiliated with Obsidian. I am the author of plugin repl</em></p>]]></content:encoded></item></channel></rss>