Re: [NTG-context] Simplified input for natural tables
![](https://secure.gravatar.com/avatar/30ef4fea8acc9a4c7a392675260cfcb9.jpg?s=120&d=mm&r=g)
Hello Hraban, Simplified table syntax is much appreciated! Thank you for http://wiki.contextgarden.net/wikitable. However, I cannot understand how to use it. :) Best, Vyatcheslav
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 12.03.2009 um 18:14 schrieb Vyatcheslav Yatskovsky:
Hello Hraban,
Simplified table syntax is much appreciated! Thank you for http://wiki.contextgarden.net/wikitable .
However, I cannot understand how to use it. :)
In the same way as Hans wrote them in his exmple. \startluacode function commands.wiki_to_table(str) -- wrong namespace str = string.gsub(str,"%^ *[\n\r]","\\NC\\NR\n") str = string.gsub(str,"%^","\\NC ") str = string.gsub(str,"| *[\n\r]","\\NC\\NR\n") str = string.gsub(str,"|","\\NC ") tex.sprint(tex.ctxcatcodes,"\\startTABLE") tex.sprint(tex.ctxcatcodes,str) tex.sprint(tex.ctxcatcodes,"\\stopTABLE") end \stopluacode \def\startwikitable {\bgroup \obeylines \dostartwikitable} \long\def\dostartwikitable#1\stopwikitable {\ctxlua{commands.wiki_to_table([[\detokenize{#1}]])}% \egroup} \starttext \startwikitable ^ Heading 1 ^ Heading 2 ^ | Item 1 | Item 2 | | Item 3 | Item 4 | \stopwikitable \stoptext Wolfgang
participants (2)
-
Vyatcheslav Yatskovsky
-
Wolfgang Schuster