Code Monkey home page Code Monkey logo

html-img's Introduction

html-img package Build Status

Fill image size automatically.

take-8

  • Supports HTML, Jade, EJS, ECO, ERB and PHP
  • Supports png, jpg and gif
  • Supports absolute url: Like /images/sample.png (requires document_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 (requires protocol property in project.json)
  • Fills only width, height or both
  • Fills as full or half size
  • Overwrites wrong size

Changelog

Keymap

  • ctrl-i or ctrl-i enter: Fill width and height
  • ctrl-i /: Fill width and height as half
  • ctrl-alt-i or ctrl-alt-i enter: Fill width
  • ctrl-alt-i /: Fill width as half
  • ctrl-shift-i or ctrl-shift-i enter: Fill height
  • ctrl-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"
}

TODO

html-img's People

Contributors

minodisk avatar peterlazar1993 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

html-img's Issues

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:57:13)
Main.activate (/Users/nibushibu/.atom/packages/html-img/lib/Main.coffee:21:9)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)

Package.getStylesheetsPath is deprecated.

Store package style sheets in the styles/ directory instead of stylesheets/ in the html-img package

Package.getStylesheetsPath (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:460:9)
Package.getStylesheetPaths (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:471:32)
Package.loadStylesheets (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:453:38)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:183:19)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.load (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:177:12)

Deprecated Atom APIs will be removed June 1st

Atom will no longer load this package after June 1st without changes. There are a couple deprecations on the latest version of this package:

  1. TextEditor::on is deprecated. Use documented event subscription methods instead.
  2. Requiring $ from atom is no longer supported. If you are using space-pen, please require $ from atom-space-pen-views. Otherwise require jquery instead: {$} = require 'atom-space-pen-views' or $ = require 'jquery' Add "atom-space-pen-views": "^2.0.3" to your package dependencies. Or add "jquery": "^2" to your package dependencies.
  3. Use Workspace::onDidAddTextEditor instead
  4. atom.workspaceView is no longer available. In most cases you will not need the view. See the Workspace docs for alternatives: https://atom.io/docs/api/latest/Workspace. If you do need the view, please use atom.views.getView(atom.workspace), which returns an HTMLElement.
  5. Use TextEditor::onDidChangeGrammar instead

Visit https://gist.github.com/benogle/6d09e295c84b717ef9b4 and search for your package name to see what deprecations are being reported on this package.

See atom/atom#6867 for more info.

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:57:13)
Main.activate (/Users/nibushibu/.atom/packages/html-img/lib/Main.coffee:23:9)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:57:13)
Main.activate (/Users/nibushibu/.atom/packages/html-img/lib/Main.coffee:22:9)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)

Failed to activate the html-img package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.198.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.10.3
Thrown From: html-img package, v0.3.2

Stack Trace

Failed to activate the html-img package

At Cannot read property 'eachEditorView' of undefined

TypeError: Cannot read property 'eachEditorView' of undefined
    at Main.module.exports.Main.activate (/Users/nibushibu/.atom/packages/html-img/lib/Main.coffee:31:25)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:242:19)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:223:30
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:167:15)
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:215:14)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:434:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:418:29
    at Config.module.exports.Config.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:311:16)
    at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:413:19)
    at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:394:46)

Commands

Config

{
  "core": {
    "followSymlinks": true,
    "disabledPackages": [
      "css-color-highlight",
      "jslint",
      "crosshairs",
      "term",
      "resize-panes",
      "pain-split",
      "css-color-highlighting",
      "atom-lint",
      "tab-switcher",
      "caniuse",
      "term2",
      "atom-beautify",
      "linter-scss-lint",
      "linter-tidy",
      "linter-htmlhint"
    ],
    "themes": [
      "atom-dark-ui-slim",
      "monokai"
    ],
    "excludeVcsIgnoredPaths": false
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.2.3
ascii-codes, v0.3.3
atom-alignment, v0.12.1
atom-color-highlight, v3.0.9
atom-dark-ui-slim, v0.47.1
atom-terminal, v0.7.0
autocomplete-paths, v1.0.2
autocomplete-plus, v2.12.1
autocomplete-snippets, v1.4.0
bezier-curve-editor, v0.6.6
color-picker, v1.7.0
compass, v0.7.5
emmet, v2.3.8
file-icons, v1.5.5
filetype-color, v0.1.4
highlight-column, v0.3.2
highlight-line, v0.10.2
html-entities, v0.3.1
html-img, v0.3.2
japanese-wrap, v0.2.7
language-actionscript, v0.2.0
linter, v0.12.1
linter-coffeelint, v0.2.3
linter-csslint, v0.0.12
linter-php, v0.0.12
minimap, v4.8.0
minimap-git-diff, v4.1.2
minimap-highlight-selected, v4.2.1
monokai, v0.14.0
project-manager, v1.15.5
recent-files, v0.3.0
regex-railroad-diagram, v0.7.4
set-syntax, v0.3.0
show-ideographic-space, v0.1.6
space-tab, v0.1.0
status-tab-spacing, v0.3.1
white-cursor, v0.6.0

# Dev
No dev packages

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:57:13)
Main.activate (/Users/nibushibu/.atom/packages/html-img/lib/Main.coffee:21:9)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:57:13)
Main.activate (/Users/nibushibu/.atom/packages/html-img/lib/Main.coffee:22:9)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:238:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)

Object.Object.defineProperty.get is deprecated.

Requiring $ from atom is no longer supported.
If you are using space-pen, please require $ from atom-space-pen-views. Otherwise require jquery instead:
{$} = require 'atom-space-pen-views'
or
$ = require 'jquery'
Add "atom-space-pen-views": "^2.0.3" to your package dependencies.
Or add "jquery": "^2" to your package dependencies.

Object.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app.asar/exports/atom.js:48:11)
Object.<anonymous> (/Users/nibushibu/.atom/packages/html-img/lib/Watcher.coffee:3:2)
Object.<anonymous> (/Users/nibushibu/.atom/packages/html-img/lib/Watcher.coffee:198:4)
Module._compile (module.js:452:26)
Object.requireCoffeeScript (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/coffee-cash/lib/coffee-cash.js:85:19)
Module.load (module.js:347:32)

Package.activateConfig is deprecated.

Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details

Package.activateConfig (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:263:11)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:234:14)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:219:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:163:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:211:14)
PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:435:21)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.