0.2.1 • Published 3 days ago

pliny v0.2.1

Weekly downloads
-
License
-
Repository
-
Last release
3 days ago

Writing new documentation with Pliny

Documentation in Primrose is recorded via explicit function calls, rather than the JavaDoc-style of parsing comment blocks. The documentation pages are built loading the production Primrose library itself and querying its documentation database live. New code features and documentation for them are delivered in one cohesive package.

Example:

pliny.function( {
  parent: "Primrose.Random",
  name: "number",
  description: "Returns a random floating-point number on a given range [min, max), i.e. min is inclusive, max is exclusive.",
  parameters: [
    {name: "min", type: "Number", description: "The included minimum side of the range of numbers."},
    {name: "max", type: "Number", description: "The excluded maximum side of the range of numbers."}
  ],
  returns: "A random number as good as your JavaScript engine supports with Math.random(), which is not good enough for crypto, but is certainly good enough for games."
});
Primrose.Random.number = function ( min, max ) {
  return Math.random() * ( max - min ) + min;
};

With the documentation being built in to the Primrose library itself, the latest documentation is always accessible from code, even during live-programming sessions, both in your scripts and in your browser's developer console.

If you ever have a question about how a function works, you can pop open the console and type in a query to the documentation database with the object's full-qualified name. For example, to read back the documentation specified above, we would type pliny("Primrose.HTTP.XHR").

[function] Primrose.HTTP.XHR([String] method, [String] type, [String] url, [Object] data, [Function] success, [Function] error, [Function] progress)
parent: Primrose.HTTP

Wraps up the XMLHttpRequest object into a workflow that is easier for me to handle: a single function call. Can handle both GETs and POSTs, with or  without a payload.

parameters:
0: [String] method - The HTTP Verb being used for the request.
1: [String] type - How the response should be interpreted. Defaults to "text". "json", "arraybuffer", and other values are also available. See the ref<1></1>.
2: [String] url - The resource to which the request is being sent.
3: [Object] data - The data object to use as the request body payload, if this is a PUT request.
4: [Function] success - (Optional) the callback to issue whenever the request finishes successfully, even going so far as to check HTTP status code on the OnLoad event.
5: [Function] error - (Optional) the callback to issue whenever an error occurs.
6: [Function] progress - (Optional) A callback function to be called as the download from the server progresses.

references:
0: MDN - XMLHttpRequest - responseType - https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype

examples:
0: Make a GET request. - Typically, you would use one of the other functions in the Primrose.HTTP namespace, but the XHR function is provided as a fallback in case those others do not meet your need...
0.2.1

3 days ago

0.2.0

1 month ago

0.1.7

3 months ago

0.1.6

6 months ago

0.1.5

7 months ago

0.1.4

8 months ago

0.1.0-beta.3

10 months ago

0.1.0-beta.2

10 months ago

0.1.2-beta.0

8 months ago

0.1.0-beta.5

10 months ago

0.1.2-beta.1

8 months ago

0.1.0-beta.4

10 months ago

0.1.0-beta.1

10 months ago

0.1.0-beta.10

10 months ago

0.1.0-beta.12

9 months ago

0.1.0-beta.11

10 months ago

0.1.0-beta.7

10 months ago

0.1.0-beta.13

9 months ago

0.1.0-beta.6

10 months ago

0.1.0-beta.9

10 months ago

0.1.0-beta.8

10 months ago

0.1.0

9 months ago

0.1.2

8 months ago

0.1.1

9 months ago

0.1.3

8 months ago

0.1.1-beta.1

9 months ago

0.1.1-beta.0

9 months ago

0.0.10

1 year ago

0.0.6-beta.7

2 years ago

0.0.6-beta.6

2 years ago

0.0.6-beta.5

2 years ago

0.0.6-beta.4

2 years ago

0.0.6-beta.3

2 years ago

0.0.6-beta.2

2 years ago

0.0.9-beta.0

1 year ago

0.0.9

1 year ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6-beta.1

2 years ago

0.0.6-beta.0

2 years ago

0.0.6

2 years ago

0.0.1-rc.3

2 years ago

0.0.1-rc.4

2 years ago

0.0.1-rc.1

2 years ago

0.0.1-rc.2

2 years ago

0.0.1-rc.5

2 years ago

0.0.1-rc.6

2 years ago

0.0.1

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.4.3

7 years ago

3.4.2

7 years ago

3.4.1

7 years ago

3.4.0

7 years ago

3.3.5

7 years ago

3.3.4

8 years ago

3.3.3

8 years ago

3.3.2

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.6

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago