Skip to content

Commit 6850def

Browse files
committed
docs: add warning
1 parent d2eb037 commit 6850def

File tree

1 file changed

+51
-46
lines changed

1 file changed

+51
-46
lines changed

README.md

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<div align="center">
22
<img src="/icon.png" width="150"/>
33
<h2 align="center">embed.nvim</h1>
4-
<p align="center">Embed images into any markup language, like LaTeX, Markdown or Typst. </p>
4+
<p align="center">Embed images into any markup language, like LaTeX, Markdown or Typst.</p>
55
</div>
66

7-
https://github.com/HakonHarnes/img-clip.nvim/assets/89907156/ab4edc10-d296-4532-bfce-6abdd4f218bf
7+
> [!NOTE]
8+
> This plugin has been renamed from **img-clip.nvim** to **embed.nvim**.
9+
10+
11+
https://github.com/HakonHarnes/embed.nvim/assets/89907156/ab4edc10-d296-4532-bfce-6abdd4f218bf
812

913
### Features
1014

11-
- 📋 Paste images directly from your system clipboard
12-
- 🖱️ Seamlessly drag and drop images from your web browser or file explorer
13-
- 📁 Embed images as files, web URLs, or Base64-encoded data
14-
- 🌐 Automatically download and embed images from the web
15-
- ⚙️ Process images using configurable shell commands
16-
- 🎨 Configurable templates with placeholders for file paths, labels, and cursor positioning
17-
- 📝 Built-in templates for popular markup languages like LaTeX, Markdown, and Typst
18-
- 🔧 Extensive configuration options, including per-project, per-directory, and per-filetype settings
19-
- 🔌 Powerful API with example integrations for popular plugins like [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) and [oil.nvim](https://github.com/stevearc/oil.nvim)
20-
- 💻 Compatible with Linux, macOS, and Windows, including WSL!
15+
- Paste images directly from your system clipboard
16+
- Seamlessly drag and drop images from your web browser or file explorer
17+
- Embed images as files, web URLs, or Base64-encoded data
18+
- Automatically download and embed images from the web
19+
- Process images using configurable shell commands
20+
- Configurable templates with placeholders for file paths, labels, and cursor positioning
21+
- Built-in templates for popular markup languages like LaTeX, Markdown, and Typst
22+
- Extensive configuration options, including per-project, per-directory, and per-filetype settings
23+
- Powerful API with example integrations for popular plugins like [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) and [oil.nvim](https://github.com/stevearc/oil.nvim)
24+
- Compatible with Linux, macOS, and Windows, including WSL!
2125

2226

2327
### Requirements
@@ -27,7 +31,7 @@ https://github.com/HakonHarnes/img-clip.nvim/assets/89907156/ab4edc10-d296-4532-
2731
- **Windows:** No additional requirements
2832

2933
> [!IMPORTANT]
30-
> Run `:checkhealth img-clip` after installation to ensure requirements are satisfied.
34+
> Run `:checkhealth embed` after installation to ensure requirements are satisfied.
3135
3236
### Installation
3337

@@ -37,7 +41,7 @@ Install the plugin with your preferred package manager:
3741

3842
```lua
3943
return {
40-
"HakonHarnes/img-clip.nvim",
44+
"hakonharnes/embed.nvim",
4145
event = "VeryLazy",
4246
opts = {
4347
-- add options here
@@ -68,15 +72,15 @@ The plugin comes with the following commands:
6872
You can also use the Lua equivalent, which allows you to override your configuration by passing the options directly to the function:
6973

7074
```lua
71-
require("img-clip").paste_image(opts?, input?) -- input is optional and can be a file path or URL
75+
require("embed").paste_image(opts?, input?) -- input is optional and can be a file path or URL
7276
```
7377

74-
<details> <summary>Example</summary>
78+
<details>
79+
<summary>Example</summary>
7580

7681
```lua
77-
require("img-clip").paste_image({ use_absolute_path = false, file_name = "image.png" }, "/path/to/file.png")
82+
require("embed").paste_image({ use_absolute_path = false, file_name = "image.png" }, "/path/to/file.png")
7883
```
79-
8084
</details>
8185

8286
### Configuration
@@ -195,7 +199,8 @@ The plugin is highly configurable. Please refer to the default configuration bel
195199

196200
Option values can be configured as either static values (e.g. "assets"), or by dynamically generating them through functions.
197201

198-
<details> <summary>Example: Dynamically set the dir path</summary>
202+
<details>
203+
<summary>Example: Dynamically set the dir path</summary>
199204

200205
To set the `dir_path` to match the name of the currently opened file:
201206

@@ -204,14 +209,14 @@ dir_path = function()
204209
return vim.fn.expand("%:t:r")
205210
end,
206211
```
207-
208212
</details>
209213

210214
### Processing images
211215

212216
The `process_cmd` option allows you to specify a shell command to process the image before saving or embedding it as base64. The command should read the image data from the standard input and write the processed data to the standard output.
213217

214-
<details> <summary>Example: ImageMagick</summary>
218+
<details>
219+
<summary>Example: ImageMagick</summary>
215220

216221
```bash
217222
process_cmd = "convert - -quality 85 -" -- compress the image with 85% quality
@@ -220,7 +225,6 @@ process_cmd = "convert - -colorspace Gray -" -- convert the image to grayscale
220225
```
221226

222227
Ensure the specified command and its dependencies are installed and accessible in your system's shell environment. The above examples require [ImageMagick](https://imagemagick.org/index.php) to be installed.
223-
224228
</details>
225229

226230
### Filetypes
@@ -238,7 +242,8 @@ filetypes = {
238242
}
239243
```
240244

241-
<details> <summary>Example: LaTeX-specific configuration</summary>
245+
<details>
246+
<summary>Example: LaTeX-specific configuration</summary>
242247

243248
If you only want to use absolute file paths for LaTeX, then:
244249

@@ -249,7 +254,6 @@ filetypes = {
249254
}
250255
}
251256
```
252-
253257
</details>
254258

255259
### Overriding options for specific files, directories or custom triggers
@@ -269,7 +273,8 @@ The plugin evaluates the options in the following order:
269273
4. Filetype specific options
270274
5. Default options
271275

272-
<details> <summary>Example</summary>
276+
<details>
277+
<summary>Example</summary>
273278

274279
```lua
275280
-- file specific options
@@ -321,24 +326,24 @@ dirs = {
321326
},
322327
}
323328
```
324-
325329
</details>
326330

327-
### Project-specific settings with the `.img-clip.lua` file
331+
### Project-specific settings with the `.embed.lua` file
328332

329-
Project-specific settings can be specified in a `.img-clip.lua` file in the root of your project.
333+
Project-specific settings can be specified in a `.embed.lua` file in the root of your project.
330334
The plugin will automatically load this file and use it to override the default settings.
331335
If multiple files are found, the closest one to the current file (in any parent directory) will be used.
332336

333-
The `.img-clip.lua` should return a Lua table containing the options (similar to `opts` in lazy.nvim):
337+
The `.embed.lua` should return a Lua table containing the options (similar to `opts` in lazy.nvim):
334338

335339
```lua
336340
return {
337341
-- add options here
338342
}
339343
```
340344

341-
<details> <summary>Example</summary>
345+
<details>
346+
<summary>Example</summary>
342347

343348
```lua
344349
return {
@@ -353,7 +358,6 @@ return {
353358
},
354359
}
355360
```
356-
357361
</details>
358362

359363
### Templates
@@ -371,17 +375,17 @@ For available placeholders, see the following table and the [demonstration](#dem
371375

372376
Templates can also be defined using functions with the above placeholders available as function parameters.
373377

374-
<details> <summary>Example</summary>
378+
<details>
379+
<summary>Example</summary>
375380

376381
```lua
377382
template = function(context)
378383
return "![" .. context.cursor .. "](" .. context.file_path .. ")"
379384
end
380385
```
381-
382386
</details>
383387

384-
## 🖱️ Drag and drop
388+
## Drag and drop
385389

386390
The drag and drop feature enables users to drag images from the web browser or file explorer into the terminal to automatically embed them, in normal mode.
387391
Drag and drop can also be enabled in insert mode by setting the `drag_and_drop.insert_mode` option to `true`.
@@ -566,13 +570,14 @@ A list of terminal emulators and their capabilities is given below.
566570
> [!WARNING]
567571
> MacOS URLs only work in Safari.
568572
569-
## 🔌 Integrations
573+
## Integrations
570574

571575
### Telescope.nvim
572576

573577
The plugin can be integrated with [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) to provide a seamless way to select and embed images using Telescope's powerful fuzzy finding capabilities.
574578

575-
<details> <summary>Example configuration</summary>
579+
<details>
580+
<summary>Example configuration</summary>
576581

577582
```lua
578583
function()
@@ -587,7 +592,7 @@ function()
587592
local filepath = entry[1]
588593
actions.close(prompt_bufnr)
589594

590-
local img_clip = require("img-clip")
595+
local img_clip = require("embed")
591596
img_clip.paste_image(nil, filepath)
592597
end
593598

@@ -601,14 +606,14 @@ end
601606
```
602607

603608
The above function should be bound to a keymap, e.g. through lazy.nvim.
604-
605609
</details>
606610

607611
### Oil.nvim
608612

609613
The plugin also integrates with [oil.nvim](https://github.com/stevearc/oil.nvim), providing a convenient way to browse and select images using Oil's file explorer.
610614

611-
<details> <summary>Example configuration</summary>
615+
<details>
616+
<summary>Example configuration</summary>
612617

613618
```lua
614619
function()
@@ -617,7 +622,7 @@ function()
617622
local dir = oil.get_current_dir()
618623
oil.close()
619624

620-
local img_clip = require("img-clip")
625+
local img_clip = require("embed")
621626
img_clip.paste_image({}, dir .. filename)
622627
end
623628
```
@@ -626,9 +631,10 @@ The above function should be bound to a keymap, e.g. through lazy.nvim.
626631

627632
</details>
628633

629-
Alternatively, you can invoke img-clip.nvim directly from your oil.nvim configuration:
634+
Alternatively, you can invoke embed.nvim directly from your oil.nvim configuration:
630635

631-
<details> <summary>Example configuration</summary>
636+
<details>
637+
<summary>Example configuration</summary>
632638

633639
```lua
634640
keymaps = {
@@ -638,14 +644,13 @@ keymaps = {
638644
local dir = oil.get_current_dir()
639645
oil.close()
640646

641-
local img_clip = require("img-clip")
642-
img_clip.paste_image({}, dir .. filename)
647+
local embed = require("embed")
648+
embed.paste_image({}, dir .. filename)
643649
end,
644650
}
645651
```
646-
647652
</details>
648653

649-
## 🙌 Contributing
654+
## Contributing
650655

651656
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue on the GitHub repository.

0 commit comments

Comments
 (0)