Permalink
Browse files

Initial files

  • Loading branch information...
0 parents commit 7ced2b53bdbcf33eda77f9abcebf704674cec4bf Couto committed Aug 7, 2012
Showing with 1,678 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +22 −0 LICENSE-MIT
  4. +42 −0 Makefile
  5. +74 −0 README.md
  6. +36 −0 build/jpp.js
  7. +396 −0 dist/callipygean.js
  8. +7 −0 dist/callipygean.min.js
  9. +174 −0 lib/callipygean.js
  10. +15 −0 lib/syntax/prettify.json
  11. +12 −0 lib/syntax/prism.json
  12. +198 −0 lib/utils.js
  13. +38 −0 package.json
  14. +195 −0 test/callipygean.test.js
  15. +26 −0 test/index.html
  16. +441 −0 test/utils.test.js
@@ -0,0 +1 @@
+/node_modules/
@@ -0,0 +1 @@
+/node_modules/
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Couto
+
+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.
@@ -0,0 +1,42 @@
+WATCH=""
+REPORTER="spec"
+
+all: lint test min
+
+lint:
+ @./node_modules/.bin/jslint dist/callipygean.js
+
+test: min
+ @zsh -c "./node_modules/.bin/mocha -u bdd $(WATCH) --reporter $(REPORTER) ./test/**/*.test.js"
+
+test-b:
+ @$(min)
+ @$(MAKE) lint
+ @$(MAKE) server &
+ @open 'http://localhost:8000/test'
+
+watch:
+ $(MAKE) test WATCH="-w" REPORTER="min"
+
+clean:
+ @rm -r dist
+
+jpp:
+ @./build/jpp.js lib/callipygean.js
+
+server:
+ @python -m SimpleHTTPServer &
+
+server-stop:
+ @ps | grep "python -m" | egrep -o -e "^[0-9]+" | xargs kill
+
+min: clean
+ @mkdir dist && touch dist/callipygean.min.js
+ @./build/jpp.js lib/callipygean.js dist/callipygean.js | xargs ./node_modules/.bin/uglifyjs \
+ --output dist/callipygean.min.js \
+ --mangle-toplevel \
+ --no-dead-code \
+ --unsafe \
+ --lift-vars
+
+.PHONY: test
@@ -0,0 +1,74 @@
+# callipygean
+_adj._ Having beautifully proportioned buttocks.
+From Ancient Greek __καλλίπυγος__ (kallipugos), from __καλλι-__ (kalli-, _beautiful_) + __πυγή__ (pugē, _buttocks_).
+
+```
+ . .
+ | |
+ j : l
+ / \
+ / \
+ Y . Y
+ | | |
+ l "----~Y~----" !
+ \ | /
+ Y | Y
+ | I |
+```
+
+JSON expandable/collapsible with compatibility with common Syntax Highlighters
+
+## Getting Started
+
+### In the browser
+Download the [production version][min] or the [development version][max].
+
+[min]: https://raw.github.com/Couto/callipygean/master/dist/callipygean.min.js
+[max]: https://raw.github.com/Couto/callipygean/master/dist/callipygean.js
+
+In your web page:
+
+```html
+<script src="dist/callipygean.min.js"></script>
+<script>
+awesome(); // "awesome"
+</script>
+```
+
+In your code, you can attach callipygean's methods to any object.
+
+```html
+<script>
+this.exports = Bocoup.utils;
+</script>
+<script src="dist/callipygean.min.js"></script>
+<script>
+Bocoup.utils.awesome(); // "awesome"
+</script>
+```
+
+Or you can use an AMD loader
+
+```javascript
+require(['dist/callipygean.min'], function (callipygean) {
+ callipygean()
+});
+```
+
+## Documentation
+_(Coming soon)_
+
+## Examples
+_(Coming soon)_
+
+## Contributing
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
+
+_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_
+
+## Release History
+_(Nothing yet)_
+
+## License
+Copyright (c) 2012 Couto
+Licensed under the MIT license.
@@ -0,0 +1,36 @@
+#!/usr/bin/env node
+
+/*!
+ * Javascript Preprocessor
+ * Mimicks the #include syntax in C
+ *
+ * @example
+ *
+ * //#include "relative/folder/file.js";
+ *
+ * Copyright (c) 2012 Couto
+ * Licensed under the MIT license.
+ */
+
+// Dependencies
+var fs = require('fs'),
+ path = require('path'),
+ // args
+ args = process.argv,
+ input = args[2],
+ output = args[3],
+ // files and stuff
+ folder = path.dirname(input),
+ file = fs.readFileSync(input, 'utf8'),
+
+ merged = file.replace(/\/\/\#include \"(.+)\"\;/g, function (str, group) {
+ return fs.readFileSync(path.resolve(folder, group), 'utf8');
+ });
+
+return (!output) ?
+ process.stdout.write(merged) :
+ (function () {
+ fs.writeFileSync(output, merged, 'utf8');
+ process.stdout.write(output);
+ process.exit();
+ }());
Oops, something went wrong.

0 comments on commit 7ced2b5

Please sign in to comment.