From fe8994884a27083c4bc511f2df608be80d6f33b8 Mon Sep 17 00:00:00 2001 From: ForbesLindesay Date: Wed, 23 Dec 2015 04:17:04 +0000 Subject: [PATCH] Rename to pug-loader --- README.md | 28 ++++++++++++++-------------- index.js | 2 +- package.json | 14 +++++++------- test/{bar.jade => bar.pug} | 0 test/{bing.jade => bing.pug} | 0 test/expected.json | 34 +++++++++++++++++----------------- test/foo.jade | 4 ---- test/foo.pug | 4 ++++ test/index.js | 8 ++++---- 9 files changed, 47 insertions(+), 47 deletions(-) rename test/{bar.jade => bar.pug} (100%) rename test/{bing.jade => bing.pug} (100%) delete mode 100644 test/foo.jade create mode 100644 test/foo.pug diff --git a/README.md b/README.md index 2754009..1ac2022 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# jade-load +# pug-loader -The jade loader is responsible for loading the depenendencies of a given jade file. It adds `fullPath` and `str` properties to every `Include` and `Extends` node. It also adds an `ast` property to any `Include` nodes that are loading jade and any `Extends` nodes. It then recursively loads the dependencies of any of those included files. +The pug loader is responsible for loading the depenendencies of a given pug file. It adds `fullPath` and `str` properties to every `Include` and `Extends` node. It also adds an `ast` property to any `Include` nodes that are loading pug and any `Extends` nodes. It then recursively loads the dependencies of any of those included files. -[![Build Status](https://img.shields.io/travis/jadejs/jade-load/master.svg)](https://travis-ci.org/jadejs/jade-load) -[![Dependency Status](https://img.shields.io/gemnasium/jadejs/jade-load.svg)](https://gemnasium.com/jadejs/jade-load) -[![NPM version](https://img.shields.io/npm/v/jade-load.svg)](https://www.npmjs.org/package/jade-load) +[![Build Status](https://img.shields.io/travis/pugjs/pug-loader/master.svg)](https://travis-ci.org/pugjs/pug-loader) +[![Dependency Status](https://img.shields.io/gemnasium/pugjs/pug-loader.svg)](https://gemnasium.com/pugjs/pug-loader) +[![NPM version](https://img.shields.io/npm/v/pug-loader.svg)](https://www.npmjs.org/package/pug-loader) ## Installation - npm install jade-load + npm install pug-loader ## Usage @@ -58,14 +58,14 @@ This function is not meant to be called from outside of `jade-load`, but rather ```js var fs = require('fs'); -var lex = require('jade-lexer'); -var parse = require('jade-parser'); -var load = require('jade-load'); +var lex = require('pug-lexer'); +var parse = require('pug-parser'); +var load = require('pug-loader'); // you can do everything very manually -var str = fs.readFileSync('bar.jade', 'utf8'); -var ast = load(parse(lex(str, 'bar.jade'), 'bar.jade'), { +var str = fs.readFileSync('bar.pug', 'utf8'); +var ast = load(parse(lex(str, 'bar.pug'), 'bar.pug'), { lex: lex, parse: parse, resolve: function (filename, source, options) { @@ -76,8 +76,8 @@ var ast = load(parse(lex(str, 'bar.jade'), 'bar.jade'), { // or you can do all that in just two steps -var str = fs.readFileSync('bar.jade', 'utf8'); -var ast = load.string(str, 'bar.jade', { +var str = fs.readFileSync('bar.pug', 'utf8'); +var ast = load.string(str, 'bar.pug', { lex: lex, parse: parse, resolve: function (filename, source, options) { @@ -88,7 +88,7 @@ var ast = load.string(str, 'bar.jade', { // or you can do all that in only one step -var ast = load.file('bar.jade', { +var ast = load.file('bar.pug', { lex: lex, parse: parse, resolve: function (filename, source, options) { diff --git a/index.js b/index.js index b2f3f45..eef9e4d 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ var fs = require('fs'); var path = require('path'); -var walk = require('jade-walk'); +var walk = require('pug-walk'); module.exports = load; function load(ast, options) { diff --git a/package.json b/package.json index a0da00b..68cec22 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,23 @@ { - "name": "jade-load", + "name": "pug-loader", "version": "0.0.4", - "description": "The jade loader is responsible for loading the depenendencies of a given jade file.", + "description": "The pug loader is responsible for loading the depenendencies of a given pug file.", "keywords": [ - "jade" + "pug" ], "dependencies": { - "jade-walk": "0.0.3" + "pug-walk": "0.0.3" }, "devDependencies": { - "jade-lexer": "0.0.9", - "jade-parser": "0.0.9" + "pug-lexer": "^1.0.0", + "pug-parser": "^1.0.0" }, "scripts": { "test": "node test" }, "repository": { "type": "git", - "url": "https://github.com/jadejs/jade-load.git" + "url": "https://github.com/pugjs/pug-loader.git" }, "author": "ForbesLindesay", "license": "MIT" diff --git a/test/bar.jade b/test/bar.pug similarity index 100% rename from test/bar.jade rename to test/bar.pug diff --git a/test/bing.jade b/test/bing.pug similarity index 100% rename from test/bing.jade rename to test/bing.pug diff --git a/test/expected.json b/test/expected.json index ed4d357..36b437f 100644 --- a/test/expected.json +++ b/test/expected.json @@ -5,10 +5,10 @@ "type": "Extends", "file": { "type": "FileReference", - "path": "bar.jade", + "path": "bar.pug", "line": 1, - "filename": "/foo.jade", - "fullPath": "/bar.jade", + "filename": "/foo.pug", + "fullPath": "/bar.pug", "str": "block bing\n", "ast": { "type": "Block", @@ -17,17 +17,17 @@ "type": "NamedBlock", "nodes": [], "line": 1, - "filename": "/bar.jade", + "filename": "/bar.pug", "name": "bing", "mode": "replace" } ], "line": 0, - "filename": "/bar.jade" + "filename": "/bar.pug" } }, "line": 1, - "filename": "/foo.jade" + "filename": "/foo.pug" }, { "type": "NamedBlock", @@ -37,9 +37,9 @@ "file": { "type": "FileReference", "line": 4, - "filename": "/foo.jade", - "path": "bing.jade", - "fullPath": "/bing.jade", + "filename": "/foo.pug", + "path": "bing.pug", + "fullPath": "/bing.pug", "str": ".bing bong\n", "ast": { "type": "Block", @@ -55,11 +55,11 @@ "type": "Text", "val": "bong", "line": 1, - "filename": "/bing.jade" + "filename": "/bing.pug" } ], "line": 1, - "filename": "/bing.jade" + "filename": "/bing.pug" }, "attrs": [ { @@ -71,29 +71,29 @@ "attributeBlocks": [], "isInline": false, "line": 1, - "filename": "/bing.jade" + "filename": "/bing.pug" } ], "line": 0, - "filename": "/bing.jade" + "filename": "/bing.pug" } }, "line": 4, - "filename": "/foo.jade", + "filename": "/foo.pug", "block": { "type": "Block", "nodes": [], "line": 4, - "filename": "/foo.jade" + "filename": "/foo.pug" } } ], "line": 3, - "filename": "/foo.jade", + "filename": "/foo.pug", "name": "bing", "mode": "replace" } ], "line": 0, - "filename": "/foo.jade" + "filename": "/foo.pug" } \ No newline at end of file diff --git a/test/foo.jade b/test/foo.jade deleted file mode 100644 index 3dcf52a..0000000 --- a/test/foo.jade +++ /dev/null @@ -1,4 +0,0 @@ -extends bar.jade - -block bing - include bing.jade diff --git a/test/foo.pug b/test/foo.pug new file mode 100644 index 0000000..bdcf25d --- /dev/null +++ b/test/foo.pug @@ -0,0 +1,4 @@ +extends bar.pug + +block bing + include bing.pug diff --git a/test/index.js b/test/index.js index 6449515..71148d2 100644 --- a/test/index.js +++ b/test/index.js @@ -3,12 +3,12 @@ var fs = require('fs'); var path = require('path'); var assert = require('assert'); -var walk = require('jade-walk'); -var lex = require('jade-lexer'); -var parse = require('jade-parser'); +var walk = require('pug-walk'); +var lex = require('pug-lexer'); +var parse = require('pug-parser'); var load = require('../'); -var filename = __dirname + '/foo.jade'; +var filename = __dirname + '/foo.pug'; var ast = load.file(filename, { lex: lex, parse: parse