Permalink
Browse files

Documentation update and start on full API docs

  • Loading branch information...
1 parent 7165fd8 commit f9aa3ac9c36061be6d4efe4bd9b3980c20827648 @meltingice committed Jun 10, 2013
Showing with 11,061 additions and 2,782 deletions.
  1. +5 −0 .codoopts
  2. +15 −6 Cakefile
  3. +145 −0 api/LICENSE.html
  4. +164 −0 api/README.md.html
  5. +1 −0 api/assets/codo.css
  6. +21 −0 api/assets/codo.js
  7. +1 −0 api/assets/search_data.js
  8. +295 −0 api/class_index.html
  9. +124 −0 api/class_list.html
  10. +195 −0 api/classes/Analyze.html
  11. +180 −0 api/classes/Blender.html
  12. +226 −0 api/classes/Calculate.html
  13. +898 −0 api/classes/Caman.html
  14. +240 −0 api/classes/CamanParser.html
  15. +530 −0 api/classes/Convert.html
  16. +187 −0 api/classes/Event.html
  17. +159 −0 api/classes/Filter.html
  18. +249 −0 api/classes/IO.html
  19. +316 −0 api/classes/Layer.html
  20. +163 −0 api/classes/Logger.html
  21. +311 −0 api/classes/PixelInfo.html
  22. +179 −0 api/classes/Plugin.html
  23. +376 −0 api/classes/Renderer.html
  24. +224 −0 api/classes/Store.html
  25. +217 −0 api/classes/Util.html
  26. +33 −0 api/extra_list.html
  27. +66 −0 api/file_list.html
  28. +162 −0 api/files/core/autoload.coffee.html
  29. +135 −0 api/files/core/event.coffee.html
  30. +237 −0 api/files/core/io.coffee.html
  31. +135 −0 api/files/core/plugin.coffee.html
  32. +162 −0 api/files/core/util.coffee.html
  33. +14 −0 api/index.html
  34. +923 −0 api/method_list.html
  35. +28 −0 api/mixin_list.html
  36. +58 −0 dist/caman.full.js
  37. +58 −0 dist/caman.js
  38. +80 −41 docs/analyze.html
  39. +177 −66 docs/autoload.html
  40. +12 −11 docs/blender.html
  41. +68 −66 docs/blenders.html
  42. +68 −65 docs/blur.html
  43. +59 −66 docs/calculate.html
  44. +384 −404 docs/caman.html
  45. +128 −137 docs/camera.html
  46. +286 −285 docs/compoundBlur.html
  47. +222 −240 docs/convert.html
  48. +223 −77 docs/docco.css
  49. +23 −20 docs/edges.html
  50. +37 −40 docs/event.html
  51. +16 −15 docs/filter.html
  52. +214 −242 docs/filters.html
  53. +72 −76 docs/io.html
  54. +84 −92 docs/layer.html
  55. +18 −16 docs/logger.html
  56. +55 −58 docs/pixelInfo.html
  57. +10 −7 docs/plugin.html
  58. +13 −10 docs/posterize.html
  59. +261 −258 docs/presets.html
  60. BIN docs/public/fonts/aller-bold.eot
  61. BIN docs/public/fonts/aller-bold.ttf
  62. BIN docs/public/fonts/aller-bold.woff
  63. BIN docs/public/fonts/aller-light.eot
  64. BIN docs/public/fonts/aller-light.ttf
  65. BIN docs/public/fonts/aller-light.woff
  66. BIN docs/public/fonts/novecento-bold.eot
  67. BIN docs/public/fonts/novecento-bold.ttf
  68. BIN docs/public/fonts/novecento-bold.woff
  69. +375 −0 docs/public/stylesheets/normalize.css
  70. +168 −176 docs/renderer.html
  71. +233 −0 docs/rotate.html
  72. +52 −56 docs/size.html
  73. +184 −182 docs/stackBlur.html
  74. +17 −14 docs/store.html
  75. +17 −14 docs/threshold.html
  76. +36 −38 docs/util.html
  77. +5 −2 package.json
  78. +7 −0 src/core/analyze.coffee
  79. +19 −1 src/core/autoload.coffee
  80. +6 −1 src/core/caman.coffee
