japr 0.2.4 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -23
- data/lib/japr/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
JAPR is a powerful asset pipeline that automatically collects, converts and compresses / minifies your site's JavaScript and CSS assets when you compile your Jekyll site.
|
6
6
|
|
7
|
-
This project is a fork of [Jekyll Asset Pipeline](https://github.com/matthodan/jekyll-asset-pipeline) which, unfortunately, was pretty much abandonware.
|
7
|
+
This project is a fork of [Jekyll Asset Pipeline](https://github.com/matthodan/jekyll-asset-pipeline) by [Matt Hodan](https://github.com/matthodan) which, unfortunately, was pretty much abandonware.
|
8
8
|
|
9
9
|
## Table of Contents
|
10
10
|
|
@@ -18,7 +18,6 @@ This project is a fork of [Jekyll Asset Pipeline](https://github.com/matthodan/j
|
|
18
18
|
- [Octopress](#octopress)
|
19
19
|
- [Contribute](#contribute)
|
20
20
|
- [Community](#community)
|
21
|
-
- [Code Status](#code-status)
|
22
21
|
- [Credits](#credits)
|
23
22
|
- [License](#license)
|
24
23
|
|
@@ -35,14 +34,14 @@ This project is a fork of [Jekyll Asset Pipeline](https://github.com/matthodan/j
|
|
35
34
|
|
36
35
|
JAPR's workflow can be summarized as follows:
|
37
36
|
|
38
|
-
1.
|
39
|
-
2.
|
40
|
-
3.
|
41
|
-
4.
|
37
|
+
1. Reviews site markup for instances of the `css_asset_tag` and `javascript_asset_tag` Liquid tags. Each occurrence of either of these tags identifies when a new bundle needs to be created and outlines (via a manifest) which assets to include in the bundle.
|
38
|
+
2. Collects raw assets based on the manifest and runs them through converters / preprocessors (if necessary) to convert them into valid CSS or JavaScript.
|
39
|
+
3. Combines the processed assets into a single bundle, compresses the bundled assets (if desired) and saves the compressed bundle to the "_site" output folder.
|
40
|
+
4. Replaces `css_asset_tag` and `javascript_asset_tag` Liquid tags with HTML "link" and "script" tags, respectively, that link to the finished bundles.
|
42
41
|
|
43
42
|
## Getting Started
|
44
43
|
|
45
|
-
JAPR is extremely easy to add to your Jekyll project and has no incremental
|
44
|
+
JAPR is extremely easy to add to your Jekyll project and has no incremental dependencies beyond those required by Jekyll. Once you have a basic Jekyll site up and running, follow the steps below to install and configure JAPR.
|
46
45
|
|
47
46
|
1. Install the "japr" gem via [Rubygems](http://rubygems.org/).
|
48
47
|
|
@@ -58,7 +57,7 @@ JAPR is extremely easy to add to your Jekyll project and has no incremental depe
|
|
58
57
|
require 'japr'
|
59
58
|
```
|
60
59
|
|
61
|
-
3. Move your assets into a Jekyll ignored folder (i.e. a folder that begins with an underscore "\_") so that Jekyll won't include these raw assets in the site output.
|
60
|
+
3. Move your assets into a Jekyll ignored folder (i.e. a folder that begins with an underscore "\_") so that Jekyll won't include these raw assets in the site output. It is recommended to use an "\_assets" folder to hold your site's assets.
|
62
61
|
|
63
62
|
4. Add the following [Liquid](http://liquidmarkup.org/) blocks to your site's HTML "head" section. These blocks will be converted into HTML "link" and "script" tags that point to bundled assets. Within each block is a manifest of assets to include in the bundle. Assets are included in the same order that they are listed in the manifest. Replace the "foo" and "bar" assets with your site's assets. At this point we are just using plain old javascript and css files (hence the ".js" and ".css" extensions). See the [Asset Preprocessing](#asset-preprocessing) section to learn how to include files that must be preprocessed (e.g. CoffeeScript, Sass, Less, Erb, etc.). Name the bundle by including a string after the opening tag. We've named our bundles "global" in the below example.
|
64
63
|
|
@@ -132,9 +131,9 @@ In the following example, we will add a preprocessor that converts CoffeeScript
|
|
132
131
|
|
133
132
|
That is it! Your asset pipeline has converted any CoffeeScript assets into JavaScript before adding them to a bundle.
|
134
133
|
|
135
|
-
### SASS/SCSS
|
134
|
+
### SASS / SCSS
|
136
135
|
|
137
|
-
You probably get the gist of how converters work, but
|
136
|
+
You probably get the gist of how converters work, but here's an example of a SASS converter for quick reference.
|
138
137
|
|
139
138
|
``` ruby
|
140
139
|
module JAPR
|
@@ -214,7 +213,7 @@ That is it! Your asset pipeline has compressed your CSS and JavaScript assets.
|
|
214
213
|
|
215
214
|
### Google's Closure Compiler
|
216
215
|
|
217
|
-
You probably get the gist of how compressors work, but
|
216
|
+
You probably get the gist of how compressors work, but here's an example of a Google Closure Compiler compressor for quick reference.
|
218
217
|
|
219
218
|
``` ruby
|
220
219
|
class JavaScriptCompressor < JAPR::Compressor
|
@@ -300,13 +299,13 @@ If you have any difficulties using JAPR with Octopress, please [open an issue](h
|
|
300
299
|
|
301
300
|
## Contribute
|
302
301
|
|
303
|
-
You can contribute to the JAPR by submitting a pull request [via GitHub](https://github.com/
|
302
|
+
You can contribute to the JAPR by submitting a pull request [via GitHub](https://github.com/kitsched/japr). There are a few areas that need improvement:
|
304
303
|
|
305
|
-
- __Tests, tests, tests.__
|
306
|
-
- __Handle remote assets.__ Right now, JAPR does not provide any way to include remote assets in bundles unless you save them locally before generating your site. Moshen's [Jekyll Asset Bundler](https://github.com/moshen/jekyll-asset_bundler) allows you to include remote assets, which
|
307
|
-
- __Successive preprocessing.__ Currently you can only preprocess a file once. It would be better if you could run an asset through multiple preprocessors before it gets compressed and bundled.
|
304
|
+
- __Tests, tests, tests.__ **This project is now almost fully tested.**
|
305
|
+
- __Handle remote assets.__ Right now, JAPR does not provide any way to include remote assets in bundles unless you save them locally before generating your site. Moshen's [Jekyll Asset Bundler](https://github.com/moshen/jekyll-asset_bundler) allows you to include remote assets, which is pretty interesting. That said, it is generally better to keep remote assets separate so that they load asynchronously.
|
306
|
+
- __Successive preprocessing.__ Currently you can only preprocess a file once. It would be better if you could run an asset through multiple preprocessors before it gets compressed and bundled. **As of v0.1.0, JAPR now supports successive preprocessing.**
|
308
307
|
|
309
|
-
|
308
|
+
If you have any ideas or you would like to see anything else improved please use the [issues section](https://github.com/kitsched/japr/issues).
|
310
309
|
|
311
310
|
## Community
|
312
311
|
|
@@ -315,14 +314,9 @@ Feel free to message me on [Twitter](http://twitter.com/matthodan) or [Facebook]
|
|
315
314
|
|
316
315
|
## Credits
|
317
316
|
|
318
|
-
|
319
|
-
|
320
|
-
I also have to give credit to [Mojombo](https://github.com/mojombo) for creating [Jekyll](https://github.com/mojombo/jekyll) in the first place.
|
317
|
+
* [Moshen](https://github.com/moshen/) for creating the [Jekyll Asset Bundler](https://github.com/moshen/jekyll-asset_bundler).
|
318
|
+
* [Mojombo](https://github.com/mojombo) for creating [Jekyll](https://github.com/mojombo/jekyll) in the first place.
|
321
319
|
|
322
320
|
## License
|
323
321
|
|
324
322
|
JAPR is released under the [MIT License](http://opensource.org/licenses/MIT).
|
325
|
-
|
326
|
-
---
|
327
|
-
|
328
|
-
Like this project? You may want to read [my blog](http://www.matthodan.com).
|
data/lib/japr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: japr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '2.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '2.0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: liquid
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|