Skip to content

Commit 6515489

Browse files
committed
Removed css-inliner bin
1 parent d82882b commit 6515489

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

README.md

+26-23
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The CSS is inlined as per the supplied options and all stylesheets and style ele
2020
## Install
2121

2222
```
23-
npm install dr-css-inliner -g
23+
npm install dr-css-inliner
2424
```
2525

2626
## Usage:
@@ -29,12 +29,6 @@ npm install dr-css-inliner -g
2929
phantomjs index.js <url> [options]
3030
```
3131

32-
Or as via the globally installed bin:
33-
34-
```
35-
css-inliner <url> [options]
36-
```
37-
3832
#### Options:
3933

4034
* `-w, --width [value]` - Determines the width of the viewport. Defaults to 1200.
@@ -47,7 +41,6 @@ css-inliner <url> [options]
4741
* `-t, --insertion-token [string]` - A token (preferably an HTML comment) to control the exact insertion point of the inlined CSS. If omited default insertion is at the first encountered stylesheet.
4842
* `-i, --css-id [string]` - Determines the id attribute of the inline style tag. By default no id is added.
4943
* `-f, --fake-url` - Defines a _fake_ url context. Required when piping in html through `stdin`. Default is null.
50-
* `-x, --allow-cross-domain` - Allow cross-domain requests (e.g. CSS is located on CDN domain).
5144
* `-d, --debug` - Prints out an HTML comment in the bottom of the output that exposes some info:
5245
* `time` - The time in ms it took to run the script (not including the phantomjs process itself).
5346
* `loadTime` - The time in ms it took to load the webpage.
@@ -62,27 +55,27 @@ css-inliner <url> [options]
6255

6356
Only inline the needed above-the-fold CSS for smaller devices:
6457
```
65-
css-inliner http://www.mydomain.com/index.html -w 350 -h 480 -m > index-mobile.html
58+
phantomjs index.js http://www.mydomain.com/index.html -w 350 -h 480 -m > index-mobile.html
6659
```
6760

6861
Inline all needed CSS for the above-the-fold content on all devices (default 1200px and smaller):
6962
```
70-
css-inliner http://www.mydomain.com/index.html -h 800 > index-page-top.html
63+
phantomjs index.js http://www.mydomain.com/index.html -h 800 > index-page-top.html
7164
```
7265

7366
Inline all needed CSS for webpage:
7467
```
75-
css-inliner http://www.mydomain.com/index.html > index-full-page.html
68+
phantomjs index.js http://www.mydomain.com/index.html > index-full-page.html
7669
```
7770

7871
Inline all needed CSS for webpage with extra required selectors:
7972
```
80-
css-inliner http://www.mydomain.com/index.html -r ".foo > .bar, #myId" > index-full-page.html
73+
phantomjs index.js http://www.mydomain.com/index.html -r ".foo > .bar, #myId" > index-full-page.html
8174
```
8275

8376
Inline all needed CSS for webpage with extra required regexp selector filters:
8477
```
85-
css-inliner http://www.mydomain.com/index.html -r '["\\.foo > ", "\\.span-\\d+"]' > index-full-page.html
78+
phantomjs index.js http://www.mydomain.com/index.html -r '["\\.foo > ", "\\.span-\\d+"]' > index-full-page.html
8679
```
8780

8881
###### Output options
@@ -119,7 +112,7 @@ index.html:
119112
Doing:
120113

121114
```
122-
css-inliner index.html
115+
phantomjs index.js index.html
123116
```
124117

125118
...would get you:
@@ -146,7 +139,7 @@ css-inliner index.html
146139
`-c, --css-only`
147140

148141
```
149-
css-inliner index.html -c
142+
phantomjs index.js index.html -c
150143
```
151144

152145
...would get you:
@@ -164,7 +157,7 @@ css-inliner index.html -c
164157
__Single global variable:__
165158

166159
```
167-
css-inliner index.html -e stylesheets
160+
phantomjs index.js index.html -e stylesheets
168161
```
169162

170163
...would get you:
@@ -192,7 +185,7 @@ css-inliner index.html -e stylesheets
192185
__Namespaced property:__
193186

194187
```
195-
css-inliner index.html -e myNamespace.stylesheets
188+
phantomjs index.js index.html -e myNamespace.stylesheets
196189
```
197190

198191
provided you had an `index.html` like:
@@ -264,7 +257,7 @@ provided you had an `index.html` like:
264257
```
265258

266259
```
267-
css-inliner index.html -t "<!-- CSS goes here -->"
260+
phantomjs index.js index.html -t "<!-- CSS goes here -->"
268261
```
269262

270263
...would get you:
@@ -296,7 +289,7 @@ css-inliner index.html -t "<!-- CSS goes here -->"
296289
Doing:
297290

298291
```
299-
css-inliner index.html -s '["\\.(jpg|gif|png)$","webstat\\.js$"]'
292+
phantomjs index.js index.html -s '["\\.(jpg|gif|png)$","webstat\\.js$"]'
300293
```
301294

302295
... would avoid loading images and a given web statistic script.
@@ -307,7 +300,7 @@ css-inliner index.html -s '["\\.(jpg|gif|png)$","webstat\\.js$"]'
307300

308301
Doing:
309302
```
310-
css-inliner index.html -d
303+
phantomjs index.js index.html -d
311304
```
312305

313306
...would get you:
@@ -339,7 +332,7 @@ css-inliner index.html -d
339332

340333
Doing:
341334
```
342-
css-inliner index.html -i my-inline-css
335+
phantomjs index.js index.html -i my-inline-css
343336
```
344337

345338
...would get you:
@@ -365,13 +358,23 @@ css-inliner index.html -i my-inline-css
365358

366359
`-f, --fake-url [string]`
367360

368-
If you need to parse HTML that is not yet publicly available you can pipe it into `css-inliner`. Below is a contrived example (in a real-world example imagine an httpfilter or similar in place of `cat`):
361+
If you need to parse HTML that is not yet publicly available you can pipe it into `dr-css-inliner`. Below is a contrived example (in a real-world example imagine an httpfilter or similar in place of `cat`):
369362

370363
```
371-
cat not-yet-public.html | css-inliner -f http://www.mydomain.com/index.html
364+
cat not-yet-public.html | phantomjs index.js -f http://www.mydomain.com/index.html
372365
```
373366

374367
All loading of assets will be loaded relative to the _fake_ url - meaning they need to be available already.
375368

376369

370+
---
371+
372+
## Changelog
373+
374+
### 0.5.4
375+
376+
`css-inliner` bin removed due to not working on unix.
377+
378+
379+
377380
[![Analytics](https://ga-beacon.appspot.com/UA-8318361-2/drdk/dr-css-inliner)](https://github.com/igrigorik/ga-beacon)

index.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env phantomjs
2-
31
var debug = {
42
time: new Date(),
53
loadTime: null,

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"name": "dr-css-inliner",
3-
"version": "0.5.3",
3+
"version": "0.5.4",
44
"description": "PhantomJS script to inline above-the-fold CSS for a webpage.",
55
"main": "index.js",
6-
"preferGlobal": "true",
7-
"bin": { "css-inliner": "index.js" },
86
"repository": {
97
"type": "git",
108
"url": "https://github.com/drdk/dr-css-inliner.git"

0 commit comments

Comments
 (0)