mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-12 21:03:32 -06:00
Initial commit
This commit is contained in:
28
node_modules/css-rule-stream/.npmignore
generated
vendored
Normal file
28
node_modules/css-rule-stream/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# Commenting this out is preferred by some people, see
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
||||
node_modules
|
||||
|
||||
# Users Environment Variables
|
||||
.lock-wscript
|
4
node_modules/css-rule-stream/.travis.yml
generated
vendored
Normal file
4
node_modules/css-rule-stream/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.11"
|
||||
- "0.10"
|
22
node_modules/css-rule-stream/LICENSE
generated
vendored
Normal file
22
node_modules/css-rule-stream/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Anand Thakker
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
72
node_modules/css-rule-stream/README.md
generated
vendored
Normal file
72
node_modules/css-rule-stream/README.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
css-rule-stream [](https://travis-ci.org/anandthakker/css-rule-stream)
|
||||
===============
|
||||
|
||||
transform stream to cut css into rule-sized chunks, which come in the form:
|
||||
```javacsript
|
||||
{
|
||||
content: "your css"
|
||||
}
|
||||
```
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
var rules = require('css-rule-stream'),
|
||||
ldjson = require('ldjson-stream');
|
||||
|
||||
fs.readFileSync(__dirnam + '/main.css')
|
||||
.pipe(rules)
|
||||
.pipe(ldjson.serialize())
|
||||
.pipe(process.stdout);
|
||||
```
|
||||
|
||||
**main.css**
|
||||
```
|
||||
div {
|
||||
background: red;
|
||||
}
|
||||
|
||||
.cls {
|
||||
color: green;
|
||||
}
|
||||
|
||||
#id {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* comment */
|
||||
|
||||
@media screen and (min-width: 1000px) {
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
section
|
||||
|
||||
|
||||
{
|
||||
margin: 0;
|
||||
/* comment wthin a rule */
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
body > * {
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
**output**
|
||||
```json
|
||||
{"content":"div {\n background: red;\n}"}
|
||||
{"content":".cls {\n color: green;\n}"}
|
||||
{"content":"#id {\n font-size: 10px;\n}"}
|
||||
{"content":"@media screen and (min-width: 1000px) {\n a {\n text-decoration: underline;\n }\n}"}
|
||||
{"content":"a:hover {\n font-weight: bold; \n}"}
|
||||
{"content":"section \n\n\n{\n margin: 0;\n /* comment wthin a rule */\n padding: 5px;\n}"}
|
||||
{"content":"body > * {\n \n}"}
|
||||
```
|
0
node_modules/css-rule-stream/example.js
generated
vendored
Normal file
0
node_modules/css-rule-stream/example.js
generated
vendored
Normal file
20
node_modules/css-rule-stream/index.js
generated
vendored
Executable file
20
node_modules/css-rule-stream/index.js
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var tokenize = require('css-tokenize'),
|
||||
duplexer = require('duplexer2'),
|
||||
ldjson = require('ldjson-stream'),
|
||||
match = require('./lib/match');
|
||||
|
||||
module.exports = ruleStream;
|
||||
|
||||
function ruleStream() {
|
||||
var tokens = tokenize(), rules = match();
|
||||
tokens.pipe(rules);
|
||||
return duplexer(tokens, rules);
|
||||
}
|
||||
|
||||
if(require.main === module) {
|
||||
process.stdin.pipe(ruleStream())
|
||||
.pipe(ldjson.serialize())
|
||||
.pipe(process.stdout);
|
||||
}
|
60
node_modules/css-rule-stream/lib/match.js
generated
vendored
Normal file
60
node_modules/css-rule-stream/lib/match.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
var through = require('through2');
|
||||
|
||||
|
||||
var newline = '\n'.charCodeAt(0);
|
||||
|
||||
// object mode transform stream takes tokenized css and yields complete,
|
||||
// parseable rules or at-rules as strings.
|
||||
module.exports = function match() {
|
||||
var current = null; // buffer for the current incoming rule.
|
||||
var depth = 0; // track depth to handle rules nested in at-rules.
|
||||
var line = 1, column = 1; // track this and pass it downstream for source mapping.
|
||||
function write(token, enc, next) {
|
||||
var type = token[0], buf = token[1];
|
||||
|
||||
if(('rule_start' === type || 'atrule_start' === type))
|
||||
depth++;
|
||||
if(depth > 0 && !current)
|
||||
current = {location: [line, column], buffers:[]};
|
||||
if('rule_end' === type || 'atrule_end' === type)
|
||||
depth--;
|
||||
|
||||
if(current) {
|
||||
current.buffers.push(buf);
|
||||
if(depth === 0) pushRule.call(this);
|
||||
}
|
||||
|
||||
updatePosition(buf);
|
||||
next();
|
||||
}
|
||||
|
||||
function end(next) {
|
||||
if(current) pushRule.call(this);
|
||||
this.push(null);
|
||||
next();
|
||||
}
|
||||
|
||||
function pushRule() {
|
||||
this.push({
|
||||
line: current.location[0],
|
||||
column: current.location[1],
|
||||
content: Buffer.concat(current.buffers).toString()
|
||||
});
|
||||
current = null;
|
||||
}
|
||||
|
||||
function updatePosition(buf) {
|
||||
for(var i = 0; i < buf.length; i++) {
|
||||
if(buf[i] === newline) {
|
||||
line ++;
|
||||
column = 1;
|
||||
}
|
||||
else {
|
||||
column++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return through.obj(write, end);
|
||||
}
|
88
node_modules/css-rule-stream/package.json
generated
vendored
Normal file
88
node_modules/css-rule-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"css-rule-stream@^1.1.0",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/doiuse"
|
||||
]
|
||||
],
|
||||
"_from": "css-rule-stream@>=1.1.0 <2.0.0",
|
||||
"_id": "css-rule-stream@1.1.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/css-rule-stream",
|
||||
"_nodeVersion": "0.11.14",
|
||||
"_npmUser": {
|
||||
"email": "vestibule@anandthakker.net",
|
||||
"name": "anandthakker"
|
||||
},
|
||||
"_npmVersion": "2.1.8",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "css-rule-stream",
|
||||
"raw": "css-rule-stream@^1.1.0",
|
||||
"rawSpec": "^1.1.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.1.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/doiuse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/css-rule-stream/-/css-rule-stream-1.1.0.tgz",
|
||||
"_shasum": "3786e7198983d965a26e31957e09078cbb7705a2",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "css-rule-stream@^1.1.0",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/doiuse",
|
||||
"author": {
|
||||
"email": "vestibule@anandthakker.net",
|
||||
"name": "Anand Thakker",
|
||||
"url": "http://anandthakker.net"
|
||||
},
|
||||
"bin": {
|
||||
"css-rule-stream": "index.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/anandthakker/css-rule-stream/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"css-tokenize": "^1.0.1",
|
||||
"duplexer2": "0.0.2",
|
||||
"ldjson-stream": "^1.2.1",
|
||||
"through2": "^0.6.3"
|
||||
},
|
||||
"description": "transform stream to cut css into rule-sized chunks",
|
||||
"devDependencies": {
|
||||
"tape": "^3.0.3"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "3786e7198983d965a26e31957e09078cbb7705a2",
|
||||
"tarball": "https://registry.npmjs.org/css-rule-stream/-/css-rule-stream-1.1.0.tgz"
|
||||
},
|
||||
"gitHead": "3797400bfbe4df660690858254b953607a5fe7f3",
|
||||
"homepage": "https://github.com/anandthakker/css-rule-stream",
|
||||
"keywords": [
|
||||
"css",
|
||||
"parse",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "anandthakker",
|
||||
"email": "vestibule@anandthakker.net"
|
||||
}
|
||||
],
|
||||
"name": "css-rule-stream",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/anandthakker/css-rule-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
33
node_modules/css-rule-stream/test/base.js
generated
vendored
Normal file
33
node_modules/css-rule-stream/test/base.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
var fs = require('fs'),
|
||||
test = require('tape'),
|
||||
through = require('through2'),
|
||||
rules = require('../');
|
||||
|
||||
|
||||
test('works', function(t) {
|
||||
var expected = [
|
||||
{"line": 2, "column": 1, "content":"div {\n background: red;\n}"},
|
||||
{"line": 4, "column": 2, "content":".cls {\n color: green;\n}"},
|
||||
{"line": 8, "column": 1, "content":"#id {\n font-size: 10px;\n}"},
|
||||
{"line": 14, "column": 1, "content":"@media screen and (min-width: 1000px) {\n a {\n text-decoration: underline;\n }\n}"},
|
||||
{"line": 20, "column": 1, "content":"a:hover {\n font-weight: bold; \n}"},
|
||||
{"line": 24, "column": 1, "content":"section \n\n\n{\n margin: 0;\n /* comment wthin a rule */\n padding: 5px;\n}"},
|
||||
{"line": 34, "column": 1, "content":"body > * {\n \n}"}
|
||||
]
|
||||
|
||||
t.plan(expected.length + 1);
|
||||
|
||||
var rs = rules();
|
||||
rs.pipe(through.obj(function(chunk, enc, next) {
|
||||
t.same(chunk, expected.shift());
|
||||
next();
|
||||
},
|
||||
function(next) {
|
||||
t.ok(true);
|
||||
next();
|
||||
}));
|
||||
|
||||
fs.createReadStream(__dirname + '/gauntlet.css').pipe(rs);
|
||||
|
||||
})
|
36
node_modules/css-rule-stream/test/gauntlet.css
generated
vendored
Normal file
36
node_modules/css-rule-stream/test/gauntlet.css
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
div {
|
||||
background: red;
|
||||
}.cls {
|
||||
color: green;
|
||||
}
|
||||
|
||||
#id {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* comment */
|
||||
|
||||
@media screen and (min-width: 1000px) {
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
a:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
section
|
||||
|
||||
|
||||
{
|
||||
margin: 0;
|
||||
/* comment wthin a rule */
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
|
||||
body > * {
|
||||
|
||||
}
|
Reference in New Issue
Block a user