Skip to content
/ furit Public

This tool finds unreferenced images from text files such as markdown.

License

Notifications You must be signed in to change notification settings

kemokemo/furit

Repository files navigation

furit ( Find Unreferenced Images in Text files )

License: MIT test-and-build

This tool finds unreferenced images from text files such as markdown.

Install

Homebrew

brew install kemokemo/tap/furit

Scoop

First, add my scoop-bucket.

scoop bucket add kemokemo-bucket https://github.com/kemokemo/scoop-bucket.git

Next, install this app by running the following.

scoop install furit

Binary

Get the latest version from the release page, and download the archive file for your operating system/architecture. Unpack the archive, and put the binary somewhere in your $PATH.

Usage

$ furit -h
Usage: furit [<option>...] <1st path> <2nd path>...
 you can set mutiple paths to search invalid images.

-d, -delete:
    delete unlinked image files (with confirmation)

-f, -force:
    delete unlinked image files without prompting for confirmation

-s, -settings:
    specify the settings file path to exclude files etc..

-t, -type:
    specify the target text format (markdown, html are available)

-h, -help:
    display help

-v, -version:
    display version

Example

$ furit content
content/posts/assets/some_screen.bmp
content/posts/assets/logo.gif

$ echo $?
1

This tool looks recursively for the folder you specify, finds links to images in the text it finds, and enumerates the unreferenced image files from text.

If any unreferenced images were found, it returns 1 as an ExitCode. This is also true for the deletion operation described below.

$ furit -d content
content/posts/assets/some_screen.bmp
content/posts/assets/logo.gif
Are you sure to delete these unlinked images? [y/n]: n
the file deletion process has been canceled by user input

If you want to delete any unreferenced images found by this tool while checking them, just specify the -d flag.

$ furit -d -f content
content/posts/assets/some_screen.bmp
content/posts/assets/logo.gif

You can also specify the -f flag if you want to run the process of deletion automatically without confirmation. In that case, the list of files to be deleted will still be printed.

If the deletion fails, it returns an ExitCode other than 0 and 1.

Supported

Text format

The following text are supported.

  • Markdown
  • HTML

Image format

The following image extensions are supported. They are not case insensitive.

  • png
  • jpg, jpeg
  • bmp
  • gif
  • tif, tiff
  • emf

Notes

If you use img tag in markdown files to specify the image size, please convert to the html files and use html type option.

License

MIT

Author

kemokemo

About

This tool finds unreferenced images from text files such as markdown.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published