public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* pandoc lua vs. pandoc
@ 2023-03-27 14:11 BPJ
       [not found] ` <CADAJKhDOC98BQ4UY+oKTMa4mfSgJMX8+J0GfXk=q3ebL-dFYYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: BPJ @ 2023-03-27 14:11 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

Is there any global value which is guaranteed to have different values when
running as `pandoc lua` vs. running as `pandoc`?

My use case is a script which should work both as a filter and as a
standalone script and print some info in the latter case.

It seems like `PANDOC_STATE` is nil when running as `pandoc lua`, but is
this always so, and/or is there a better option?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhDOC98BQ4UY%2BoKTMa4mfSgJMX8%2BJ0GfXk%3Dq3ebL-dFYYg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 1249 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pandoc lua vs. pandoc
       [not found] ` <CADAJKhDOC98BQ4UY+oKTMa4mfSgJMX8+J0GfXk=q3ebL-dFYYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2023-03-27 14:56   ` Albert Krewinkel
  0 siblings, 0 replies; 2+ messages in thread
From: Albert Krewinkel @ 2023-03-27 14:56 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Is there any global value which is guaranteed to have different
> values when running as `pandoc lua` vs. running as `pandoc`? 
>
> My use case is a script which should work both as a filter and as a
> standalone script and print some info in the latter case.
>
> It seems like `PANDOC_STATE` is nil when running as `pandoc lua`, but
> is this always so, and/or is there a better option?

The `PANDOC_STATE` variable being nil might be a bug, I'll have to check
that. The `arg` global should be a good indicator: it will always be set
to a table value when running `pandoc lua`, but never in filters or
custom readers/writers.


-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/87bkkez1b7.fsf%40zeitkraut.de.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-27 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 14:11 pandoc lua vs. pandoc BPJ
     [not found] ` <CADAJKhDOC98BQ4UY+oKTMa4mfSgJMX8+J0GfXk=q3ebL-dFYYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-03-27 14:56   ` Albert Krewinkel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).