Selective Inline Copy

unlisted

by Felix-CodingClimber

Adds a copy button to inline code blocks starting with [copy].

Updated 3d agoMIT
View on GitHub

Selective Inline Copy

Inline code with copy buttons in Obsidian

Add a copy button to selected inline code in Obsidian.

Usage

Start an inline code span with [copy] followed by a space:

`[copy] npm install`

In reading view, the marker is hidden and the copy button copies npm install. Other inline code and fenced code blocks are unchanged.

Installation

Download main.js, manifest.json, and styles.css from a published release and put them in your vault's .obsidian/plugins/selective-inline-copy/ folder. Reload Obsidian, then enable Selective Inline Copy under Settings → Community plugins.

To build from source instead, run npm install and npm run build, then copy the same three files to that folder.

Releases

In a clean working tree, run npm version patch (or minor or major) to update the version files and create a commit and tag. Push the commit and the matching tag (without a v prefix). The release workflow builds and publishes main.js, manifest.json, and styles.css. Alternatively, run Release Obsidian plugin from Actions with an existing tag that has no release.

The workflow builds the tagged commit, not the branch selected when dispatching it. Before pushing a tag, check that git show <tag>:manifest.json contains the same version as the tag. If an existing tag points to a commit with a different manifest version, do not rerun it expecting a later branch commit to be used. Instead, create and push a new version commit and its matching tag. In particular, the existing 1.0.1 tag points to a 1.0.0 manifest; after merging the version synchronization, use the next patch version (1.0.2) for the next release.

License

MIT. This project is based on the Obsidian sample plugin; its original license notice is in NOTICE.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.