2

I want to document a table using Ldoc. The documentation states that

enter image description here

Ok, this looks good but when I apply the formating to my table:

--- A table of mappings between NodOn remote scene codes and a text description.
nodonSceneTableVerbose = {
    [10]="Button 1 Single Press",   -- Button 1 Single Press
    [20]="Button 2 Single Press",   -- Button 2 Single Press
    [30]="Button 3 Single Press",   -- Button 3 Single Press
    [40]="Button 4 Single Press",   -- Button 4 Single Press
    [13]="Button 1 Double Press",   -- Button 1 Double Press
    [23]="Button 2 Double Press",   -- Button 2 Double Press
    [33]="Button 3 Double Press",   -- Button 3 Double Press
    [43]="Button 4 Double Press",   -- Button 4 Double Press
    [12]="Button 1 Hold Press",     -- Button 1 Hold Press
    [22]="Button 2 Hold Press",     -- Button 2 Hold Press
    [32]="Button 3 Hold Press",     -- Button 3 Hold Press
    [42]="Button 4 Hold Press",     -- Button 4 Hold Press
    [11]="Button 1 Hold Released",  -- Button 1 Hold Released
    [21]="Button 2 Hold Released",  -- Button 2 Hold Released
    [31]="Button 3 Hold Released",  -- Button 3 Hold Released
    [41]="Button 4 Hold Released"   -- Button 4 Hold Released
}

i get this result

enter image description here

which is not what I expected. The ldoc command produced no errors. What is wrong?

Fredrik Karlsson
  • 485
  • 8
  • 21

1 Answers1

1

So it turns out you can't use inferring more from code on tables which set elements as [10] and so on. Instead you can define the fields manually like this:

--- A table of mappings between NodOn remote scene codes and a text description.
-- @table nodonSceneTableVerbose
-- @field 10 Button 1 Single Press
-- @field 20 Button 2 Single Press
-- @field 30 Button 3 Single Press
-- @field 40 Button 4 Single Press
-- @field 13 Button 1 Double Press
-- @field 23 Button 2 Double Press
-- @field 33 Button 3 Double Press
-- @field 43 Button 4 Double Press
-- @field 12 Button 1 Hold Press
-- @field 22 Button 2 Hold Press
-- @field 32 Button 3 Hold Press
-- @field 42 Button 4 Hold Press
-- @field 11 Button 1 Hold Released
-- @field 21 Button 2 Hold Released
-- @field 31 Button 3 Hold Released
-- @field 41 Button 4 Hold Released
nodonSceneTableVerbose = {
    [10]="Button 1 Single Press",
    [20]="Button 2 Single Press",
    [30]="Button 3 Single Press",
    [40]="Button 4 Single Press",
    [13]="Button 1 Double Press",
    [23]="Button 2 Double Press",
    [33]="Button 3 Double Press",
    [43]="Button 4 Double Press",
    [12]="Button 1 Hold Press",
    [22]="Button 2 Hold Press",
    [32]="Button 3 Hold Press",
    [42]="Button 4 Hold Press",
    [11]="Button 1 Hold Released",
    [21]="Button 2 Hold Released",
    [31]="Button 3 Hold Released",
    [41]="Button 4 Hold Released" 
}
Jazzelhawk
  • 26
  • 2