https://github.com/chrisgrieser/obsidian-smarter-paste

Improvements for when you paste things into Obsidian

https://github.com/chrisgrieser/obsidian-smarter-paste

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: researchgate.net
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.2%) to scientific vocabulary

Keywords

obsidian-plugin
Last synced: 6 months ago · JSON representation

Repository

Improvements for when you paste things into Obsidian

Basic Info
  • Host: GitHub
  • Owner: chrisgrieser
  • License: mit
  • Language: TypeScript
  • Default Branch: master
  • Homepage:
  • Size: 49.8 KB
Statistics
  • Stars: 9
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Archived
Topics
obsidian-plugin
Created over 3 years ago · Last pushed about 3 years ago
Metadata Files
Readme Changelog Funding License

README.md

Pasta Copinara 🍝

This plugin is obsolete, the full feature set has been sherlocked by the Linter plugin: https://github.com/platers/obsidian-linter#paste-rules


Various improvements for when you copypaste things into Obsidian.

This plugin works by modifying the default paste function, meaning you can simply continue using cmd/ctrl + v as you always did.

Table of Contents"

Modifications

  • Leftover hyphenation and footnote references (e.g. when copying from PDFs) are removed.
  • Two or more consecutive blank lines are reduced to one blank line; leading and trailing whitespace is removed.
  • If you paste a list item into a line that already has list syntax, the "double list syntax" that would normally occur (- - some item) is fixed. The same is done for markdown task syntax (- [ ]).
  • If the cursor is in a blockquote or callout when the pasting and the clipboard contains multi-line content, the appropriate syntax will be applied to all lines pasted.

ℹ️ Note that Pasta Copinara respects the Obsidian setting Auto Convert HTML.

Commands added

  • Paste as Plain Text without Modifications: Utility Command which pastes the clipboard content as plain text and without any modifications. Also circumvents pasting-modifications from other plugins like Auto Link Title.

Limitations

  • The plugin only works with the standard pasting (cmd/ctrl + v) shortcut, and not with the p operator in vim. (Pasting with cmd/ctrl + v in normal or insert mode does work though.)
  • To avoid conflicts with Plugins like Auto Link Title or Paste URL into Selection, Pasta Copinara will not be triggered when an URL is detected in the clipboard.

Installation

Right now, the plugin is still in beta. It can be installed with the BRAT Plugin.

When published, it will be available in Obsidian's Community Plugin Browser via: SettingsCommunity PluginsBrowse → Search for "Pasta Copinara"

Contribute

Adding more rules to clipboardConversions.ts should be fairly straightforward and self-contained. To add new formatting rules, basic JavaScript and Regex should be enough.

Please use the .eslintrc configuration located in the repository and run eslint before doing a pull request, and please do not use prettier. 🙂

```shell

Run eslint fixing most common mistakes

eslint --fix *.ts ```

Credits

Thanks to @zolrath for the Auto-Link Title Plugin which showed me how to modify paste events correctly.

About the Developer

In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch!

Profiles

Donate

Buy Me a Coffee at ko-fi.com

If you feel very generous, you may also buy me something from my Amazon wish list. But please donate something to developers who still go to college, before you consider buying me an item from my wish list! 😊

Amazon wish list

Owner

  • Name: Chris Grieser
  • Login: chrisgrieser
  • Kind: user
  • Location: Berlin, Germany
  • Company: Technical University of Berlin

Researcher in sociology & software developer

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Dependencies

package.json npm
  • @types/node ^16.11.6 development
  • @typescript-eslint/eslint-plugin ^5.2.0 development
  • @typescript-eslint/parser ^5.2.0 development
  • builtin-modules ^3.2.0 development
  • esbuild 0.13.12 development
  • obsidian ^0.12.17 development
  • tslib 2.3.1 development
  • typescript 4.4.4 development