summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-01-18 13:23:00 +0100
committerHans Hagen <pragma@wxs.nl>2014-01-18 13:23:00 +0100
commit85eab5ae6430d439257b3d14de2b819ff734fd1e (patch)
treed930d5cb6bb8003e4320fbed5ad1aac6513256b4 /doc
parent511bce00bd704b91e42763cf73d6e7be1af83923 (diff)
downloadcontext-85eab5ae6430d439257b3d14de2b819ff734fd1e.tar.gz
beta 2014.01.18 13:23
Diffstat (limited to 'doc')
-rw-r--r--doc/context/manuals/allkind/mkiv-publications.tex57
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/context/manuals/allkind/mkiv-publications.tex b/doc/context/manuals/allkind/mkiv-publications.tex
index fce992a54..6fe7f5b4e 100644
--- a/doc/context/manuals/allkind/mkiv-publications.tex
+++ b/doc/context/manuals/allkind/mkiv-publications.tex
@@ -832,6 +832,63 @@ This results in:
\ctxluabuffer
+You can manipulate a dataset after loading. Of course this assumes that you know
+what kind of content you have and what you need for rendering. As example we
+load a small dataset.
+
+\startbuffer
+\definebtxdataset[drumming]
+\usebtxdataset[drumming][mkiv-publications.lua]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+Because we're going to do some \LUA, we could also have loaded the dataset
+with:
+
+\starttyping
+publications.load("drumming","mkiv-publications.lua","lua")
+\stoptyping
+
+The dataset has three entries:
+
+\typefile{mkiv-publications.lua}
+
+As you can see, we can have a subtitle. We will combine the title and subtitle
+into one:
+
+\startbuffer
+\startluacode
+for tag, entry in next, publications.datasets.drumming.luadata do
+ if entry.subtitle then
+ if entry.title then
+ entry.title = entry.title .. ", " .. entry.subtitle
+ else
+ entry.title = entry.subtitle
+ end
+ entry.subtitle = nil
+ logs.report("btx","combining title and subtitle of entry tagged %a",tag)
+ end
+end
+\stopluacode
+\stopbuffer
+
+\typebuffer \getbuffer
+
+We can now typeset the entries with:
+
+\startbuffer
+\definebtxrendering[drumming][dataset=drumming,method=dataset]
+\placebtxrendering[drumming]
+\stopbuffer
+
+\typebuffer
+
+Because we just want to show the entries, and have no citations that force them
+to be shown, we have to the \type {method} to \type {dataset}.
+
+\blank \getbuffer \blank
+
\stopchapter
\startchapter[title=The \XML\ view]