Den fre 5 maj 2023 10:04ThomasH <therch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
Ah, ok, sorry, I've only come to Lua through Pandoc, so I'm often not aware of general Lua features. I will keep an eye open for the 'show' method.

T.

See 

https://www.lua.org/manual/5.4/manual.html

https://learnxinyminutes.com/docs/lua/

Note that the latter seems to fail to mention that the full syntax for long strings and comments includes balanced `=` characters between the brackets so that you can include double brackets with or without a lower number of `=` chars in the string, e.g.

``````lua
local foo = [===[ [==[ [=[ [[ foo ]] ]=] ]==] ]===]
``````

is a single string delimited by `[===[` and `]===]`

Also escapes like `\n` don't work in long strings.




On Friday, May 5, 2023 at 7:26:41 AM UTC+2 Albert Krewinkel wrote:

ThomasH <the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> I just wished that would have been more apparent from the docs.

The `tostring` function is the default Lua way to convert an object "to
a string in a human-readable format". Still, I made a mental note to add
better docs once we switch from a Haskell to a Lua representation as
`tostring` output.

The Haskell/native output will probably become available via show
methods, as in `block:show()`. This already works for Block elements,
but not for Inlines.


>> Albert Krewinkel <albert...@zeitkraut.de> writes:
>>
>> > The alternative is to use `pandoc.write`, e.g.:
>> >
>> > print(pandoc.write(pandoc.Pandoc {element}))
>>
>> The above is missing the second parameter:
>>
>> print(pandoc.write(pandoc.Pandoc {element}, 'native'))


--
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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/79a8dca6-9860-4109-b2e8-5841faa36cc0n%40googlegroups.com.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhCKdyaTdjEVzAzc6%2Bq9vDwGtbjLL_euCEP5G8GEcT9Diw%40mail.gmail.com.