> On 23. Feb 2018, at 22:00, Hans Hagen <pra...@wxs.nl> wrote:
> 
> maybe you mean
> 
> \startluacode
> 
> context.setupdocument {
>    gitversion = string.strip(
>        os.resultof("git --no-pager log --pretty='%h of %aD' -1 " .. 
> environment.jobfilefullname) or "")
> }
> 
> \stopluacode
> 
> \setupfootertexts
> [this is from file: \documentvariable{gitversion}]
> 
> \starttext
> 
> [[\ctxlua{context(environment.jobfilefullname)}]]
> 
> [[\ctxlua{context(environment.jobfilename)}]]
> 
> \ctxlua{inspect(table.sortedkeys(environment))}
> 
> test
> 
> \stoptext

Yes, sorry, I wasn’t clear enough. environment.jobfilefullname is excellent, I 
can work from here. Just to provide a clearer explanation: I have an 
environment style.tex. With it, I process a number of xml files: foo.xml, 
bar.xml, arg.xml with the call

context —environment style foo.xml etc.

and I want the git revision of the xml file printed not of the style file, 
obviously). jobfilefullname does what I want, and I’ll look into the other 
variables as well. Very handy, thanks!

Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to