-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from mike-goodwin/development
Merge version 0.0.5 changes
- Loading branch information
Showing
12 changed files
with
132 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
// Use IntelliSense to learn about possible Node.js debug attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Run Tests", | ||
"program": "${workspaceRoot}\\node_modules\\mocha\\bin\\_mocha", | ||
"runtimeExecutable": null, | ||
"cwd": "${workspaceRoot}", | ||
"args": [ | ||
"-R", | ||
"spec", | ||
"--colors", | ||
"--no-timeouts" | ||
] | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Attach to Process", | ||
"port": 5858 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pug-bootstrap", | ||
"version": "0.0.1", | ||
"version": "0.0.5", | ||
"homepage": "https://github.com/mike-goodwin/pug-bootstrap", | ||
"authors": [ | ||
"[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+nav_divider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+nav_header Test Header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+nav_item_dropdown(href, active) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+navbar-fixed(name, id, style, href) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+nav_item(href, active) Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+navbar-static(name, id, style, href) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include ../../../components/navbar.pug | ||
+navbar(name, id, style, href) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var assert = require("assert"); | ||
var jade = require("pug"); | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
|
||
describe("Navbars", function () { | ||
it('should generate a navbar', function () { | ||
var locals = { | ||
name: 'navbar-name', | ||
id: 'navbar-id', | ||
style: 'style', | ||
href: 'href' | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "navbar.pug")); | ||
assert.equal('<nav class="navbar navbar-style" role="navigation"><div class="navbar-header"><button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#navbar-id" aria-expanded="false" aria-controls="navbar"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="href">navbar-name</a></div><div class="collapse navbar-collapse" id="navbar-id"><ul class="nav navbar-nav"></ul></div></nav>', fn(locals)); | ||
}); | ||
it('should generate a static navbar', function () { | ||
var locals = { | ||
name: 'navbar-name', | ||
id: 'navbar-id', | ||
style: 'style', | ||
href: 'href' | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "navbar-static.pug")); | ||
assert.equal('<nav class="navbar navbar-static-top navbar-style" role="navigation"><div class="container"><div class="navbar-header"><button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#navbar-id" aria-expanded="false" aria-controls="navbar"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="href">navbar-name</a></div><div class="collapse navbar-collapse" id="navbar-id"><ul class="nav navbar-nav"></ul></div></div></nav>', fn(locals)); | ||
}); | ||
it('should generate a fixed navbar', function () { | ||
var locals = { | ||
name: 'navbar-name', | ||
id: 'navbar-id', | ||
style: 'style', | ||
href: 'href' | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "navbar-fixed.pug")); | ||
assert.equal('<nav class="navbar navbar-fixed-top navbar-style" role="navigation"><div class="container"><div class="navbar-header"><button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#navbar-id" aria-expanded="false" aria-controls="navbar"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="href">navbar-name</a></div><div class="collapse navbar-collapse" id="navbar-id"><ul class="nav navbar-nav"></ul></div></div></nav>', fn(locals)); | ||
}); | ||
it('should generate a navbar item', function () { | ||
var locals = { | ||
href: 'href' | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "navbar-item.pug")); | ||
assert.equal('<li><a href="href">Test</a></li>', fn(locals)); | ||
}); | ||
it('should generate an active navbar item', function () { | ||
var locals = { | ||
href: 'href', | ||
active: true | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "navbar-item.pug")); | ||
assert.equal('<li class="active"><a href="href">Test</a></li>', fn(locals)); | ||
}); | ||
it('should generate a navbar divider', function () { | ||
var locals = {}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "nav-divider.pug")); | ||
assert.equal('<li class="divider"></li>', fn(locals)); | ||
}); | ||
it('should generate a navbar dropdown', function () { | ||
var locals = { | ||
href: 'href' | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "nav-item-dropdown.pug")); | ||
assert.equal('<li class="dropdown"><a class="dropdown-toggle" href="href" data-toggle="dropdown" role="button" aria-expanded="false"><span class="caret"></span></a><ul class="dropdown-menu" role="menu"></ul></li>', fn(locals)); | ||
}); | ||
it('should generate an active navbar dropdown', function () { | ||
var locals = { | ||
href: 'href', | ||
active: true | ||
}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "nav-item-dropdown.pug")); | ||
assert.equal('<li class="dropdown active"><a class="dropdown-toggle" href="href" data-toggle="dropdown" role="button" aria-expanded="false"><span class="caret"></span></a><ul class="dropdown-menu" role="menu"></ul></li>', fn(locals)); | ||
}); | ||
it('should generate a navbar header', function () { | ||
var locals = {}; | ||
var fn = jade.compileFile(path.join(__dirname, "fixtures/navbars", "nav-header.pug")); | ||
assert.equal('<li class="dropdown-header">Test Header</li>', fn(locals)); | ||
}); | ||
}); |