ConTEXt meeting 2010 - Brejlov 1/13 Modules_ mkiv
ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov It was never intended as a complete test-bed: most already stable leases of ConTEXt_ mkii , which at that time was Also a way to check systematically the new re- den features due lack of documentation about programming in ConTEXt and discover hid- Original motivation was to learn something more tion around the end of 2006 I started to compile pdf modules for documenta- 2/13 the time the patches were not critical • • • •
ConTEXt meeting 2010 - Brejlov now patches can be useless or dangerous (the 4 times in a year) and hence Modules is more appro- which is updated less frequently (actually about 3 or From couple of years mkiv has a current release informational purposes. moving so fast also makes a little significance for code already changed enough to reject the patch) ating documentation harder than before because ConTEXt meeting 2010 - Brejlov mkiv was and still is ‘a moving fast target': gener- new kind of code to document, the Lua modules With ConTEXt- mkiv things changed a lot: 3/13 ConTEXt meeting 2010 - Brejlov priate for current than for beta . • • •
ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov 4/13 I believe that Modules is not a vital piece for doc- umentation purpose: to understand a piece of code now it's necessary to see together both the lua and the mkiv module and two disjoint pdfs are not prac- tical. Anyway, thank to Fabrice Popineau and Taco actu- ally Modules_ mkiv has a home at Supelec, at http: //foundry.supelec.fr/gf/project/modules/ that I update at least once at year.
ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov 5/13 Both Modules_ mkii and Modules_ mkiv were gener- ated by shell ( Bash ) script: for this meeting I've decided to replace this script with LuaTEX code to drop the necessity of a Bash interpreter.
ConTEXt meeting 2010 - Brejlov \ctxlua{document.lscarso.modules.setup()} and compile it \stoptext dofile("report.txt")} document.lscarso.modules.mkiv_report; \ctxlua{document.lscarso.modules.report = \stopmode \ctxlua{document.lscarso.modules.mkiv_savedata()} \ctxlua{document.lscarso.modules.mkiv()} \startmode[*first] ConTEXt meeting 2010 - Brejlov \starttext save this file as modules-mkiv.tex The idea is very simple: 6/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov #>context modules-mkiv
ConTEXt meeting 2010 - Brejlov we process it in batch-mode; we can decide if it of them under the folder does exactly this: it generates all pdfs and put each function document.lscarso.modules.mkiv() The function context.mkiv not the alphabetical one. compilation. Also note that we respect the order of was correctly generated by analyzing the result of that match \loadcorefile or \loadmarkfile and then ConTEXt meeting 2010 - Brejlov to extract the name of module to compile from a line The idea is as follow: we parse the file context.mkiv 7/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov pdf/<filename>/<filename>-mkiv.pdf
ConTEXt meeting 2010 - Brejlov saves all the results into the report.txt file in a way seen before is to replace the default function with our dofile("report.txt")} document.lscarso.modules.mkiv_report; \ctxlua{document.lscarso.modules.report = The meaning of which by default does nothing. document.lscarso.modules.report that they are callable by the lua function function document.lscarso.modules.mkiv_savedata() ConTEXt meeting 2010 - Brejlov The function 8/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov function and than evaluate it on report.txt
ConTEXt meeting 2010 - Brejlov report.txt : "font-ini.mkiv","buff-ver.mkiv","typo-ini.mkiv",}} "tabl-tab.mkiv","math-ali.mkiv", ["errors"]={"math-int.mkiv","tabl-ntb.mkiv", "symb-ini.mkiv",}, "bibl-bib.mkiv","strc-mat.mkiv",... document.lscarso.modules.report{["done"]={ 9/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov Using LuaTEX as a data description language.
ConTEXt meeting 2010 - Brejlov The function errors; the total runtime was 2681.937 seconds on there are 199 files correctly generated and 7 with With the ConTEXt- mkiv version 2010.07.22 19:04 ones that are wrongs. all pdfs that are OK, and the subject errors with those ject mkiv done that contains a tabular with the names is pretty simple: it typesets a document with the sub- document.lscarso.modules.mkiv_report(data) 10/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov my laptop.
ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov to implement in LuaTEX (and perhaps then the produce a patch file and it should be interesting patch is trivial; the Unix program diff can quickly often the errors are typo and hence the relative The next step is the management of errors. Quite anism to customize the elaboration of data. description side of Lua , which is a powerful mech- but probably the most important thing is the data It was easy to translate a Bash script in ConTEXt- mkiv Conclusion 11/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov patch program too). • •
ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov way the test files from Hans should take the prece- from Hans is doable but not mandatory and any- Finally an eventually integration with the test suite relies on a local svn client. implementation, apart an os system command that I see no valid reason to investigate on a LuaTEX Updating the svn repository is a manual job but a light pdf with only references to external pdfs. heavy because contains all pdfs. The idea is hence like this for mkii but the resulting pdf is too much be an easy task: originally Hans did something Creating a pdf to index each pdf of Modules should 12/13 ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov dence over the Modules files. • • •
ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov ConTEXt meeting 2010 - Brejlov 13/13 That's all Thank you !
Recommend
More recommend