From 23f74a3be3d025c44836665e3877a670fbea95c4 Mon Sep 17 00:00:00 2001 From: Garen Torikian Date: Tue, 17 Apr 2012 11:02:08 -0700 Subject: [PATCH] Doc API updates...almost ready --- doc/build.js | 7 ++-- doc/package.json | 10 ++---- lib/ace/layer/marker.js | 12 ++----- lib/ace/multi_select.js | 72 +++++++++++++++++++++++------------------ 4 files changed, 47 insertions(+), 54 deletions(-) diff --git a/doc/build.js b/doc/build.js index d48defcc..ef41483c 100644 --- a/doc/build.js +++ b/doc/build.js @@ -1,11 +1,8 @@ -var argv = require("optimist").argv, - ndoc = require(argv._[0] || "./build/ndoc/bin/ndoc"); - -console.log("GENERATING DOCUMENTATION"); +var panino = require("panino"); var srcPath = process.cwd() + "/../lib/ace"; -ndoc.main(["--path=" + srcPath, "-o", "./out/", "-t", "ACE API", "--skin", "./resources/ace/skins"], function(err) { +panino.main(["--path=" + srcPath, "-o", "./out/", "-r", "-t", "ACE API", "--skin", "./resources/ace/skins"], function(err) { if (err) { console.error(err); process.exit(-1); diff --git a/doc/package.json b/doc/package.json index 9d446f9f..76dc90fd 100644 --- a/doc/package.json +++ b/doc/package.json @@ -9,13 +9,7 @@ "node": "~0.6.0" }, "dependencies": { - "colors": "~0.6.0", - "optimist": "~0.3.1", - "nomnom": "~1.5.1", - "jade": "~0.20.0", - "marked": "~0.1.5", - "fs-tools": "~0.1.0", - "markdown_conrefs": "1.0.2" + "panino" : "~1.0.0" }, "devDependencies": {} -} +} \ No newline at end of file diff --git a/lib/ace/layer/marker.js b/lib/ace/layer/marker.js index c4fd2408..04eeabc4 100644 --- a/lib/ace/layer/marker.js +++ b/lib/ace/layer/marker.js @@ -111,9 +111,7 @@ var Marker = function(parentEl) { return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; }; - /** - * Draws a marker, which spans a range of text on multiple lines - */ + // Draws a marker, which spans a range of text on multiple lines this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig) { // selection start var row = range.start.row; @@ -137,9 +135,7 @@ var Marker = function(parentEl) { } }; - /** - * Draws a multi line marker, where lines span the full width - */ + // Draws a multi line marker, where lines span the full width this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) { var padding = type === "background" ? 0 : this.$padding; var layerWidth = layerConfig.width + 2 * this.$padding - padding; @@ -186,9 +182,7 @@ var Marker = function(parentEl) { ); }; - /** - * Draws a marker which covers part or whole width of a single screen line - */ + // Draws a marker which covers part or whole width of a single screen line this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength, type) { var padding = type === "background" ? 0 : this.$padding; var height = layerConfig.lineHeight; diff --git a/lib/ace/multi_select.js b/lib/ace/multi_select.js index 0b8850bc..ae1f9828 100644 --- a/lib/ace/multi_select.js +++ b/lib/ace/multi_select.js @@ -72,9 +72,11 @@ var EditSession = require("./edit_session").EditSession; this.rangeList = null; /** - * Selection.addRange(Range) -> Void + * Selection.addRange(range, $blockChangeEvents) -> Void + * - range (Range): The new range to add + * - $blockChangeEvents (Boolean): Whether or not to block changing events * - * adds a range to selection entering multiselect mode if necessary + * Adds a range to a selection by entering multiselect mode, if necessary. **/ this.addRange = function(range, $blockChangeEvents) { if (!range) @@ -119,10 +121,10 @@ var EditSession = require("./edit_session").EditSession; }; /** - * Selection.addRange(pos) -> Range - * pos: {row, column} + * Selection.substractPoint(pos) -> Range + * - pos (Range): The position to remove, as a `{row, column}` object * - * removes range containing pos (if exists) + * Removes a Range containing pos (if it exists). **/ this.substractPoint = function(pos) { var removed = this.rangeList.substractPoint(pos); @@ -210,10 +212,13 @@ var EditSession = require("./edit_session").EditSession; }; /** - * Selection.rectangularRangeBlock(screenCursor, screenAnchor, includeEmptyLines) -> [Range] - * gets list of ranges composing rectangular block on the screen - * @includeEmptyLines if true includes ranges inside the block which - * are empty becuase of the clipping + * Selection.rectangularRangeBlock(screenCursor, screenAnchor, includeEmptyLines) -> Range + * - screenCursor (Cursor): The cursor to use + * - screenAnchor (Anchor): The anchor to use + * - includeEmptyLins (Boolean): If true, this includes ranges inside the block which are empty due to clipping + * + * Gets list of ranges composing rectangular block on the screen + * */ this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) { var rectSel = []; @@ -295,9 +300,9 @@ var Editor = require("./editor").Editor; /** * Editor.addSelectionMarker(orientedRange) -> Range - * - orientedRange: range with cursor + * - orientedRange (Range): A range containing a cursor * - * adds selection and cursor + * Adds the selection and cursor. **/ this.addSelectionMarker = function(orientedRange) { if (!orientedRange.cursor) @@ -313,9 +318,9 @@ var Editor = require("./editor").Editor; /** * Editor.removeSelectionMarker(range) -> Void - * - range: selection range added with addSelectionMarker + * - range (Range): The selection range added with [[addSelectionMarker `addSelectionMarker()`]]. * - * removes selection marker + * Removes the selection marker. **/ this.removeSelectionMarker = function(range) { if (!range.marker) @@ -399,10 +404,10 @@ var Editor = require("./editor").Editor; /** * Editor.forEachSelection(cmd, args) -> Void - * - cmd: command to execute - * - args: arguments to the command + * - cmd (String): The command to execute + * - args (String): Any arguments for the command * - * executes command for each selection range + * Executes a command for each selection range. **/ this.forEachSelection = function(cmd, args) { if (this.inVirtualSelectionMode) @@ -462,13 +467,17 @@ var Editor = require("./editor").Editor; }; /** - * Editor.findAll(dir, options) -> Number - * - needle: text to find - * - options: search options - * - additive: keeps + * Editor.findAll(needle, dir, additive) -> Number + * - needle (String): The text to find + * - options (Object): Any of the additional [[Search search options]] + * - additive (Boolean): TODO + * + * Finds and selects all the occurences of needle + * + * #### Returns + * + * The number of found ranges. * - * finds and selects all the occurencies of needle - * returns number of found ranges **/ this.findAll = function(needle, options, additive) { options = options || {}; @@ -496,10 +505,10 @@ var Editor = require("./editor").Editor; // commands /** * Editor.selectMoreLines(dir, skip) -> Void - * - dir: -1 up, 1 down - * - skip: remove active selection range if true + * - dir (Number): The direction of lines to select: -1 for up, 1 for down + * - skip (Boolean): If `true`, removes the active selection range * - * adds cursor above or bellow active cursor + * Adds a cursor above or below the active cursor. **/ this.selectMoreLines = function(dir, skip) { var range = this.selection.toOrientedRange(); @@ -541,10 +550,10 @@ var Editor = require("./editor").Editor; /** * Editor.transposeSelections(dir) -> Void - * - dir: direction to rotate selections + * - dir (Number): The direction to rotate selections * - * contents - * empty ranges are expanded to word + * Transposes the selected ranges. + * **/ this.transposeSelections = function(dir) { var session = this.session; @@ -585,11 +594,10 @@ var Editor = require("./editor").Editor; /** * Editor.selectMore(dir, skip) -> Void - * - dir: 1 next, -1 previous - * - skip: remove active selection range if true + * - dir (Number): The direction of lines to select: -1 for up, 1 for down + * - skip (Boolean): If `true`, removes the active selection range * - * finds next occurence of text in active selection - * and adds it to the selections + * Finds the next occurence of text in an active selection and adds it to the selections. **/ this.selectMore = function (dir, skip) { var session = this.session;