public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Experimenting with pandoc module using just Lua
@ 2022-06-16 14:51 A A
       [not found] ` <CAMwawgOK_kc4oYvF50s8590tngEXRpiG=2hnh0PR2FNXskZhCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: A A @ 2022-06-16 14:51 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Dear All,

Is there a way to experiment with the objects pandoc module using Lua
without having to write a filter/writer and go through the pandoc CLI? I
would really like to just experiment with generating documents and getting
familiar with the Lua API using just a Lua interpreter.

Regards,

Amine

-- 
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/CAMwawgOK_kc4oYvF50s8590tngEXRpiG%3D2hnh0PR2FNXskZhCw%40mail.gmail.com.

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

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

* Re: Experimenting with pandoc module using just Lua
       [not found] ` <CAMwawgOK_kc4oYvF50s8590tngEXRpiG=2hnh0PR2FNXskZhCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-06-16 15:19   ` Bastien DUMONT
  2022-06-16 15:20   ` Fwd: " A A
  1 sibling, 0 replies; 10+ messages in thread
From: Bastien DUMONT @ 2022-06-16 15:19 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You may be interested by this: https://groups.google.com/g/pandoc-discuss/c/zVJKQlkw5IE/m/_ZUNujWAAQAJ

Le Thursday 16 June 2022 à 04:51:26PM, A A a écrit :
> Dear All,
> 
> Is there a way to experiment with the objects pandoc module using Lua without
> having to write a filter/writer and go through the pandoc CLI? I would really
> like to just experiment with generating documents and getting familiar with the
> Lua API using just a Lua interpreter.
> 
> Regards,
> 
> Amine
> 
> --
> 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/
> CAMwawgOK_kc4oYvF50s8590tngEXRpiG%3D2hnh0PR2FNXskZhCw%40mail.gmail.com.
> 
> References:
> 
> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgOK_kc4oYvF50s8590tngEXRpiG%3D2hnh0PR2FNXskZhCw%40mail.gmail.com?utm_medium=email&utm_source=footer

-- 
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/YqtKCj3DvDtcY%2BbZ%40localhost.


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

* Fwd: Experimenting with pandoc module using just Lua
       [not found] ` <CAMwawgOK_kc4oYvF50s8590tngEXRpiG=2hnh0PR2FNXskZhCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2022-06-16 15:19   ` Bastien DUMONT
@ 2022-06-16 15:20   ` A A
  2022-06-16 15:28     ` A A
  1 sibling, 1 reply; 10+ messages in thread
From: A A @ 2022-06-16 15:20 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I guess a better way to phrase my question is the following:

*Is there a way to generate a document from scratch and programmatically
using Lua and without using Haskell?*

There is mention here <https://pandoc.org/using-the-pandoc-api.html#builder>
of a pandoc Builder class but I don’t see its Lua equivalent here
<https://pandoc.org/lua-filters.html#module-pandoc>.


---------- Forwarded message ---------
From: A A <amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Thu, 16 Jun 2022 at 16:51
Subject: Experimenting with pandoc module using just Lua
To: <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


Dear All,

Is there a way to experiment with the objects pandoc module using Lua
without having to write a filter/writer and go through the pandoc CLI? I
would really like to just experiment with generating documents and getting
familiar with the Lua API using just a Lua interpreter.

Regards,

Amine

-- 
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/CAMwawgPtK_eLEpXrJrHPBnjBU-jDoMe-LM4ppba3ibSyqkHR%3Dg%40mail.gmail.com.

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

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

* Re: Experimenting with pandoc module using just Lua
  2022-06-16 15:20   ` Fwd: " A A
@ 2022-06-16 15:28     ` A A
       [not found]       ` <CAMwawgOHE5QEeHJbO+NF8QvViKas3P6Q6G7F=dS4YecTda1z1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: A A @ 2022-06-16 15:28 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Hi Bastien,

I'm afraid that doesn't really show me how I can build a document from
scratch similar to what is done in Haskell using a `Builder`.

I really would like to avoid learning Haskell and stick to the Lua API. But
I'm getting the impression that use of the Lua API requires understanding
of how the underlying Haskell objects interact.

Regards,

Amine

On Thu, 16 Jun 2022 at 17:20, A A <amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> I guess a better way to phrase my question is the following:
>
> *Is there a way to generate a document from scratch and programmatically
> using Lua and without using Haskell?*
>
> There is mention here
> <https://pandoc.org/using-the-pandoc-api.html#builder> of a pandoc Builder
> class but I don’t see its Lua equivalent here
> <https://pandoc.org/lua-filters.html#module-pandoc>.
>
>
> ---------- Forwarded message ---------
> From: A A <amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date: Thu, 16 Jun 2022 at 16:51
> Subject: Experimenting with pandoc module using just Lua
> To: <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>
>
> Dear All,
>
> Is there a way to experiment with the objects pandoc module using Lua
> without having to write a filter/writer and go through the pandoc CLI? I
> would really like to just experiment with generating documents and getting
> familiar with the Lua API using just a Lua interpreter.
>
> Regards,
>
> Amine
>

-- 
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/CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com.

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

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

* Re: Experimenting with pandoc module using just Lua
       [not found]       ` <CAMwawgOHE5QEeHJbO+NF8QvViKas3P6Q6G7F=dS4YecTda1z1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-06-16 15:33         ` Bastien DUMONT
  2022-06-17  9:38           ` A A
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien DUMONT @ 2022-06-16 15:33 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I don't think that you can do this directly from a Lua interpreter. This is how I would build a document programmatically:

