Permalink
Browse files

Adding more collection methods to documentation

  • Loading branch information...
1 parent 1d4c51f commit c0c5229edd34be43d365ce6ed41493a250a8dca6 @christkv committed Jan 23, 2012
View
@@ -14,6 +14,10 @@ var extractLibraryMetaData = function(sourceFiles) {
var sourceFile = fs.readFileSync(sourceFiles[i].path);
// Parse the content
var metaData = dox.parseComments(sourceFile.toString());
+ // console.log("-------------------------------------------------------------- METADATA")
+ // console.log("-------------------------------------------------------------- METADATA")
+ // console.log("-------------------------------------------------------------- METADATA")
+ // console.dir(metaData)
// Save the metadata
dataObjects[sourceFiles[i]["tag"] != null ? sourceFiles[i].tag : i] = metaData;
}
@@ -100,14 +104,18 @@ var readAllTemplates = function(templates) {
// ----------------------------------------------------------------------------
// All source files for the api generation
var apiClasses = [
- {tag:"admin", path:"./lib/mongodb/admin.js"},
- {tag:"objectid", path:"./lib/mongodb/bson/objectid.js"}
+ // {tag:"admin", path:"./lib/mongodb/admin.js"},
+ // {tag:"objectid", path:"./lib/mongodb/bson/objectid.js"}
+ {tag:"collection", path:"./lib/mongodb/collection.js"}
];
// All test files
var testClasses = [
{path:"./test/admin_test.js"},
- {path:"./test/objectid_test.js"}
+ {path:"./test/objectid_test.js"},
+ {path:"./test/insert_test.js"},
+ {path:"./test/remove_test.js"},
+ {path:"./test/db_test.js"}
]
// Read all the templates
@@ -137,7 +145,7 @@ var templates = readAllTemplates(templates);
// Render all the templates
var renderAllTemplates = function(outputDirectory, templates, dataObjects, testObjects) {
// Helper methods used in the rendering
- var isClass = function(tags) {
+ var isClass = function(tags) {
for(var k = 0; k < tags.length; k++) {
if(tags[k].type == 'class') return true;
}
@@ -174,6 +182,9 @@ var renderAllTemplates = function(outputDirectory, templates, dataObjects, testO
{entries:classMetaData, examples:classExamplesData, isClass:isClass,
isFunction:isFunction, isProperty:isProperty, format:format});
+ console.log("======================================================== " + className)
+ console.log(classContent)
+
// Write out the content to disk
fs.writeFileSync(format("%s/%s.rst", outputDirectory, className), classContent);
}
@@ -150,7 +150,9 @@ for(var i = 0; i < entries.length; i++) {
.replace(/\<\/code\>\<\/pre\>/g, "")
.replace(/\<h2\>|\<\/h2\>/g, "**")
.replace(/\<p\>|\<\/p\>/g, "")
- .replace(/\<br\>|\<\/br\>/g, "\n");
+ .replace(/\<strong\>|\<\/strong\>/g, "**")
+ .replace(/\<em\>|\<\/em\>/g, "*")
+ .replace(/\<br[ ]*\>|\<\/br[ ]*\>|\<br[ ]*\/\>/g, "\n");
%><%= format("------------------\n%s\n------------------\n", entries[i].ctx.name) %><%
%><%- format("%s\n\n", fullDescription) %><%
@@ -22,7 +22,7 @@ var checkForHexRegExp = new RegExp("^[0-9a-fA-F]{24}$");
* Create a new ObjectID instance
*
* @class Represents the BSON ObjectID type
-* @param {String/Number} id Can be a 24 byte hex string, 12 byte binary string or a Number.
+* @param {String|Number} id Can be a 24 byte hex string, 12 byte binary string or a Number.
* @return {Object} instance of ObjectID.
*/
function ObjectID (id) {
Oops, something went wrong.

0 comments on commit c0c5229

Please sign in to comment.