From: daurnimator Date: Fri, 29 Aug 2014 20:42:58 +0000 (-0400) Subject: doc/: Reduce functions to a h3 instead of h2 X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/8f5786554f58cae293237590d9fe918158b61561?ds=inline;pf=etc doc/: Reduce functions to a h3 instead of h2 --- diff --git a/doc/gettime.md b/doc/gettime.md index 2e3ef35..faabfb4 100644 --- a/doc/gettime.md +++ b/doc/gettime.md @@ -10,14 +10,14 @@ Uses the most precise method available (in order:) - [luasocket](http://w3.impa.br/~diego/software/luasocket/)'s `socket.gettime` - [`os.time`](http://www.lua.org/manual/5.2/manual.html#pdf-os.time) -## `source` +### `source` The library/function currently in use. -## `resolution` +### `resolution` The smallest time resolution (in seconds) available from `gettime ( )` . -## `gettime ( )` +### `gettime ( )` Returns the number of seconds since unix epoch (1970-01-01T00:00:00Z) as a lua number diff --git a/doc/index.md b/doc/index.md index 09e7d7d..85cf5ab 100644 --- a/doc/index.md +++ b/doc/index.md @@ -8,13 +8,13 @@ The table includes the following sub modules, which have their own documentation - `timetable`: Class for date/time objects supporting normalisation -## `time ( )` +### `time ( )` Returns the current unix timestamp using the most precise source available. See `gettime` for more information. -## `get_tz ( [timezone_name] )` +### `get_tz ( [timezone_name] )` Returns a timezone object (see `tzinfo` documentation) for the given `timezone_name`. If `timezone_name` is `nil` then the local timezone is used. @@ -25,7 +25,7 @@ names are usually of the form `Country/Largest_City` e.g. "America/New_York". Check [wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for an example list. -## `time_in ( timezone_name [, utc_ts] )` +### `time_in ( timezone_name [, utc_ts] )` Returns the current time in seconds since 1970-01-01 0:00:00 in the given timezone as a string, (same semantics as `get_tz`) at the given UTC time (defaults to now). diff --git a/doc/parse.md b/doc/parse.md index 6d72fdf..39529dd 100644 --- a/doc/parse.md +++ b/doc/parse.md @@ -4,6 +4,6 @@ Provides parsers for common time and date formats. Functions take the source string and an optional initial postition. -## `rfc_3339 ( string [, init] )` +### `rfc_3339 ( string [, init] )` Returns a luatz timetable and the (optional) time zone offset in seconds diff --git a/doc/timetable.md b/doc/timetable.md index 92c4302..845c787 100644 --- a/doc/timetable.md +++ b/doc/timetable.md @@ -21,29 +21,29 @@ called to modify components to return to their standard range. Equality and comparisons should work between timetable objects. -## `new ( year , month , day , hour , min , sec , [yday] , [wday] )` +### `new ( year , month , day , hour , min , sec , [yday] , [wday] )` Returns a new timetable with the given contents. -## `new_from_timestamp ( timestamp )` +### `new_from_timestamp ( timestamp )` Returns a new (normalised) timetable, given a timestamp in seconds since the unix epoch of 1970-01-01. -## `:clone ( )` +### `:clone ( )` Returns a new independent instance of an existing timetable object. -## `:normalise ( )` +### `:normalise ( )` Mutates the current object's time and date components so that they lie within 'normal' ranges e.g. `month` is `1`-`12`; `min` is `0`-`59` -## `:rfc_3339 ( )` and `__tostring` metamethod +### `:rfc_3339 ( )` and `__tostring` metamethod Returns the timetable formatted as an rfc-3339 style string. The timezone offset (or Z) is not appended. @@ -51,11 +51,11 @@ The ranges of components are not checked, if you want a valid timestamp, `:normalise ( )` should be called first. -## `:timestamp ( )` +### `:timestamp ( )` Returns the timetable as the number of seconds since unix epoch (1970-01-01) as a lua number. -## `:unpack ( )` +### `:unpack ( )` Unpacks the timetable object; returns `year`, `month`, `day`, `hour`, `min`, `sec`, `yday`, `wday` diff --git a/doc/tzinfo.md b/doc/tzinfo.md index 78d0453..8f95b5d 100644 --- a/doc/tzinfo.md +++ b/doc/tzinfo.md @@ -26,18 +26,18 @@ and contains the following fields: - `isgmt` (boolean) -## `:find_current ( utc_ts )` +### `:find_current ( utc_ts )` Returns the relevant `tt_info` object for the given UTC timestamp in the timezone. -## `:localise ( utc_ts )` and `:localize ( utc_ts )` +### `:localise ( utc_ts )` and `:localize ( utc_ts )` Convert the given UTC timestamp to the timezone. Returns the number of seconds since unix epoch in the given timezone. -## `:utctime ( local_ts )` +### `:utctime ( local_ts )` Convert the given local timestamp (seconds since unix epoch in the time zone) to a UTC timestamp. This may result in ambigous results, in which case multiple values are returned.