No description
Find a file
2025-02-04 12:16:50 -08:00
.github/workflows add release workflow 2025-02-04 12:16:50 -08:00
docs readme 2025-02-04 12:06:18 -08:00
src fuzzy matching of references 2025-02-04 09:59:48 -08:00
.editorconfig Initial commit 2025-02-03 09:37:51 -08:00
.eslintignore Initial commit 2025-02-03 09:37:51 -08:00
.eslintrc Initial commit 2025-02-03 09:37:51 -08:00
.gitignore Initial commit 2025-02-03 09:37:51 -08:00
.node-version replacing sample code 2025-02-03 10:20:53 -08:00
.npmrc Initial commit 2025-02-03 09:37:51 -08:00
esbuild.config.mjs Initial commit 2025-02-03 09:37:51 -08:00
jest.config.js tests 2025-02-03 11:18:04 -08:00
LICENSE replacing sample code 2025-02-03 10:20:53 -08:00
main.ts move cursor after paste 2025-02-04 11:15:11 -08:00
manifest.json replacing sample code 2025-02-03 10:20:53 -08:00
package-lock.json fuzzy matching of references 2025-02-04 09:59:48 -08:00
package.json fuzzy matching of references 2025-02-04 09:59:48 -08:00
README.md readme 2025-02-04 12:06:18 -08:00
tsconfig.json Initial commit 2025-02-03 09:37:51 -08:00
version-bump.mjs Initial commit 2025-02-03 09:37:51 -08:00
versions.json Initial commit 2025-02-03 09:37:51 -08:00

"Paste Quote" Obsidian Plugin

This is a small Obsidian plugin to help with formatting and citing quotations when pasting them from the clipboard. Currently, citation support only applies to quotes pasted from the Kindle app, and is focused on generating Pandoc-style citations.

Formatting

Suppose you have this text on the clipboard:

“You know,” Jacob yawned, “I think it's time for a nap.”

If you use the Paste quote command while your cursor is at the beginning of a line, this will be pasted as a block quote:

A sample document before pasting, where the cursor is at the beginning of a line

A sample document after pasting, where the quote has been pasted as a blockquote

But if the cursor is in the middle of a line, then quotation marks will be added around the quote, and any internal double quotes are changed to single quotes, like this:

A sample document before pasting, where the cursor is not at the beginning of a line

A sample document after pasting, where the quote has been surrounded by quotation marks and the double quotes within it have been replaced with single quotes

Citations

If you copy text from the Kindle app, you'll end up with something like this on your clipboard:

The professional tackles the project that will make him stretch. He takes on the assignment that will bear him into uncharted waters, compel him to explore unconscious parts of himself.

Pressfield, Steven. The War of Art (pp. 40-41). (Function). Kindle Edition. 

The Paste quote command will change the citation format when pasting this. The new format depends on whether you have a references section in your note's front matter. If you don't have a references section, then a simple title and page number format is used:

A sample document before pasting

A sample document after pasting, which includes the quote and a citation in the format (The War of Art, p. 40-41)

If your document does have a references section in its frontmatter, then the plugin will try to find the correct reference for the quote based on the title and authors, and generate a Pandoc-style citation using the corresponding id. Example:

A sample document containing a references section with a reference with id "pressfield2002"

A sample document after pasting, which includes the quote and a citation in the format [@pressfield2002, p. 40-41]

Note: the match between the title/authors on the clipboard and the title/authors of the reference entry doesn't have to be exact. Since the plugin uses fuzzy matching, it is possible for it to choose the wrong reference.