Skip to content
/ svgo.el Public

SVG optimization within Emacs with SVGO

License

Notifications You must be signed in to change notification settings

hupf/svgo.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svgo.el

Tests Status GNU GPL v3 MELPA

SVG optimization within Emacs with SVGO

This package uses the Node utility SVGO to optimize SVG files. It provides a command to reduce the size of the SVG contents in the current Emacs buffer.

Installation

To install this package you should use use-package, like so:

(use-package svgo
  :hook
  (nxml-mode . (lambda () (bind-key "M-o" 'svgo nxml-mode-map)))
  (image-mode . (lambda () (bind-key "M-o" 'svgo image-mode-map))))

Also make sure you have Node/NPM installed on your machine.

Usage

Demonstration of the svgo-mode

After opening a SVG file in Emacs, you can execute M-x svgo or, with the key bindings configured as suggested above, press M-o to optimize the file (either in image-mode or after toggling the image display with C-c C-c in nxml-mode).

If the svgo NPM package is missing you will be prompted to automatically install it.

Contribution

Install Cask, then run:

make

Run all tests with:

make test

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Author

Mathis Hofer

About

SVG optimization within Emacs with SVGO

Resources

License

Stars

Watchers

Forks

Packages

No packages published