Fill image size automatically.
- Supports HTML, Jade, EJS, ECO, ERB and PHP
- Supports png, jpg and gif
- Supports absolute url: Like
/images/sample.png
(requiresdocument_root
property in project.json) - Supports relative url: Like
images/smaple.png
- Supports protocol-absolute url: Like
http://example.com/images/sample.png
- Supports protocol-relative url: Like
//example.com/images/sample.png
(requiresprotocol
property in project.json) - Fills only width, height or both
- Fills as full or half size
- Overwrites wrong size
Keymap
ctrl-i
orctrl-i enter
: Fill width and heightctrl-i /
: Fill width and height as halfctrl-alt-i
orctrl-alt-i enter
: Fill widthctrl-alt-i /
: Fill width as halfctrl-shift-i
orctrl-shift-i enter
: Fill heightctrl-shift-i /
: Fill height as half
Override keymap with Atom > Open Your Keymap
.
Configuration
When you specify src
absolute or protocol-relative url, you can create project.json
at the project root.
project.json
document_root
: Used for resolving absolute url. Default is''
.protocol
: Used for resolving protocol-relative url. Default is'http'
.
Example
.
├──public # Document root
│ └──index.html # Files
└──project.json # Configuration for html-img
{
"document_root": "public",
"protocol": "https"
}