Skip to content

Commit

Permalink
feat(core): rebrand with new name grunt-assets-inline
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Aug 12, 2015
1 parent 6f902d4 commit 3ac1b9c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 38 deletions.
10 changes: 5 additions & 5 deletions Gruntfile.js
@@ -1,8 +1,8 @@
/*
* grunt-html-smoosher
* https://github.com/motherjones/grunt-html-smoosher
* grunt-assets-inline
* https://github.com/sparanoid/assets-inline
*
* Copyright (c) 2013 Ben Breedlove
* Copyright (c) 2015 Tunghsiao Liu
* Licensed under the MIT license.
*/

Expand All @@ -29,7 +29,7 @@ module.exports = function(grunt) {
},

// Configuration to be run (and then tested).
smoosher: {
inline: {
default_options: {
files: {
'tmp/default_options': 'test/fixtures/index.html',
Expand All @@ -54,7 +54,7 @@ module.exports = function(grunt) {

// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'smoosher', 'nodeunit']);
grunt.registerTask('test', ['clean', 'inline', 'nodeunit']);

// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
Expand Down
File renamed without changes.
31 changes: 16 additions & 15 deletions README.md
@@ -1,32 +1,33 @@
# grunt-html-smoosher
[![Build Status](https://api.travis-ci.org/sparanoid/grunt-html-smoosher.svg?branch=master)](https://travis-ci.org/sparanoid/grunt-html-smoosher)
# grunt-assets-inline
[![Build Status](https://api.travis-ci.org/sparanoid/grunt-assets-inline.svg?branch=master)](https://travis-ci.org/sparanoid/grunt-assets-inline)

> A grunt task which takes a html file, finds all the css and js links, and outputs a version with all the css and js written inline for ease of pasting into a cms
> A grunt task which takes a html file, finds all the css, js links and images, and outputs a version with all the css, js and images (Base64) written inline.
## Getting Started

This plugin requires Grunt `~0.4.1`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-html-smoosher --save-dev
npm install grunt-assets-inline --save-dev
```

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-html-smoosher');
grunt.loadNpmTasks('grunt-assets-inline');
```

## The "smoosher" task
## The "inline" task

### Overview

In your project's Gruntfile, add a section named `smoosher` to the data object passed into `grunt.initConfig()`.
In your project's Gruntfile, add a section named `inline` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
smoosher: {
inline: {
options: {
jsTags: { // optional
start: '<script type="text/javascript">', // default: <script>
Expand All @@ -53,7 +54,7 @@ Minify scripts with UglifyJS.
```js

grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
minify: true
Expand All @@ -74,7 +75,7 @@ When you have absolute paths for your external assets, it helps to add the local

```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
jsDir: "../",
Expand Down Expand Up @@ -107,7 +108,7 @@ If you want to smoosh `img` sources to Base64 in HTML, you can set `inlineImg` t

```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
inlineImg: true
Expand All @@ -128,7 +129,7 @@ If you want to smoosh SVGs in `img` tags in HTML, you can set `inlineSvg` to tru

```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
inlineSvg: true
Expand All @@ -149,7 +150,7 @@ Defaults to `false`.

```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
inlineSvg: true,
Expand Down Expand Up @@ -177,7 +178,7 @@ This option only searchs for URLs begin with `../`.

```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
assetsUrlPrefix: '<%= config.base %>/assets/'
Expand All @@ -196,7 +197,7 @@ Defaults to `""`.

```js
grunt.initConfig({
smoosher: {
inline: {
all: {
options: {
includeTag: "?assets-inline"
Expand Down
33 changes: 17 additions & 16 deletions package.json
@@ -1,26 +1,24 @@
{
"name": "grunt-html-smoosher",
"description": "A grunt task which takes a html file, finds all the css and js links, and outputs a version with all the css and js written inline for ease of pasting into a cms",
"name": "grunt-assets-inline",
"description": "A grunt task which takes a html file, finds all the css, js links and images, and outputs a version with all the css, js and images (Base64) written inline.",
"version": "0.1.6",
"homepage": "https://github.com/motherjones/grunt-html-smoosher",
"homepage": "https://github.com/sparanoid/grunt-assets-inline",
"author": {
"name": "Ben Breedlove",
"email": "benbreedlove@gmail.com",
"url": "https://github.com/benbreedlove"
"name": "Tunghsiao Liu",
"email": "t@sparanoid.com"
},
"contributors": [{
"name": "Ben Breedlove",
"email": "benbreedlove@gmail.com"
}],
"repository": {
"type": "git",
"url": "git://github.com/motherjones/grunt-html-smoosher.git"
"url": "git://github.com/sparanoid/grunt-assets-inline.git"
},
"bugs": {
"url": "https://github.com/motherjones/grunt-html-smoosher/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/motherjones/grunt-html-smoosher/blob/master/LICENSE-MIT"
}
],
"url": "https://github.com/sparanoid/grunt-assets-inline/issues"
},
"license": "MIT",
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
Expand All @@ -45,6 +43,9 @@
"gruntplugin",
"embed",
"stylesheet",
"javascript"
"javascript",
"css",
"js",
"svg"
]
}
10 changes: 9 additions & 1 deletion tasks/html_smoosher.js → tasks/assets_inline.js
@@ -1,3 +1,11 @@
/*
* grunt-assets-inline
* https://github.com/sparanoid/assets-inline
*
* Copyright (c) 2015 Tunghsiao Liu
* Licensed under the MIT license.
*/

/*
* grunt-html-smoosher
* https://github.com/motherjones/grunt-html-smoosher
Expand All @@ -15,7 +23,7 @@ module.exports = function(grunt) {
var url = require('url');
var uglify = require('uglify-js');

grunt.registerMultiTask('smoosher', 'Turn your distribution into something pastable.', function() {
grunt.registerMultiTask('inline', 'Turn your distribution into something pastable.', function() {

var options = this.options({
jsDir: "",
Expand Down
2 changes: 1 addition & 1 deletion test/html_smoosher_test.js → test/assets_inline_test.js
Expand Up @@ -22,7 +22,7 @@ var grunt = require('grunt');
test.ifError(value)
*/

exports.html_smoosher = {
exports.assets_inline = {
setUp: function(done) {
// setup here if necessary
done();
Expand Down

0 comments on commit 3ac1b9c

Please sign in to comment.