Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for a partials directory #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ bower_components/
node_modules/
out/

# Private Files
.env


# =====================================
# CUSTOM MODIFICATIONS

Expand Down
63 changes: 63 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
// enforcing options
"bitwise": true,
"camelcase": true,
"curly": false, // we like one liners
"eqeqeq": true,
"es3": true,
"forin": true,
"freeze": true,
"immed": true,
"indent": 1, // we use tabs
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonbsp": true,
"nonew": true,
"plusplus": false, // we are good at js
"quotmark": false, // we like flexibility
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"maxparams": false, // no
"maxdepth": false, // no
"maxstatements": false, // no
"maxcomplexity": false, // no
"maxlen": false, // no

// relaxing options
"asi": true, // we use asi
"boss": true, // we understand assignments
"debug": false,
"eqnull": true, // we know how to do null/undefined checks
"esnext": false,
"evil": false,
"expr": false,
"funcscope": false,
"gcl": true,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"moz": false,
"multistr": false,
"notypeof": false,
"proto": false,
"scripturl": false,
"smarttabs": false, // default; spaces should only be mixed with tabs after words
"shadow": false,
"sub": false,
"supernew": false,
"noyield": false,

// environments
"browser": true,
"node": true,

// legacy
"onevar": false
}
9 changes: 8 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.3.10 December 10, 2013
# v1.3.23 October 11, 2014
# https://github.com/bevry/base

# Temp Files
Expand All @@ -11,7 +11,14 @@ components/
bower_components/
node_modules/

# Private Files
.env

# Development Files
.editorconfig
.eslintrc
.jshintrc
coffeelint.json
.travis*
Cakefile
Makefile
Expand Down
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# v1.3.14 February 6, 2014
# v1.3.23 October 11, 2014
# https://github.com/bevry/base
language: node_js
install: "npm install; ./node_modules/.bin/cake install"
# ensure npm@1 is the latest 0.8 compatible version (needed to ensure modules are installed correctly)
# ensure coffee-script is installed (needed for cake commands)
# ensure dev dependencies are installed (handled via npm install)
# ensure test dependencies are installed (handled via cake install)
install: "npm install -g npm@1 && npm install coffee-script && npm install && ./node_modules/.bin/cake install"
# ensure our application is compiled before we run our tests
before_script: "./node_modules/.bin/cake compile"
script: "npm test"
node_js:
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
v1.3.10 December 10, 2013
v1.3.22 June 23, 2013
https://github.com/bevry/base
-->

Expand All @@ -9,9 +9,9 @@ https://github.com/bevry/base

## Resources

