From 85eab5ae6430d439257b3d14de2b819ff734fd1e Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 18 Jan 2014 13:23:00 +0100 Subject: beta 2014.01.18 13:23 --- doc/context/manuals/allkind/mkiv-publications.tex | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'doc') 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] -- cgit v1.2.3