Updated docs; Fixed HastyScribe markdown.
@@ -8,6 +8,7 @@ m.route.mode = "hash";
app.init = function(info){ app.system = info; + app.system.v = app.system.version.match(/(v.+)$/)[1]; m.route(document.body, "/info", { "/info": app.info, "/html/:id...": app.htmldoc,@@ -24,4 +25,4 @@ });
}; Info.get().then(app.init); -}());+}());
@@ -76,7 +76,7 @@ }
} return md.link(href, title, text); }; - var html = marked(s, {renderer: hs}); + var html = marked(s, {renderer: hs}).replace(/\{\{\$version\}\}/g, app.system.v); var $html = $('<div>').append($(html).clone()); return u.fixHeadings($html, 2); };
@@ -2,17 +2,6 @@ ### High-Level Nim API
The following [proc](class:kwd)s map 1:1 to the corresponding HTTP methods. This API is recommended for most uses, as every method triggers exactly the same logic as the corresponding HTTP request. -{{ p-resource => resource -: The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).}} -{{ p-params => params -: The parameters to pass to the operation (see the corresponding HTTP querystring parameters).}} -{{ p-id => id -: The identifier of the resource (set to an empty string if not needed).}} -{{ p-body => body -: The request body. }} -{{ p-headers => headers -: An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.}} - #### get proc get*(resource, id: string, params = newStringTable(), headers = newHttpHeaders()): LSResponse@@ -21,10 +10,16 @@ Retrieves a resource.
##### Parameters -{{p-resource}} -{{p-id}} -{{p-params}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>params</dt> +<dd>The parameters to pass to the operation (see the corresponding HTTP querystring parameters).</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl> #### post@@ -34,11 +29,16 @@ Creates a new resource.
##### Parameters -{{p-resource}} -{{ p-folder => folder -: The folder that will contain the resource (set to an empty string if not needed).}} -{{p-body}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>folder</dt> +<dd>The folder that will contain the resource (set to an empty string if not needed).</dd> +<dt>body</dt> +<dd>The request body.</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl> #### put@@ -48,23 +48,35 @@ Modifies an existing resource.
##### Parameters -{{p-resource}} -{{p-id}} -{{p-body}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>body</dt> +<dd>The request body.</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl> #### patch proc patch*(resource, id, body: string, headers = newHttpHeaders()): LSResponse -Modifies the tags of an existing resource. +Modifies the tags of an existing resource (or the data of a JSON document). ##### Parameters -{{p-resource}} -{{p-id}} -{{p-body}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>body</dt> +<dd>The request body.</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl> #### delete@@ -74,9 +86,14 @@ Deletes an existing resource.
##### Parameters -{{p-resource}} -{{p-id}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl> #### head@@ -86,9 +103,14 @@ Checks whether a resource exists or not.
##### Parameters -{{p-resource}} -{{p-id}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl> #### options@@ -98,6 +120,11 @@ Checks what HTTP methods are supported by the specified resource.
##### Parameters -{{p-resource}} -{{p-id}} -{{p-headers}} +<dl> +<dt>resource</dt> +<dd>The resource to perform the operation on ([info](class:kwd) or [docs](class:kwd)).</dd> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>headers</dt> +<dd>An [HttpHeaders](class:kwd) object containing the headers of the request. Use the [Content-Type](class:kwd) header to specify the content type of the [body](class:kwd) parameter.</dd> +</dl>
@@ -2,13 +2,6 @@ ### Low-Level Nim API
The following [proc](class:kwd)s implement low-level operations on the LiteStore data store. Unlike the high-level API, the [proc](class:kwd)s exposed by this API do not perform the same validation checks as the corresponding HTTP operations, and they are meant to be used with caution in more advanced use cases. -{{p-ct => ct -: Determines the content type of the [body](class:kwd) parameter.}} -{{p-options => options -: A [QueryOptions](#QueryOptions) object representing a query to execute on a document.}} -{{p-folder => folder -: A logical folder where the document will be saved.}} - #### getInfo proc getInfo*(): LSResponse@@ -23,7 +16,10 @@ Retrieves multiple documents in JSON format based on the specified options.
##### Parameters -{{p-options}} +<dl> +<dt>options</dt> +<dd>A [QueryOptions](#QueryOptions) object representing a query to execute on a document.</dd> +</dl> #### getDocument@@ -33,8 +29,12 @@ Retrieves a single document.
##### Parameters -{{p-id}} -{{p-options}} +<dl> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>options</dt> +<dd>A [QueryOptions](#QueryOptions) object representing a query to execute on a document.</dd> +</dl> #### getRawDocument@@ -44,8 +44,12 @@ Retrieves a single document in JSON format.
##### Parameters -{{p-id}} -{{p-options}} +<dl> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>options</dt> +<dd>A [QueryOptions](#QueryOptions) object representing a query to execute on a document.</dd> +</dl> #### deleteDocument@@ -55,7 +59,10 @@ Deletes the specified document.
##### Parameters -{{p-id}} +<dl> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +</dl> #### postDocument@@ -65,9 +72,14 @@ Creates a new document in the specified folder.
##### Parameters -{{p-body}} -{{p-ct}} -{{p-folder}} +<dl> +<dt>body</dt> +<dd>The request body.</dd> +<dt>ct</dt> +<dd>Determines the content type of the [body](class:kwd) parameter.</dd> +<dt>folder</dt> +<dd>A logical folder where the document will be saved.</dd> +</dl> #### putDocument@@ -77,18 +89,26 @@ Modifies an existing document.
##### Parameters -{{p-id}} -{{p-body}} -{{p-ct}} +<dl> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>body</dt> +<dd>The request body.</dd> +<dt>ct</dt> +<dd>Determines the content type of the [body](class:kwd) parameter.</dd> +</dl> #### patchDocument proc patchDocument*(id, body: string): LSResponse -Modifies the tags of an existing document. +Modifies the tags of an existing document (or the body of a JSON document). ##### Parameters -{{p-id}} -{{p-body}} - +<dl> +<dt>id</dt> +<dd>The identifier of the resource (set to an empty string if not needed).</dd> +<dt>body</dt> +<dd>The request body.</dd> +</dl>