- [Coding Standards](http://bevry.me/bevry/coding-standards)
- [Documentation Guidelines](http://bevry.me/bevry/documentation-guidelines)
- [Support Guidelines](http://bevry.me/bevry/support-guidelines)
- [Coding Standards](http://learn.bevry.me/community/coding-standards)
- [Documentation Guidelines](http://learn.bevry.me/community/documentation-guidelines)
- [Support Guidelines](http://learn.bevry.me/community/support-guidelines)


## Development
Expand Down
48 changes: 27 additions & 21 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v1.3.15 May 16, 2014
# v1.3.20 June 16, 2014
# https://github.com/bevry/base


Expand All @@ -18,27 +18,29 @@ NPM = (if WINDOWS then process.execPath.replace('node.exe', 'npm.cm
EXT = (if WINDOWS then '.cmd' else '')
GIT = "git"

APP_PATH = process.cwd()
APP_PATH = process.cwd()
PACKAGE_PATH = pathUtil.join(APP_PATH, "package.json")
PACKAGE_DATA = require(PACKAGE_PATH)

MODULES_PATH = pathUtil.join(APP_PATH, "node_modules")
DOCPAD_PATH = pathUtil.join(MODULES_PATH, "docpad")
BIN_PATH = pathUtil.join(MODULES_PATH, ".bin")
CAKE = pathUtil.join(BIN_PATH, "cake" + EXT)
COFFEE = pathUtil.join(BIN_PATH, "coffee" + EXT)
PROJECTZ = pathUtil.join(BIN_PATH, "projectz" + EXT)
DOCCO = pathUtil.join(BIN_PATH, "docco" + EXT)
DOCPAD = pathUtil.join(BIN_PATH, "docpad" + EXT)
CAKE = pathUtil.join(MODULES_PATH, "coffee-script/bin/cake")
COFFEE = pathUtil.join(MODULES_PATH, "coffee-script/bin/coffee")
PROJECTZ = pathUtil.join(MODULES_PATH, "projectz/bin/projectz")
DOCCO = pathUtil.join(MODULES_PATH, "docco/bin/docco")
DOCPAD = pathUtil.join(MODULES_PATH, "docpad/bin/docpad")
BISCOTTO = pathUtil.join(MODULES_PATH, "biscotto/bin/biscotto")

config = {}
config.TEST_PATH = "test"
config.DOCCO_SRC_PATH = null
config.DOCCO_OUT_PATH = "docs"
config.COFFEE_SRC_PATH = null
config.COFFEE_OUT_PATH = "out"
config.DOCPAD_SRC_PATH = null
config.DOCPAD_OUT_PATH = "out"
config.TEST_PATH = "test"
config.DOCCO_SRC_PATH = null
config.DOCCO_OUT_PATH = "docs"
config.BISCOTTO_SRC_PATH = null
config.BISCOTTO_OUT_PATH = "docs"
config.COFFEE_SRC_PATH = null
config.COFFEE_OUT_PATH = "out"
config.DOCPAD_SRC_PATH = null
config.DOCPAD_OUT_PATH = "out"

for own key,value of (PACKAGE_DATA.cakeConfiguration or {})
config[key] = value
Expand Down Expand Up @@ -133,11 +135,11 @@ actions =
step2 = ->
return step3() if !config.COFFEE_SRC_PATH or !fsUtil.existsSync(COFFEE)
console.log('coffee compile')
spawn(COFFEE, ['-co', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
spawn(NODE, [COFFEE, '-co', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
step3 = ->
return step4() if !config.DOCPAD_SRC_PATH or !fsUtil.existsSync(DOCPAD)
console.log('docpad generate')
spawn(DOCPAD, ['generate'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step4)
spawn(NODE, [DOCPAD, 'generate'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step4)
step4 = next

# Start
Expand All @@ -154,12 +156,12 @@ actions =
step2 = ->
return step3() if !config.COFFEE_SRC_PATH or !fsUtil.existsSync(COFFEE)
console.log('coffee watch')
spawn(COFFEE, ['-wco', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
spawn(NODE, [COFFEE, '-wco', config.COFFEE_OUT_PATH, config.COFFEE_SRC_PATH], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
step3() # continue while coffee runs in background
step3 = ->
return step4() if !config.DOCPAD_SRC_PATH or !fsUtil.existsSync(DOCPAD)
console.log('docpad run')
spawn(DOCPAD, ['run'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
spawn(NODE, [DOCPAD, 'run'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe) # background
step4() # continue while docpad runs in background
step4 = next

Expand Down Expand Up @@ -193,12 +195,16 @@ actions =
step2 = ->
return step3() if !fsUtil.existsSync(PROJECTZ)
console.log('projectz compile')
spawn(PROJECTZ, ['compile'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
spawn(NODE, [PROJECTZ, 'compile'], {stdio:'inherit', cwd:APP_PATH}).on('close', safe next, step3)
step3 = ->
return step4() if !config.DOCCO_SRC_PATH or !fsUtil.existsSync(DOCCO)
console.log('docco compile')
exec("#{DOCCO} -o #{config.DOCCO_OUT_PATH} #{config.DOCCO_SRC_PATH}", {stdio:'inherit', cwd:APP_PATH}, safe next, step4)
exec("#{NODE} #{DOCCO} -o #{config.DOCCO_OUT_PATH} #{config.DOCCO_SRC_PATH}", {stdio:'inherit', cwd:APP_PATH}, safe next, step4)
step4 = ->
return step5() if !config.BISCOTTO_SRC_PATH or !fsUtil.existsSync(BISCOTTO)
console.log('biscotto compile')
exec("""#{BISCOTTO} --name #{PACKAGE_DATA.title or PACKAGE_DATA.name} --title "#{PACKAGE_DATA.title or PACKAGE_DATA.name} API Documentation" --readme README.md --output-dir #{config.BISCOTTO_OUT_PATH} #{config.BISCOTTO_SRC_PATH} - LICENSE.md HISTORY.md""", {stdio:'inherit', cwd:APP_PATH}, safe next, step5)
step5 = ->
console.log('cake test')
actions.test(opts, safe next, step5)
step5 = next
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- v2.4.x
- Updated dependencies
- coffee-script 1.6.3 to 1.7.1
- Added support for partials directory

- v2.3.0 January 10, 2014
- Repackaged
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ plugins:
getBlock: (type, additional...) ->
additional.pop() # remove the hash object
@getBlock(type).add(additional).toHTML()
partialsDir: './src/layouts/partials'
partials:
title: '<h1>{{document.title}}</h1>'
goUp: '<a href="#">Scroll up</a>'
Expand Down
114 changes: 114 additions & 0 deletions coffeelint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"coffeescript_error": {
"level": "error"
},
"arrow_spacing": {
"name": "arrow_spacing",
"level": "error"
},
"no_tabs": {
"name": "no_tabs",
"level": "ignore"
},
"no_trailing_whitespace": {
"name": "no_trailing_whitespace",
"level": "error",
"allowed_in_comments": false,
"allowed_in_empty_lines": true
},
"max_line_length": {
"name": "max_line_length",
"value": 80,
"level": "ignore",
"limitComments": true
},
"line_endings": {
"name": "line_endings",
"level": "error",
"value": "unix"
},
"no_trailing_semicolons": {
"name": "no_trailing_semicolons",
"level": "error"
},
"indentation": {
"name": "indentation",
"value": 1,
"level": "error"
},
"camel_case_classes": {
"name": "camel_case_classes",
"level": "error"
},
"colon_assignment_spacing": {
"name": "colon_assignment_spacing",
"level": "ignore",
"spacing": {
"left": 0,
"right": 0
}
},
"no_implicit_braces": {
"name": "no_implicit_braces",
"level": "ignore",
"strict": true
},
"no_plusplus": {
"name": "no_plusplus",
"level": "ignore"
},
"no_throwing_strings": {
"name": "no_throwing_strings",
"level": "error"
},
"no_backticks": {
"name": "no_backticks",
"level": "ignore"
},
"no_implicit_parens": {
"name": "no_implicit_parens",
"level": "ignore"
},
"no_empty_param_list": {
"name": "no_empty_param_list",
"level": "error"
},
"no_stand_alone_at": {
"name": "no_stand_alone_at",
"level": "ignore"
},
"space_operators": {
"name": "space_operators",
"level": "ignore"
},
"duplicate_key": {
"name": "duplicate_key",
"level": "error"
},
"empty_constructor_needs_parens": {
"name": "empty_constructor_needs_parens",
"level": "ignore"
},
"cyclomatic_complexity": {
"name": "cyclomatic_complexity",
"value": 10,
"level": "ignore"
},
"newlines_after_classes": {
"name": "newlines_after_classes",
"value": 3,
"level": "ignore"
},
"no_unnecessary_fat_arrows": {
"name": "no_unnecessary_fat_arrows",
"level": "warn"
},
"missing_fat_arrows": {
"name": "missing_fat_arrows",
"level": "ignore"
},
"non_empty_constructor_needs_parens": {
"name": "non_empty_constructor_needs_parens",
"level": "ignore"
}
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"Gilles Bouthenot (https://github.com/gbouthenot)",
"Mike Moulton <[email protected]> (https://github.com/mmoulton)",
"RobLoach (https://github.com/RobLoach)",
"Tobias Birmili <[email protected]> (https://github.com/toabi)"
"Tobias Birmili <[email protected]> (https://github.com/toabi)",
"Michael Barlock (https://github.com/mbarlock)"
],
"bugs": {
"url": "https://github.com/docpad/docpad-plugin-handlebars/issues"
Expand All @@ -32,7 +33,9 @@
"url": "https://github.com/docpad/docpad-plugin-handlebars.git"
},
"dependencies": {
"handlebars": "~1.3.0"
"handlebars": "~2.0.0",
"wrench": "~1.5.8",
"safefs": "~3.1.1"
},
"devDependencies": {
"coffee-script": "~1.7.1",
Expand Down Expand Up @@ -66,4 +69,4 @@
"cakeConfiguration": {
"COFFEE_SRC_PATH": "src"
}
}
}
Loading