```build.lua
function Pandoc(_)
  return pandoc.Pandoc(
    pandoc.Para({
        pandoc.Str('Hello'),
        pandoc.Space(),
        pandoc.Emph(pandoc.Str('World')),
        pandoc.Str('!')
    })
  )
end
```

pandoc -L build.lua <<< '' outputs `<p>Hello <em>World</em>!</p>`.


Le Thursday 16 June 2022 à 05:28:29PM, A A a écrit :
> Hi Bastien,
> 
> I'm afraid that doesn't really show me how I can build a document from scratch
> similar to what is done in Haskell using a `Builder`.
> 
> I really would like to avoid learning Haskell and stick to the Lua API. But I'm
> getting the impression that use of the Lua API requires understanding of how
> the underlying Haskell objects interact.
> 
> Regards,
> 
> Amine
> 
> On Thu, 16 Jun 2022 at 17:20, A A <[1]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> 
>     I guess a better way to phrase my question is the following:
> 
>     Is there a way to generate a document from scratch and programmatically
>     using Lua and without using Haskell?
> 
>     There is mention [2]here of a pandoc Builder class but I don’t see its Lua
>     equivalent [3]here.
> 
> 
> 
>     ---------- Forwarded message ---------
>     From: A A <[4]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>     Date: Thu, 16 Jun 2022 at 16:51
>     Subject: Experimenting with pandoc module using just Lua
>     To: <[5]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> 
> 
> 
>     Dear All,
> 
>     Is there a way to experiment with the objects pandoc module using Lua
>     without having to write a filter/writer and go through the pandoc CLI? I
>     would really like to just experiment with generating documents and getting
>     familiar with the Lua API using just a Lua interpreter.
> 
>     Regards,
> 
>     Amine
> 
> --
> 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 [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [7]https://groups.google.com/d/msgid/
> pandoc-discuss/
> CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com.
> 
> References:
> 
> [1] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [2] https://pandoc.org/using-the-pandoc-api.html#builder
> [3] https://pandoc.org/lua-filters.html#module-pandoc
> [4] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [5] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [7] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium=email&utm_source=footer

-- 
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/YqtNZpy71u2Ud39K%40localhost.


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

* Re: Experimenting with pandoc module using just Lua
  2022-06-16 15:33         ` Bastien DUMONT
@ 2022-06-17  9:38           ` A A
       [not found]             ` <CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: A A @ 2022-06-17  9:38 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Hi Bastien,

Thanks, that's a bit more like what I'm looking for.

However, when I try to compile in Powershell using `pandoc -L build.lua` I
get no output and the command prompt just kind of hangs there until I press
Ctrl+C.

Pretty sure I'm doing something wrong but I'm not sure what....

Regards,

Amine

On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
wrote:

> I don't think that you can do this directly from a Lua interpreter. This
> is how I would build a document programmatically:
>
> ```build.lua
> function Pandoc(_)
>   return pandoc.Pandoc(
>     pandoc.Para({
>         pandoc.Str('Hello'),
>         pandoc.Space(),
>         pandoc.Emph(pandoc.Str('World')),
>         pandoc.Str('!')
>     })
>   )
> end
> ```
>
> pandoc -L build.lua <<< '' outputs `<p>Hello <em>World</em>!</p>`.
>
>
> Le Thursday 16 June 2022 à 05:28:29PM, A A a écrit :
> > Hi Bastien,
> >
> > I'm afraid that doesn't really show me how I can build a document from
> scratch
> > similar to what is done in Haskell using a `Builder`.
> >
> > I really would like to avoid learning Haskell and stick to the Lua API.
> But I'm
> > getting the impression that use of the Lua API requires understanding of
> how
> > the underlying Haskell objects interact.
> >
> > Regards,
> >
> > Amine
> >
> > On Thu, 16 Jun 2022 at 17:20, A A <[1]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> >
> >     I guess a better way to phrase my question is the following:
> >
> >     Is there a way to generate a document from scratch and
> programmatically
> >     using Lua and without using Haskell?
> >
> >     There is mention [2]here of a pandoc Builder class but I don’t see
> its Lua
> >     equivalent [3]here.
> >
> >
> >
> >     ---------- Forwarded message ---------
> >     From: A A <[4]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >     Date: Thu, 16 Jun 2022 at 16:51
> >     Subject: Experimenting with pandoc module using just Lua
> >     To: <[5]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> >
> >
> >
> >     Dear All,
> >
> >     Is there a way to experiment with the objects pandoc module using Lua
> >     without having to write a filter/writer and go through the pandoc
> CLI? I
> >     would really like to just experiment with generating documents and
> getting
> >     familiar with the Lua API using just a Lua interpreter.
> >
> >     Regards,
> >
> >     Amine
> >
> > --
> > 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 [6]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit [7]
> https://groups.google.com/d/msgid/
> > pandoc-discuss/
> > CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com
> .
> >
> > References:
> >
> > [1] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > [2] https://pandoc.org/using-the-pandoc-api.html#builder
> > [3] https://pandoc.org/lua-filters.html#module-pandoc
> > [4] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > [5] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [6] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [7]
> https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium=email&utm_source=footer
>
> --
> 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/YqtNZpy71u2Ud39K%40localhost
> .
>

-- 
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/CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com.

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

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

* Re: Experimenting with pandoc module using just Lua
       [not found]             ` <CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-06-17  9:49               ` Bastien DUMONT
  2022-06-17 10:07                 ` AW: " denis.maier-NSENcxR/0n0
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien DUMONT @ 2022-06-17  9:49 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You need to supply an empty input to pandoc. In Powershell, you can type `echo '' | pandoc -L build.lua`.

Le Friday 17 June 2022 à 11:38:11AM, A A a écrit :
> Hi Bastien,
> 
> Thanks, that's a bit more like what I'm looking for.
> 
> However, when I try to compile in Powershell using `pandoc -L build.lua` I get
> no output and the command prompt just kind of hangs there until I press Ctrl+C.
> 
> Pretty sure I'm doing something wrong but I'm not sure what....
> 
> Regards,
> 
> Amine
> 
> On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT <[1]bastien.dumont-VwIFZPTo/vqzQB+pC5nmwQ@public.gmane.orgt>
> wrote:
> 
>     I don't think that you can do this directly from a Lua interpreter. This is
>     how I would build a document programmatically:
> 
>     ```build.lua
>     function Pandoc(_)
>       return pandoc.Pandoc(
>         pandoc.Para({
>             pandoc.Str('Hello'),
>             pandoc.Space(),
>             pandoc.Emph(pandoc.Str('World')),
>             pandoc.Str('!')
>         })
>       )
>     end
>     ```
> 
>     pandoc -L build.lua <<< '' outputs `<p>Hello <em>World</em>!</p>`.
> 
> 
>     Le Thursday 16 June 2022 à 05:28:29PM, A A a écrit :
>     > Hi Bastien,
>     >
>     > I'm afraid that doesn't really show me how I can build a document from
>     scratch
>     > similar to what is done in Haskell using a `Builder`.
>     >
>     > I really would like to avoid learning Haskell and stick to the Lua API.
>     But I'm
>     > getting the impression that use of the Lua API requires understanding of
>     how
>     > the underlying Haskell objects interact.
>     >
>     > Regards,
>     >
>     > Amine
>     >
>     > On Thu, 16 Jun 2022 at 17:20, A A <[1][2]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>     wrote:
>     >
>     >
>     >     I guess a better way to phrase my question is the following:
>     >
>     >     Is there a way to generate a document from scratch and
>     programmatically
>     >     using Lua and without using Haskell?
>     >
>     >     There is mention [2]here of a pandoc Builder class but I don’t see
>     its Lua
>     >     equivalent [3]here.
>     >
>     >
>     >
>     >     ---------- Forwarded message ---------
>     >     From: A A <[4][3]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>     >     Date: Thu, 16 Jun 2022 at 16:51
>     >     Subject: Experimenting with pandoc module using just Lua
>     >     To: <[5][4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>     >
>     >
>     >
>     >     Dear All,
>     >
>     >     Is there a way to experiment with the objects pandoc module using Lua
>     >     without having to write a filter/writer and go through the pandoc
>     CLI? I
>     >     would really like to just experiment with generating documents and
>     getting
>     >     familiar with the Lua API using just a Lua interpreter.
>     >
>     >     Regards,
>     >
>     >     Amine
>     >
>     > --
>     > 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 [6][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     > To view this discussion on the web visit [7][6]https://groups.google.com/
>     d/msgid/
>     > pandoc-discuss/
>     > CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%[7]
>     40mail.gmail.com.
>     >
>     > References:
>     >
>     > [1] mailto:[8]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>     > [2] [9]https://pandoc.org/using-the-pandoc-api.html#builder
>     > [3] [10]https://pandoc.org/lua-filters.html#module-pandoc
>     > [4] mailto:[11]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>     > [5] mailto:[12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > [6] mailto:[13]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>     > [7] [14]https://groups.google.com/d/msgid/pandoc-discuss/
>     CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?
>     utm_medium=email&utm_source=footer
> 
>     --
>     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 [15]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>     To view this discussion on the web visit [16]https://groups.google.com/d/
>     msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40localhost.
> 
> --
> 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 [17]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [18]https://groups.google.com/d/msgid/
> pandoc-discuss/
> CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com.
> 
> References:
> 
> [1] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org
> [2] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [3] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [4] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [5] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [6] https://groups.google.com/d/msgid/
> [7] http://40mail.gmail.com/
> [8] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [9] https://pandoc.org/using-the-pandoc-api.html#builder
> [10] https://pandoc.org/lua-filters.html#module-pandoc
> [11] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> [12] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [13] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [14] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium=email&utm_source=footer
> [15] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [16] https://groups.google.com/d/msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40localhost
> [17] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [18] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com?utm_medium=email&utm_source=footer

-- 
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/YqxOI1fX2hiBA3YB%40localhost.


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

* AW: Experimenting with pandoc module using just Lua
  2022-06-17  9:49               ` Bastien DUMONT
@ 2022-06-17 10:07                 ` denis.maier-NSENcxR/0n0
       [not found]                   ` <cb27f08f1f8244119dc1865f9b655618-NSENcxR/0n0@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: denis.maier-NSENcxR/0n0 @ 2022-06-17 10:07 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

IDK if the use case is common enough to warant a new command line parameter...

But, what about a new option like this?

`pandoc -L build.lua --no-input`

The example `echo '' | pandoc` works with Powershell, but not with cmd. There you'll get the result:
<p>ÔÇÖÔÇÖ</p>

Don't know about bash or other shells.

Denis





> -----Ursprüngliche Nachricht-----
> Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-
> discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT
> Gesendet: Freitag, 17. Juni 2022 11:49
> An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> Betreff: Re: Experimenting with pandoc module using just Lua
> 
> You need to supply an empty input to pandoc. In Powershell, you can type
> `echo '' | pandoc -L build.lua`.
> 
> Le Friday 17 June 2022 à 11:38:11AM, A A a écrit :
> > Hi Bastien,
> >
> > Thanks, that's a bit more like what I'm looking for.
> >
> > However, when I try to compile in Powershell using `pandoc -L
> > build.lua` I get no output and the command prompt just kind of hangs there
> until I press Ctrl+C.
> >
> > Pretty sure I'm doing something wrong but I'm not sure what....
> >
> > Regards,
> >
> > Amine
> >
> > On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT
> > <[1]bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
> > wrote:
> >
> >     I don't think that you can do this directly from a Lua interpreter. This is
> >     how I would build a document programmatically:
> >
> >     ```build.lua
> >     function Pandoc(_)
> >       return pandoc.Pandoc(
> >         pandoc.Para({
> >             pandoc.Str('Hello'),
> >             pandoc.Space(),
> >             pandoc.Emph(pandoc.Str('World')),
> >             pandoc.Str('!')
> >         })
> >       )
> >     end
> >     ```
> >
> >     pandoc -L build.lua <<< '' outputs `<p>Hello <em>World</em>!</p>`.
> >
> >
> >     Le Thursday 16 June 2022 à 05:28:29PM, A A a écrit :
> >     > Hi Bastien,
> >     >
> >     > I'm afraid that doesn't really show me how I can build a document from
> >     scratch
> >     > similar to what is done in Haskell using a `Builder`.
> >     >
> >     > I really would like to avoid learning Haskell and stick to the Lua API.
> >     But I'm
> >     > getting the impression that use of the Lua API requires understanding
> of
> >     how
> >     > the underlying Haskell objects interact.
> >     >
> >     > Regards,
> >     >
> >     > Amine
> >     >
> >     > On Thu, 16 Jun 2022 at 17:20, A A
> <[1][2]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >     wrote:
> >     >
> >     >
> >     >     I guess a better way to phrase my question is the following:
> >     >
> >     >     Is there a way to generate a document from scratch and
> >     programmatically
> >     >     using Lua and without using Haskell?
> >     >
> >     >     There is mention [2]here of a pandoc Builder class but I don’t see
> >     its Lua
> >     >     equivalent [3]here.
> >     >
> >     >
> >     >
> >     >     ---------- Forwarded message ---------
> >     >     From: A A <[4][3]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >     >     Date: Thu, 16 Jun 2022 at 16:51
> >     >     Subject: Experimenting with pandoc module using just Lua
> >     >     To: <[5][4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> >     >
> >     >
> >     >
> >     >     Dear All,
> >     >
> >     >     Is there a way to experiment with the objects pandoc module using
> Lua
> >     >     without having to write a filter/writer and go through the pandoc
> >     CLI? I
> >     >     would really like to just experiment with generating documents and
> >     getting
> >     >     familiar with the Lua API using just a Lua interpreter.
> >     >
> >     >     Regards,
> >     >
> >     >     Amine
> >     >
> >     > --
> >     > 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 [6][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> >     > To view this discussion on the web visit
> [7][6]https://groups.google.com/
> >     d/msgid/
> >     > pandoc-discuss/
> >     >
> CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%[7
> ]
> >     40mail.gmail.com.
> >     >
> >     > References:
> >     >
> >     > [1] mailto:[8]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> >     > [2] [9]https://pandoc.org/using-the-pandoc-api.html#builder
> >     > [3] [10]https://pandoc.org/lua-filters.html#module-pandoc
> >     > [4] mailto:[11]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> >     > [5] mailto:[12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> >     > [6] mailto:[13]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> >     > [7] [14]https://groups.google.com/d/msgid/pandoc-discuss/
> >
> CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%4
> 0mail.gmail.com?
> >     utm_medium=email&utm_source=footer
> >
> >     --
> >     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 [15]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> >     To view this discussion on the web visit
> [16]https://groups.google.com/d/
> >     msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40localhost.
> >
> > --
> > 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 [17]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit
> > [18]https://groups.google.com/d/msgid/
> > pandoc-discuss/
> >
> CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.g
> mail.com.
> >
> > References:
> >
> > [1] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org
> > [2] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > [3] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > [4] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [5] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [6] https://groups.google.com/d/msgid/
> > [7] http://40mail.gmail.com/
> > [8] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > [9] https://pandoc.org/using-the-pandoc-api.html#builder
> > [10] https://pandoc.org/lua-filters.html#module-pandoc
> > [11] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [12]
> > mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [13] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [14]
> > https://groups.google.com/d/msgid/pandoc-
> discuss/CAMwawgOHE5QEeHJbO%2B
> >
> NF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium
> =email&u
> > tm_source=footer [15]
> > mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [16]
> > https://groups.google.com/d/msgid/pandoc-
> discuss/YqtNZpy71u2Ud39K%40lo
> > calhost [17] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > [18]
> > https://groups.google.com/d/msgid/pandoc-
> discuss/CAMwawgMt32uLCRXDqwxp
> >
> udMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com?utm_medium=emai
> l&utm_s
> > ource=footer
> 
> --
> 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/YqxOI1fX2hiBA3YB%40localhost.

-- 
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/cb27f08f1f8244119dc1865f9b655618%40unibe.ch.


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

* Re: Experimenting with pandoc module using just Lua
       [not found]                   ` <cb27f08f1f8244119dc1865f9b655618-NSENcxR/0n0@public.gmane.org>
@ 2022-06-17 15:35                     ` BPJ
  2022-06-17 17:34                     ` AW: " John MacFarlane
  1 sibling, 0 replies; 10+ messages in thread
From: BPJ @ 2022-06-17 15:35 UTC (permalink / raw)
  To: pandoc-discuss

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

In bash or zsh I would typically use

``````
pandoc -L build.lua
^D
``````

Wouldn't the same work in Windows? (tho with Ctrl-Z instead of Ctrl-D I
believe!)

Den fre 17 juni 2022 12:08 <denis.maier-NSENcxR/0n0@public.gmane.org> skrev:

> IDK if the use case is common enough to warant a new command line
> parameter...
>
> But, what about a new option like this?
>
> `pandoc -L build.lua --no-input`
>
> The example `echo '' | pandoc` works with Powershell, but not with cmd.
> There you'll get the result:
> <p>ÔÇÖÔÇÖ</p>
>
> Don't know about bash or other shells.
>
> Denis
>
>
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-
> > discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT
> > Gesendet: Freitag, 17. Juni 2022 11:49
> > An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > Betreff: Re: Experimenting with pandoc module using just Lua
> >
> > You need to supply an empty input to pandoc. In Powershell, you can type
> > `echo '' | pandoc -L build.lua`.
> >
> > Le Friday 17 June 2022 à 11:38:11AM, A A a écrit :
> > > Hi Bastien,
> > >
> > > Thanks, that's a bit more like what I'm looking for.
> > >
> > > However, when I try to compile in Powershell using `pandoc -L
> > > build.lua` I get no output and the command prompt just kind of hangs
> there
> > until I press Ctrl+C.
> > >
> > > Pretty sure I'm doing something wrong but I'm not sure what....
> > >
> > > Regards,
> > >
> > > Amine
> > >
> > > On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT
> > > <[1]bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
> > > wrote:
> > >
> > >     I don't think that you can do this directly from a Lua
> interpreter. This is
> > >     how I would build a document programmatically:
> > >
> > >     ```build.lua
> > >     function Pandoc(_)
> > >       return pandoc.Pandoc(
> > >         pandoc.Para({
> > >             pandoc.Str('Hello'),
> > >             pandoc.Space(),
> > >             pandoc.Emph(pandoc.Str('World')),
> > >             pandoc.Str('!')
> > >         })
> > >       )
> > >     end
> > >     ```
> > >
> > >     pandoc -L build.lua <<< '' outputs `<p>Hello <em>World</em>!</p>`.
> > >
> > >
> > >     Le Thursday 16 June 2022 à 05:28:29PM, A A a écrit :
> > >     > Hi Bastien,
> > >     >
> > >     > I'm afraid that doesn't really show me how I can build a
> document from
> > >     scratch
> > >     > similar to what is done in Haskell using a `Builder`.
> > >     >
> > >     > I really would like to avoid learning Haskell and stick to the
> Lua API.
> > >     But I'm
> > >     > getting the impression that use of the Lua API requires
> understanding
> > of
> > >     how
> > >     > the underlying Haskell objects interact.
> > >     >
> > >     > Regards,
> > >     >
> > >     > Amine
> > >     >
> > >     > On Thu, 16 Jun 2022 at 17:20, A A
> > <[1][2]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > >     wrote:
> > >     >
> > >     >
> > >     >     I guess a better way to phrase my question is the following:
> > >     >
> > >     >     Is there a way to generate a document from scratch and
> > >     programmatically
> > >     >     using Lua and without using Haskell?
> > >     >
> > >     >     There is mention [2]here of a pandoc Builder class but I
> don’t see
> > >     its Lua
> > >     >     equivalent [3]here.
> > >     >
> > >     >
> > >     >
> > >     >     ---------- Forwarded message ---------
> > >     >     From: A A <[4][3]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > >     >     Date: Thu, 16 Jun 2022 at 16:51
> > >     >     Subject: Experimenting with pandoc module using just Lua
> > >     >     To: <[5][4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> > >     >
> > >     >
> > >     >
> > >     >     Dear All,
> > >     >
> > >     >     Is there a way to experiment with the objects pandoc module
> using
> > Lua
> > >     >     without having to write a filter/writer and go through the
> pandoc
> > >     CLI? I
> > >     >     would really like to just experiment with generating
> documents and
> > >     getting
> > >     >     familiar with the Lua API using just a Lua interpreter.
> > >     >
> > >     >     Regards,
> > >     >
> > >     >     Amine
> > >     >
> > >     > --
> > >     > 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 [6][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > >     > To view this discussion on the web visit
> > [7][6]https://groups.google.com/
> > >     d/msgid/
> > >     > pandoc-discuss/
> > >     >
> > CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%[7
> > ]
> > >     40mail.gmail.com.
> > >     >
> > >     > References:
> > >     >
> > >     > [1] mailto:[8]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > >     > [2] [9]https://pandoc.org/using-the-pandoc-api.html#builder
> > >     > [3] [10]https://pandoc.org/lua-filters.html#module-pandoc
> > >     > [4] mailto:[11]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > >     > [5] mailto:[12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > >     > [6] mailto:[13]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > >     > [7] [14]https://groups.google.com/d/msgid/pandoc-discuss/
> > >
> > CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%4
> > 0mail.gmail.com?
> > >     utm_medium=email&utm_source=footer
> > >
> > >     --
> > >     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 [15]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > >     To view this discussion on the web visit
> > [16]https://groups.google.com/d/
> > >     msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40localhost.
> > >
> > > --
> > > 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 [17]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > > To view this discussion on the web visit
> > > [18]https://groups.google.com/d/msgid/
> > > pandoc-discuss/
> > >
> > CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.g
> > mail.com.
> > >
> > > References:
> > >
> > > [1] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org
> > > [2] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > > [3] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > > [4] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [5] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [6] https://groups.google.com/d/msgid/
> > > [7] http://40mail.gmail.com/
> > > [8] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> > > [9] https://pandoc.org/using-the-pandoc-api.html#builder
> > > [10] https://pandoc.org/lua-filters.html#module-pandoc
> > > [11] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [12]
> > > mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [13] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [14]
> > > https://groups.google.com/d/msgid/pandoc-
> > discuss/CAMwawgOHE5QEeHJbO%2B
> > >
> > NF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium
> > =email&u
> > > tm_source=footer [15]
> > > mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [16]
> > > https://groups.google.com/d/msgid/pandoc-
> > discuss/YqtNZpy71u2Ud39K%40lo
> > > calhost [17] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> > > [18]
> > > https://groups.google.com/d/msgid/pandoc-
> > discuss/CAMwawgMt32uLCRXDqwxp
> > >
> > udMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com?utm_medium=emai
> > l&utm_s
> > > ource=footer
> >
> > --
> > 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/YqxOI1fX2hiBA3YB%40localhost.
>
> --
> 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/cb27f08f1f8244119dc1865f9b655618%40unibe.ch
> .
>

-- 
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/CADAJKhDacaODB6UtLGqjev%3D638rW33ENyLJnWX_b4xrwvcp2uw%40mail.gmail.com.

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

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

* Re: AW: Experimenting with pandoc module using just Lua
       [not found]                   ` <cb27f08f1f8244119dc1865f9b655618-NSENcxR/0n0@public.gmane.org>
  2022-06-17 15:35                     ` BPJ
@ 2022-06-17 17:34                     ` John MacFarlane
  1 sibling, 0 replies; 10+ messages in thread
From: John MacFarlane @ 2022-06-17 17:34 UTC (permalink / raw)
  To: denis.maier-NSENcxR/0n0, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


You can achieve this with a defaults file containing

---
input: []
...

Manual: "The value of input-files may be left empty to indicate input from stdin, and it can be an empty sequence [] for no input."

<denis.maier-NSENcxR/0n0@public.gmane.org> writes:

> IDK if the use case is common enough to warant a new command line parameter...
>
> But, what about a new option like this?
>
> `pandoc -L build.lua --no-input`
>
> The example `echo '' | pandoc` works with Powershell, but not with cmd. There you'll get the result:
> <p>ÔÇÖÔÇÖ</p>
>
> Don't know about bash or other shells.
>
> Denis
>
>
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-
>> discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Bastien DUMONT
>> Gesendet: Freitag, 17. Juni 2022 11:49
>> An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> Betreff: Re: Experimenting with pandoc module using just Lua
>> 
>> You need to supply an empty input to pandoc. In Powershell, you can type
>> `echo '' | pandoc -L build.lua`.
>> 
>> Le Friday 17 June 2022 à 11:38:11AM, A A a écrit :
>> > Hi Bastien,
>> >
>> > Thanks, that's a bit more like what I'm looking for.
>> >
>> > However, when I try to compile in Powershell using `pandoc -L
>> > build.lua` I get no output and the command prompt just kind of hangs there
>> until I press Ctrl+C.
>> >
>> > Pretty sure I'm doing something wrong but I'm not sure what....
>> >
>> > Regards,
>> >
>> > Amine
>> >
>> > On Thu, 16 Jun 2022 at 17:34, Bastien DUMONT
>> > <[1]bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
>> > wrote:
>> >
>> >     I don't think that you can do this directly from a Lua interpreter. This is
>> >     how I would build a document programmatically:
>> >
>> >     ```build.lua
>> >     function Pandoc(_)
>> >       return pandoc.Pandoc(
>> >         pandoc.Para({
>> >             pandoc.Str('Hello'),
>> >             pandoc.Space(),
>> >             pandoc.Emph(pandoc.Str('World')),
>> >             pandoc.Str('!')
>> >         })
>> >       )
>> >     end
>> >     ```
>> >
>> >     pandoc -L build.lua <<< '' outputs `<p>Hello <em>World</em>!</p>`.
>> >
>> >
>> >     Le Thursday 16 June 2022 à 05:28:29PM, A A a écrit :
>> >     > Hi Bastien,
>> >     >
>> >     > I'm afraid that doesn't really show me how I can build a document from
>> >     scratch
>> >     > similar to what is done in Haskell using a `Builder`.
>> >     >
>> >     > I really would like to avoid learning Haskell and stick to the Lua API.
>> >     But I'm
>> >     > getting the impression that use of the Lua API requires understanding
>> of
>> >     how
>> >     > the underlying Haskell objects interact.
>> >     >
>> >     > Regards,
>> >     >
>> >     > Amine
>> >     >
>> >     > On Thu, 16 Jun 2022 at 17:20, A A
>> <[1][2]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >     wrote:
>> >     >
>> >     >
>> >     >     I guess a better way to phrase my question is the following:
>> >     >
>> >     >     Is there a way to generate a document from scratch and
>> >     programmatically
>> >     >     using Lua and without using Haskell?
>> >     >
>> >     >     There is mention [2]here of a pandoc Builder class but I don’t see
>> >     its Lua
>> >     >     equivalent [3]here.
>> >     >
>> >     >
>> >     >
>> >     >     ---------- Forwarded message ---------
>> >     >     From: A A <[4][3]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >     >     Date: Thu, 16 Jun 2022 at 16:51
>> >     >     Subject: Experimenting with pandoc module using just Lua
>> >     >     To: <[5][4]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>> >     >
>> >     >
>> >     >
>> >     >     Dear All,
>> >     >
>> >     >     Is there a way to experiment with the objects pandoc module using
>> Lua
>> >     >     without having to write a filter/writer and go through the pandoc
>> >     CLI? I
>> >     >     would really like to just experiment with generating documents and
>> >     getting
>> >     >     familiar with the Lua API using just a Lua interpreter.
>> >     >
>> >     >     Regards,
>> >     >
>> >     >     Amine
>> >     >
>> >     > --
>> >     > 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 [6][5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> >     > To view this discussion on the web visit
>> [7][6]https://groups.google.com/
>> >     d/msgid/
>> >     > pandoc-discuss/
>> >     >
>> CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%[7
>> ]
>> >     40mail.gmail.com.
>> >     >
>> >     > References:
>> >     >
>> >     > [1] mailto:[8]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>> >     > [2] [9]https://pandoc.org/using-the-pandoc-api.html#builder
>> >     > [3] [10]https://pandoc.org/lua-filters.html#module-pandoc
>> >     > [4] mailto:[11]amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>> >     > [5] mailto:[12]pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> >     > [6] mailto:[13]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> >     > [7] [14]https://groups.google.com/d/msgid/pandoc-discuss/
>> >
>> CAMwawgOHE5QEeHJbO%2BNF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%4
>> 0mail.gmail.com?
>> >     utm_medium=email&utm_source=footer
>> >
>> >     --
>> >     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 [15]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> >     To view this discussion on the web visit
>> [16]https://groups.google.com/d/
>> >     msgid/pandoc-discuss/YqtNZpy71u2Ud39K%40localhost.
>> >
>> > --
>> > 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 [17]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> > To view this discussion on the web visit
>> > [18]https://groups.google.com/d/msgid/
>> > pandoc-discuss/
>> >
>> CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.g
>> mail.com.
>> >
>> > References:
>> >
>> > [1] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org
>> > [2] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>> > [3] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>> > [4] mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [5] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [6] https://groups.google.com/d/msgid/
>> > [7] http://40mail.gmail.com/
>> > [8] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>> > [9] https://pandoc.org/using-the-pandoc-api.html#builder
>> > [10] https://pandoc.org/lua-filters.html#module-pandoc
>> > [11] mailto:amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [12]
>> > mailto:pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [13] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [14]
>> > https://groups.google.com/d/msgid/pandoc-
>> discuss/CAMwawgOHE5QEeHJbO%2B
>> >
>> NF8QvViKas3P6Q6G7F%3DdS4YecTda1z1w%40mail.gmail.com?utm_medium
>> =email&u
>> > tm_source=footer [15]
>> > mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [16]
>> > https://groups.google.com/d/msgid/pandoc-
>> discuss/YqtNZpy71u2Ud39K%40lo
>> > calhost [17] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> > [18]
>> > https://groups.google.com/d/msgid/pandoc-
>> discuss/CAMwawgMt32uLCRXDqwxp
>> >
>> udMF92sBQVg_f2cNXvzV0T3rsyy5xA%40mail.gmail.com?utm_medium=emai
>> l&utm_s
>> > ource=footer
>> 
>> --
>> 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/YqxOI1fX2hiBA3YB%40localhost.
>
> -- 
> 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/cb27f08f1f8244119dc1865f9b655618%40unibe.ch.

-- 
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/m25ykz5h3e.fsf%40johnmacfarlane.net.


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

end of thread, other threads:[~2022-06-17 17:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 14:51 Experimenting with pandoc module using just Lua A A
     [not found] ` <CAMwawgOK_kc4oYvF50s8590tngEXRpiG=2hnh0PR2FNXskZhCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-06-16 15:19   ` Bastien DUMONT
2022-06-16 15:20   ` Fwd: " A A
2022-06-16 15:28     ` A A
     [not found]       ` <CAMwawgOHE5QEeHJbO+NF8QvViKas3P6Q6G7F=dS4YecTda1z1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-06-16 15:33         ` Bastien DUMONT
2022-06-17  9:38           ` A A
     [not found]             ` <CAMwawgMt32uLCRXDqwxpudMF92sBQVg_f2cNXvzV0T3rsyy5xA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-06-17  9:49               ` Bastien DUMONT
2022-06-17 10:07                 ` AW: " denis.maier-NSENcxR/0n0
     [not found]                   ` <cb27f08f1f8244119dc1865f9b655618-NSENcxR/0n0@public.gmane.org>
2022-06-17 15:35                     ` BPJ
2022-06-17 17:34                     ` AW: " John MacFarlane

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).