View
@@ -0,0 +1,5 @@
+--name "CamanJS"
+--readme README.md
+--title "CamanJS Documentation"
+--output-dir ./api
+./src
View
@@ -86,10 +86,10 @@ getPlugins = ->
Tasks
###
task 'docs', 'Generates documentation for the coffee files', ->
- util.log 'Invoking docco on the CoffeeScript source files'
+ util.log 'Invoking docco on the source files'
- files = coffeeFiles
- files[i] = "src/#{files[i]}.coffee" for i in [0...files.length]
+ files = []
+ files[i] = "src/#{coffeeFiles[i]}.coffee" for i in [0...coffeeFiles.length]
pluginFiles = fs.readdirSync pluginsFolder
for plugin in pluginFiles
@@ -98,16 +98,25 @@ task 'docs', 'Generates documentation for the coffee files', ->
exec "node_modules/docco/bin/docco -l parallel #{files.join(' ')}", (err, stdout, stderr) ->
util.log err if err
- util.log "Documentation built into docs/ folder."
-
-task 'watch', 'Automatically recompile the CoffeeScript files when updated', ->
+ util.log "Documentation built into the docs/ folder."
+
+ util.log 'Invoking codo on the source files'
+ exec "node_modules/codo/bin/codo", (err, stdout, stderr) ->
+ util.log err if err
+ util.log "API reference built into the api/ folder."
+ console.log stdout
+
+option '-d', '--docs', 'Automatically recompile documentation (used with watch)'
+task 'watch', 'Automatically recompile the CoffeeScript files when updated', (options) ->
util.log "Watching for changes in #{csSrcDir}"
+ util.log "Automatically recompiling documentation!" if options.docs
for jsFile in coffeeFiles then do (jsFile) ->
fs.watchFile "#{csSrcDir}/#{jsFile}.coffee", (curr, prev) ->
if +curr.mtime isnt +prev.mtime
util.log "#{csSrcDir}/#{jsFile}.coffee updated"
invoke 'build'
+ invoke 'docs' if options.docs
task 'build', 'Compile and minify all CoffeeScript source files', ->
finishListener 'js', -> invoke 'minify'
View
@@ -0,0 +1,145 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='UTF-8'>
+ <title>CamanJS Documentation</title>
+ <link rel='stylesheet' href='assets/codo.css' type='text/css'>
+ <script src='assets/codo.js'></script>
+ <script src='assets/search_data.js'></script>
+</head>
+ <body>
+ <div id='base' data-path=''></div>
+<div id='header'>
+ <div id='menu'>
+ <a href='README.md.html' title='CamanJS'>CamanJS</a>
+ &raquo;
+ <a href='class_index.html' title='Index'>Index</a>
+ &raquo;
+ <span class='title'>LICENSE</span>
+ <nav>
+ <ul>
+ <li class='noframes'>
+ (<a class='noframes' href='#'>no frames</a>)
+ </li>
+ </ul>
+ </nav>
+ <div id='search'>
+ <a id='class_list_link' href='class_list.html'>Classes</a>
+ <a id='file_list_link' href='file_list.html'>Files</a>
+ <a id='method_list_link' href='method_list.html'>Methods</a>
+ <a id='extra_list_link' href='extra_list.html'>Extras</a>
+ </div>
+ </div>
+ <iframe id='search_frame'></iframe>
+ <div id='fuzzySearch'>
+ <input type='text'>
+ <ol></ol>
+ </div>
+ <div id='help'>
+ <p>
+ Quickly fuzzy find classes, mixins, methods, file:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-T</span>
+ Open fuzzy finder dialog
+ </li>
+ </ul>
+ <p>
+ In frame mode you can toggle the list naviation frame on the left side:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-L</span>
+ Toggle list view
+ </li>
+ </ul>
+ <p>
+ You can focus a list in frame mode or toggle a tab in frameless mode:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-C</span>
+ Class list
+ </li>
+ <li>
+ <span>Ctrl-I</span>
+ Mixin list
+ </li>
+ <li>
+ <span>Ctrl-F</span>
+ File list
+ </li>
+ <li>
+ <span>Ctrl-M</span>
+ Method list
+ </li>
+ <li>
+ <span>Ctrl-E</span>
+ Extras list
+ </li>
+ </ul>
+ <p>
+ You can focus and blur the search input:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-S</span>
+ Focus search input
+ </li>
+ <li>
+ <span>Esc</span>
+ Blur search input
+ </li>
+ </ul>
+ <p>
+ In frameless mode you can close the list tab:
+ </p>
+ <ul>
+ <li>
+ <span>Esc</span>
+ Close list tab
+ </li>
+ </ul>
+ </div>
+</div>
+ <div id='content'>
+ <nav class='toc'>
+ <p class='title'>
+ <a class='hide_toc' href='#'>
+ <strong>Table of Contents</strong>
+ </a>
+ <small>
+ (<a class='float_toc' href='#'>left</a>)
+ </small>
+ </p>
+ </nav>
+ <div id='filecontents'>
+ Copyright (c) 2010, Ryan LeFevre
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of Ryan LeFevre nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ </div>
+ </div>
+ <div id='footer'>
+ Generated on
+ Sun Jun 09 2013 23:51:31 GMT-0400 (EDT)
+ by
+ <a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
+ v1.7.0
+ (Node.js v0.10.8).
+ &#10034;
+ Press Ctrl-h to see the keyboard shortcuts
+ &#10034;
+ <a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
+ &#10034;
+ <a href='https://mksoft.ch'>mksoft.ch</a>
+</div>
+ </body>
+</html>
View
@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset='UTF-8'>
+ <title>CamanJS Documentation</title>
+ <link rel='stylesheet' href='assets/codo.css' type='text/css'>
+ <script src='assets/codo.js'></script>
+ <script src='assets/search_data.js'></script>
+</head>
+ <body>
+ <div id='base' data-path=''></div>
+<div id='header'>
+ <div id='menu'>
+ <a href='README.md.html' title='CamanJS'>CamanJS</a>
+ &raquo;
+ <a href='class_index.html' title='Index'>Index</a>
+ &raquo;
+ <span class='title'>README.md</span>
+ <nav>
+ <ul>
+ <li class='noframes'>
+ (<a class='noframes' href='#'>no frames</a>)
+ </li>
+ </ul>
+ </nav>
+ <div id='search'>
+ <a id='class_list_link' href='class_list.html'>Classes</a>
+ <a id='file_list_link' href='file_list.html'>Files</a>
+ <a id='method_list_link' href='method_list.html'>Methods</a>
+ <a id='extra_list_link' href='extra_list.html'>Extras</a>
+ </div>
+ </div>
+ <iframe id='search_frame'></iframe>
+ <div id='fuzzySearch'>
+ <input type='text'>
+ <ol></ol>
+ </div>
+ <div id='help'>
+ <p>
+ Quickly fuzzy find classes, mixins, methods, file:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-T</span>
+ Open fuzzy finder dialog
+ </li>
+ </ul>
+ <p>
+ In frame mode you can toggle the list naviation frame on the left side:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-L</span>
+ Toggle list view
+ </li>
+ </ul>
+ <p>
+ You can focus a list in frame mode or toggle a tab in frameless mode:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-C</span>
+ Class list
+ </li>
+ <li>
+ <span>Ctrl-I</span>
+ Mixin list
+ </li>
+ <li>
+ <span>Ctrl-F</span>
+ File list
+ </li>
+ <li>
+ <span>Ctrl-M</span>
+ Method list
+ </li>
+ <li>
+ <span>Ctrl-E</span>
+ Extras list
+ </li>
+ </ul>
+ <p>
+ You can focus and blur the search input:
+ </p>
+ <ul>
+ <li>
+ <span>Ctrl-S</span>
+ Focus search input
+ </li>
+ <li>
+ <span>Esc</span>
+ Blur search input
+ </li>
+ </ul>
+ <p>
+ In frameless mode you can close the list tab:
+ </p>
+ <ul>
+ <li>
+ <span>Esc</span>
+ Close list tab
+ </li>
+ </ul>
+ </div>
+</div>
+ <div id='content'>
+ <nav class='toc'>
+ <p class='title'>
+ <a class='hide_toc' href='#'>
+ <strong>Table of Contents</strong>
+ </a>
+ <small>
+ (<a class='float_toc' href='#'>left</a>)
+ </small>
+ </p>
+ </nav>
+ <div id='filecontents'>
+ <h1>About the Project</h1><p><a href="http://travis-ci.org/meltingice/CamanJS"><img src="https://secure.travis-ci.org/meltingice/CamanJS.png" alt="Build Status"></a></p><p>The main focus of CamanJS is manipulating images using the HTML5 canvas and Javascript. It&#39;s a combination of a simple-to-use interface with advanced and efficient image/canvas editing techniques. It is also completely library independent and can be safely used next to jQuery, YUI, Scriptaculous, MooTools, etc.</p><p>CamanJS is very easy to extend with new filters and plugins, and it comes with a wide array of image editing functionality, which is only growing as the community makes more plugins. All features that are not a part of the core CamanJS library are in a <a href="https://github.com/meltingice/CamanJS-Plugins">separate plugins repository</a>.</p><p>For more information, I highly recommend taking a look at the <a href="http://camanjs.com">official website</a> where there is more comprehensive documentation and interactive demos. You can also <a href="https://github.com/meltingice/CamanJS/wiki">read the wiki</a> for some basic information about the project and how to use it.</p><p>CamanJS is written in <a href="http://coffeescript.org">Coffeescript</a> as of version 3.0. <strong>It works both in-browser and in NodeJS.</strong></p><h2>Usage</h2><p>Include one of the versions in the <code>dist/</code> folder, then you can run:</p><pre><code class="lang-js">Caman(&quot;#image-id&quot;, function () {
+ this.brightness(10);
+ this.contrast(20);
+ this.render(function () {
+ alert(&quot;Done!&quot;);
+ });
+});</code></pre><p>Caman also supports modifying images via the <code>data-caman</code> HTML attribute. Simply separate each instruction with a space. Images with the <code>data-caman</code> attribute will automatically be modified at page load.</p><pre><code class="lang-html">&lt;img data-caman=&quot;saturation(-10) brightness(20) vignette(&#39;10%&#39;)&quot; src=&quot;path/to/image.jpg&quot;&gt;</code></pre>
+<h3>HiDPI Support</h3><p>Version 4 introduces better support for HiDPI (Retina) displays. It allows you to specify a higher resolution replacement using HTML data attributes. Keep in mind, however, that higher resolution images take longer to render.</p><p><strong>HTML data attributes</strong></p><ul>
+<li><code>data-caman-hidpi</code>: URL to the high resolution replacement image</li>
+<li><code>data-caman-hidpi-disabled</code>: HiDPI support is enabled by default, so add this attribute if you wish to force disable it</li>
+</ul>
+<h2>Upgrading to Version 4</h2><p>There is only 1 breaking change that occured with the version 4 release. When you initialize CamanJS with a canvas and an image, the parameter order has changed. It is now:</p><pre><code class="lang-javascript">Caman(&quot;#canvas-id&quot;, &quot;/path/to/image.png&quot;, function() {});</code></pre><p>This is in order to be more consistent with initialization, such that the &quot;initialization object&quot; is always the first parameter. Update your code accordingly.</p><h2>Development</h2><p>If you are a developer who is contributing directly to the project, there are some tools to help you out.</p><h3>Building</h3><p>To install all dependencies required for development, run <code>npm install -d</code>.</p><p>Because all plugins are in a separate repository, make sure you run:</p><pre><code>git submodule init &amp;&amp; git submodule update</code></pre><p>To build, simply run <code>cake build</code>. The resulting files will be placed in the dist/ folder. Plugins will be automatically discovered and added to caman.full.js after the core library. You can also auto-compile when a file changes by using <code>cake watch</code>.</p><p>If you add any files to the core library, you will need to add them to the <code>coffeeFiles</code> array in the Cakefile. The point of this is so that order is preserved when generating the file JS file. Plugins do not need to be added to the Cakefile.</p><p>You will probably want to generate documentation if you make any changes. In addition to the normal requirements, you will also need the Python library Pygments.</p><p>To generate the documentation, run <code>cake docs</code>.</p><h2>CDN JS Hosting</h2><p>CamanJS is hosted on CDN JS if you&#39;re looking for a CDN hosting solution. It is the full and minified version of the library, which means all plugins are included. Simply load CamanJS directly from <a href="http://cdnjs.cloudflare.com/ajax/libs/camanjs/3.3.0/caman.full.min.js">this URL</a> for usage on your site.</p><h2>NodeJS Compatibility</h2><p>CamanJS is fully compatible with NodeJS. The easiest way to install it is:</p><pre><code>npm install caman</code></pre><p><strong>Saving from NodeJS</strong></p><p>To save your modified image in NodeJS, simply call the save() function <strong>after</strong> rendering is finished by passing a callback function to <code>render()</code>. Trying to save before rendering is finished will cause issues.</p><pre><code class="lang-coffeescript">Caman &quot;./path/to/file.jpg&quot;, -&gt;
+ @brightness 40
+ @render -&gt; @save &quot;./output.jpg&quot;</code></pre>
+<h2>Testing</h2><p>Tests for CamanJS run both in NodeJS and the browser.</p><h3>NodeJS</h3><p>The NodeJS tests use mocha as the test runner. The simplest way to run the test suite is:</p><pre><code>npm test</code></pre>
+<h3>Browser</h3><p>The browser tests are run by Karma. It will start up Chrome, Firefox, and Safari in the background. If you&#39;re running Windows, you will want to remove Safari by editing <code>test/karma.conf.js</code>. You can minimize each of these browsers if desired. It will automatically run tests after CamanJS is recompiled by the Cakefile as well. </p><p><strong>Because it prefers to be installed globally, Karma is a soft dependency.</strong></p><p><strong>Install</strong></p><pre><code>npm install -g karma</code></pre><p><strong>Run</strong></p><pre><code>karma start test/karma.conf.js</code></pre>
+<h1>Project Contributors</h1>
+<ul>
+<li><a href="http://twitter.com/meltingice">Ryan LeFevre</a> - Project Creator, Maintainer, and Lead Developer</li>
+<li><a href="http://twitter.com/rwaldron">Rick Waldron</a> - Plugin Architect and Developer</li>
+<li><a href="http://twitter.com/cezarsa">Cezar Sá Espinola</a> - Developer</li>
+<li><a href="http://twitter.com/jarques">Jarques Pretorius</a> - Logo Designer</li>
+</ul>
+<h1>Plugin Contributors</h1>
+<ul>
+<li><a href="https://github.com/Hosselaer">Hosselaer</a></li>
+<li><a href="http://www.quasimondo.com">Mario Klingemann</a></li>
+</ul>
+
+ </div>
+ </div>
+ <div id='footer'>
+ Generated on
+ Sun Jun 09 2013 23:51:31 GMT-0400 (EDT)
+ by
+ <a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
+ v1.7.0
+ (Node.js v0.10.8).
+ &#10034;
+ Press Ctrl-h to see the keyboard shortcuts
+ &#10034;
+ <a href='http://twitter.com/#!/netzpirat'>@netzpirat</a>
+ &#10034;
+ <a href='https://mksoft.ch'>mksoft.ch</a>
+</div>
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit f9aa3ac

Please sign in to comment.