obsidian-popclip
obsidian-popclip copied to clipboard
An extension and a plugin for Popclip and Obsidian respectively.
Obsidian Popclip Plugin
The plugin allows you to store the text you select on Obsidian which is captured by Popclip app.
What are the requirements?
- You need a Popclip app on your MacOS.
- You need an Obsidian app on your MacOS.
How does it work?
There are two part of the workflow.
- Installing the Popclip extension.
- Installing the Obsidian plugin.
Part I: Popclip Extension
You can select the below text to install extension. Fill the vault
as your Obsidian vault name, and location
as the target directory which must be relative to the root of the vault.
# PopClip - Obsidian extension, markdown variant
name: ObsidianClipper
icon: O
capture html: true
options:
- identifier: "vault"
label: "Vault name"
type: string
- identifier: "path"
label: "Location"
type: string
javascript: |
const vaultName = encodeURIComponent(popclip.options.vault)
const fileLocation = encodeURIComponent(popclip.options.path)
const data = {
clipping: popclip.input.markdown,
path: fileLocation || undefined,
}
let clipping = popclip.input.markdown
if (popclip.context.browserUrl.length > 0) { // append markdown source link if available
data["title"] = popclip.context.browserTitle
data["source"] = popclip.context.browserUrl
}
clipping = encodeURIComponent(JSON.stringify(data))
popclip.openUrl(`obsidian://advanced-uri?vault=${vaultName}&daily=true&heading=popclip&data=%0A${clipping}&mode=append`)
#end
Part II: Installing the Obsidian plugin.
I didn't submit the plugin yet. I'm planning to submit it soon.
Therefore, you need to install it manually:
- Download GitHub repository of Obsidian Popclip plugin .
- Copy the
popclip
folder underdist
directory. - Paste the copied
popclip
folder under your Obsidian plugin folder.obsidian/plugins
. - Restart Obsidian.
Special thanks for Nick and EdM for their sharings on this Popclip forum post