* Lua: DefinitionList contents
@ 2022-03-31 13:05 BPJ
[not found] ` <CADAJKhCkyNNtgSHX9hTkU6rgjoGu7d2TO0QOY=uO2_5Ug4ByPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: BPJ @ 2022-03-31 13:05 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1: Type: text/plain, Size: 1645 bytes --]
I need to be sure what DefinitionList.content looks like in Lua filters,
because the documentation does not tell.
I *think* that it is a list of lists where each sublist has two items
1. A list of inlines (term)
2. A list of lists of blocks (definitions)
Is that correct?
It may not be how they are represented in Haskell, but it would be very
helpful if in Lua each definition list item was an object where the term
and definitions were accessible both numerically and by name so that
`item[1] == item.term` and `item[2] == item.definitions`. I for one have it
easier to think about them by name.
The use case is to convert a table that has grown out of itself into a
definition list of definition lists so that
``````markdown
| | a | b | c
|---|---|---|---
| A | 1 | 2 | 3
| B | 4 | 5 | 6
| C | 7 | 8 | 9
``````
becomes
``````markdown
A
~ a
~ 1
b
~ 2
c
~ 3
B
~ a
~ 4
b
~ 5
c
~ 6
C
~ a
~ 7
b
~ 8
c
~ 9
``````
except that in reality there are six rather wide columns and about a dozen
rows in the table.
I'm mostly clear about how to do it except that I'm not sure how definition
lists are structured.
--
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/CADAJKhCkyNNtgSHX9hTkU6rgjoGu7d2TO0QOY%3DuO2_5Ug4ByPQ%40mail.gmail.com.
[-- Attachment #2: Type: text/html, Size: 3697 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Lua: DefinitionList contents
[not found] ` <CADAJKhCkyNNtgSHX9hTkU6rgjoGu7d2TO0QOY=uO2_5Ug4ByPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-03-31 13:09 ` Albert Krewinkel
0 siblings, 0 replies; 2+ messages in thread
From: Albert Krewinkel @ 2022-03-31 13:09 UTC (permalink / raw)
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw
BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> I need to be sure what DefinitionList.content looks like in Lua
> filters, because the documentation does not tell.
> I *think* that it is a list of lists where each sublist has two items
> 1. A list of inlines (term)
> 2. A list of lists of blocks (definitions)
> Is that correct?
👍
> It may not be how they are represented in Haskell, but it would be very
> helpful if in Lua each definition list item was an object where the
> term and definitions were accessible both numerically and by name so
> that `item[1] == item.term` and `item[2] == item.definitions`. I for
> one have it easier to think about them by name.
Fully agree. The newest HsLua version is, I believe, flexible enough to
accommodate this change in a backwards-compatible fashion. Please open
an issue on GitHub so we won't lose track.
--
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/87fsmyuux5.fsf%40zeitkraut.de.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-31 13:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31 13:05 Lua: DefinitionList contents BPJ
[not found] ` <CADAJKhCkyNNtgSHX9hTkU6rgjoGu7d2TO0QOY=uO2_5Ug4ByPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-03-31 13:09 ` 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).