public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* listAttributes not working
@ 2023-02-21 19:21 kperry-rhKcP+tiLR7by3iVrkZq2A
  0 siblings, 0 replies; 2+ messages in thread
From: kperry-rhKcP+tiLR7by3iVrkZq2A @ 2023-02-21 19:21 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

 

 

I  am either doing something wrong or the listAttributes are not working.
To make sure it was not my filter I did the following:

 

Pandoc -print-default-data-file sample.lua >sample.lua

 

Then I added a log function to sample.lua that was created by the above
command like:

 

local function log (msg)

file = io.open("log.txt","a")

file:write(msg .. "\n")

        file:close()

end

 

 

This was so I could see the output.  Yes it continues to append to log.txt
in the folder but it was just for simple testing.  

 

Finally I added this line to the ordered list function.

 

Log(attributes(items.listAttributes))

 

The attributes function comes in the sample.lua and is supposed to print all
the attributes you send it.  Well this says it is nil and errors.  I have
tried putting if statements and print statements of all kinds in and I can
not get the listAttributes to show up on items.  After doing some testing it
seems the items passed into orderedList is just a table of items so there
are no attributes on it.  

 

When I read the pandoc documents  it explains that an orderedList has
listAttributes.  How do I get them since the above test shows that I can't
get them from items in the orderedList function.  

 

As I said in a previous email I am able to get the style and start values
from json but not from the lua API.  I have to be doing something wrong
unless no one has tried this before and that would be shocking.

 

 

 

-- 
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/000001d94629%24b6cc3520%2424649f60%24%40blinksoft.com.

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

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

* RE: listAttributes not working
@ 2023-02-21 19:41 kperry-rhKcP+tiLR7by3iVrkZq2A
  0 siblings, 0 replies; 2+ messages in thread
From: kperry-rhKcP+tiLR7by3iVrkZq2A @ 2023-02-21 19:41 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

 

Ok I figured it out.  I can't find this anywhere and the sample.lua doesn't
show it.  I first tried changing the orderedList function to:

 

Function orderedList(items,listAttributes)

 

I did that as a guess.  Then it errored and told me listAttributes was a
number. When I tried to log it as an attribute list. .  I then guess that
the number would be the start.  So I changed the function to:

Function orderedList (items,start,style)

 

Then I was able to use the start and style.  

 

So if anyone else is trying to figure this out and finding the documents
very lacking The above function definition correctly gets the items, start
value, and style.  Maybe the sample.lua should be changed.

 

Ken

 

 

-- 
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/001401d9462c%2470b47400%24521d5c00%24%40blinksoft.com.

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

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

end of thread, other threads:[~2023-02-21 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21 19:21 listAttributes not working kperry-rhKcP+tiLR7by3iVrkZq2A
2023-02-21 19:41 kperry-rhKcP+tiLR7by3iVrkZq2A

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