Re: [NTG-context] XML to ConTeXt: converting date attribute from ISO date
Am 11.03.2020 um 15:19 schrieb Hans Hagen
: On 3/11/2020 3:12 PM, Axel Kielhorn wrote:
Am 11.03.2020 um 15:01 schrieb Hans Hagen
: On 3/11/2020 2:14 PM, Axel Kielhorn wrote:
Had to change it to: \startluacode function xml.finalizers.tex.MyDate(e,what,how) local ee = e[1].at[what] local t = (string.split(ee,"-")) context.date( { y = t[1], m = t[2], d = t[3] }, { how } ) end \stopluacode
You mean the () around the split? weird. Anyway, there's also a time splitter (dedicated to Alan who needed one): No, sorry that’s an artifact from testing. I had to assign: local ee = e[1].at[what] and string.split(ee,"-") in two steps while the original had local t = string.split(e[1].at[what],"-") still strange because it's one value, if it were multiple you could do
This is strange. Now it works. Earlier I had context.date complaining that it got a table and not a string. That’s why I took the t = assignment apart into pieces. Now I copied the code from the original reply and it works. Sorry for the noise. Axel
Hello Hans and mailing list! Thank you so much. With this example and the help I received earlier from Massi, I’ve been able to write my first finalizer today. It is amazing how powerful luatex is. My project needs some cleanup and documentation but I hope to put it on GitHub soon. After that I will try to put a minimal version into the wiki. Greetings Axel
On 3/11/2020 4:54 PM, Axel Kielhorn wrote:
Hello Hans and mailing list!
Thank you so much.
With this example and the help I received earlier from Massi, I’ve been able to write my first finalizer today.
It is amazing how powerful luatex is.
My project needs some cleanup and documentation but I hope to put it on GitHub soon. After that I will try to put a minimal version into the wiki.
indeed (and luametatex is supposed to be even bit more powerful) that would be nice. thanks Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Axel Kielhorn
-
Hans Hagen