WIP: Add setting to save image based on buffer name #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This is a work in progress.
Sometimes, we want to move a document around and then we have to search for its related images and move them around too, individually, or update image paths inside documents.
This PR allows for one extra setting which will make it possible to insert images in a directory named after the current buffer name.
For example, if the current buffer is
docs/intro.adoc
, the image will be copied todocs/intro.assets/<img-name>.png
.Or, if the current buffer is
notes/fp/concepts.md
, then the image will benotes/fp/concepts.assets/<img-name>.png
.It should work the same no matter the document file extension.
This allows for the document file and its assets directory to be moved together so that wherever the document is moved too, the images (or other assets, potentially) are moved together.
PS: I copied this idea from Typora (not sure if Typora invented it, but it is where I saw it and found it a useful approach for certain scenarios).