From c209ed36b6aaaa992df8976789c8ba8112f8e5c5 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Sun, 4 Sep 2016 15:04:09 +0200 Subject: 2016-09-04 13:51:00 --- doc/context/documents/general/manuals/luatex.pdf | Bin 1039115 -> 1040069 bytes .../documents/general/manuals/math-mkiv.pdf | Bin 2769223 -> 2930082 bytes doc/context/documents/general/manuals/sql-mkiv.pdf | Bin 90616 -> 94133 bytes .../general/manuals/luatex/luatex-nodes.tex | 15 +++- .../sources/general/manuals/luatex/luatex.tex | 2 +- .../sources/general/manuals/sql/sql-mkiv.tex | 88 +++++++++++++++++++++ 6 files changed, 102 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf index c7a492ea8..d4ddd2996 100644 Binary files a/doc/context/documents/general/manuals/luatex.pdf and b/doc/context/documents/general/manuals/luatex.pdf differ diff --git a/doc/context/documents/general/manuals/math-mkiv.pdf b/doc/context/documents/general/manuals/math-mkiv.pdf index 5b6a5441e..6a120e30a 100644 Binary files a/doc/context/documents/general/manuals/math-mkiv.pdf and b/doc/context/documents/general/manuals/math-mkiv.pdf differ diff --git a/doc/context/documents/general/manuals/sql-mkiv.pdf b/doc/context/documents/general/manuals/sql-mkiv.pdf index 8d3588615..94a99d0ce 100644 Binary files a/doc/context/documents/general/manuals/sql-mkiv.pdf and b/doc/context/documents/general/manuals/sql-mkiv.pdf differ diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex index 821942a9a..fd0b47c72 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex @@ -1218,7 +1218,7 @@ The second return value is the badness of the generated box. See the description of \type {node.hpack()} for a few memory allocation caveats. -\subsubsection{\type {node.dimensions}} +\subsubsection{\type {node.dimensions}, \type {node.rangedimensions}} \startfunctioncall w, h, d = @@ -1271,7 +1271,17 @@ example in code like this, which prints the width of the space in between the You need to keep in mind that this is one of the few places in \TEX\ where floats are used, which means that you can get small differences in rounding when you -compare the width repported by \type {hpack} with \type {dimensions}. +compare the width reported by \type {hpack} with \type {dimensions}. + +The second alternative saves a few lookups and can be more convenient in some +cases: + +\startfunctioncall + w, h, d = + node.rangedimensions( parent, first) + w, h, d = + node.rangedimensions( parent, first, last) +\stopfunctioncall \subsubsection{\type {node.mlist_to_hlist}} @@ -1828,6 +1838,7 @@ this: \NC \type {count} \NC \yes \NC \yes \NC \NR \NC \type {current_attr} \NC \yes \NC \yes \NC \NR \NC \type {dimensions} \NC \yes \NC \yes \NC \NR +\NC \type {rangedimensions} \NC \yes \NC \yes \NC \NR %NC \type {do_ligature_n} \NC \yes \NC \yes \NC \NR % was never documented and experimental \NC \type {effective_glue} \NC \yes \NC \yes \NC \NR \NC \type {end_of_math} \NC \yes \NC \yes \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex index 7fd436666..75e63c9bb 100644 --- a/doc/context/sources/general/manuals/luatex/luatex.tex +++ b/doc/context/sources/general/manuals/luatex/luatex.tex @@ -12,7 +12,7 @@ \dontcomplain \startdocument - [version=0.98.2, + [version=0.98.4, status=pre-release] \component luatex-titlepage diff --git a/doc/context/sources/general/manuals/sql/sql-mkiv.tex b/doc/context/sources/general/manuals/sql/sql-mkiv.tex index 1b05c8738..95af57e11 100644 --- a/doc/context/sources/general/manuals/sql/sql-mkiv.tex +++ b/doc/context/sources/general/manuals/sql/sql-mkiv.tex @@ -485,6 +485,94 @@ with the command: context --extra=sql-tables --help \stoptyping +\stopsection + +\startsection[title=Example] + +The distribution has a few examples, for instance a logger. The following code shows +a bit of this (we assume that the swiglib sqlite module is present): + +\startbuffer +require("util-sql") +utilities.sql.setmethod("sqlite") +require("util-sql-loggers") + +local loggers = utilities.sql.loggers + +local presets = { + -- method = "sqlite", + database = "loggertest", + datatable = "loggers", + id = "loggers", +} + +os.remove("loggertest.db") -- start fresh + +local db = loggers.createdb(presets) + +loggers.save(db, { -- variant 1: data subtable + type = "error", + action = "process", + data = { filename = "test-1", message = "whatever a" } +} ) + +loggers.save(db, { -- variant 2: flat table + type = "warning", + action = "process", + filename = "test-2", + message = "whatever b" +} ) + + +local result = loggers.collect(db, { + start = { + day = 1, + month = 1, + year = 2016, + }, + stop = { + day = 31, + month = 12, + year = 2116, + }, + limit = 1000000, + -- type = "error", + action = "process" +}) + +context.starttabulate { "||||||" } +for i=1,#result do + local r = result[i] + context.NC() context(r.time) + context.NC() context(r.type) + context.NC() context(r.action) + if r.data then + context.NC() context(r.data.filename) + context.NC() context(r.data.message) + else + context.NC() + context.NC() + end + context.NC() context.NR() +end +context.stoptabulate() + +-- local result = loggers.cleanup(db, { +-- before = { +-- day = 1, +-- month = 1, +-- year = 2117, +-- }, +-- }) +\stopbuffer + +\typebuffer + +In this example we typeset the (small) table): + +\ctxluabuffer + + \stopsection \startsection[title=Colofon] -- cgit v1.2.3