diff options
author | Marius <mariausol@gmail.com> | 2014-01-18 14:40:15 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2014-01-18 14:40:15 +0200 |
commit | 11620c88a569cbab66c50271f7cc41a4e99973ff (patch) | |
tree | 2bf40c6fb38fa169fa28c5771a533005e6b3e80a /doc | |
parent | 33a2bd7467e39fc298dfc7ecfecdf1b013e0f15f (diff) | |
download | context-11620c88a569cbab66c50271f7cc41a4e99973ff.tar.gz |
beta 2014.01.18 13:23
Diffstat (limited to 'doc')
-rw-r--r-- | doc/context/manuals/allkind/mkiv-publications.tex | 57 |
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] |