ryoakg
10/13/2015 - 7:45 AM

placeholder image tag with lorempixel.com

placeholder image tag with lorempixel.com

(defun insert-placeholder-img-tag (gray-p width height category)
  "insert placeholder image tag with lorempixel.com"
  (interactive
   (list current-prefix-arg
         (read-number "width: ")
         (read-number "height: ")
         (completing-read
          "category: "
          '("animals" "business" "cats" "abstract" "city"
            "food" "nightlife" "fashion" "people"
            "nature" "sports" "technics" "transport" "technics"))))
  (insert (format "<img src=\"http://lorempixel.com/%s%d/%d/%s\">"
                  (if gray-p "g/" "")
                  width height category)))