You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add spairs() to the logging namespace, and update docs accordingly
Also fix some bugs:
1. Improve logic to ignore functions in pandoc objects (they were
confusing attribute-counting logic).
2. Fix bug that affected reporting in (rare) cases where objects
have both numeric and non-numeric keys.
3. Avoid passing values to string.format(). This was previously
done with the %q formatting string, but this didn't work with
multi-byte characters.
* Spaces are replaced with periods, e.g., `pandoc Row` becomes `pandoc.Row`
106
108
*`Inline` and `Block` are replaced with the corresponding `tag` value, e.g. `Emph` or `Table`
107
109
110
+
## logging.spairs(list [, comp])
111
+
112
+
Like `pairs()` but with sorted keys. Keys are converted to strings and sorted
113
+
using `table.sort(keys, comp)` so by default they're visited in alphabetical
114
+
order.
115
+
108
116
## logging.dump(value [, maxlen])
109
117
110
118
Returns a pandoc-aware string representation of `value`, which can be an arbitrary lua object.
@@ -113,15 +121,16 @@ The returned string is a single line if not longer than `maxlen` (default `70`),
113
121
114
122
Map keys are sorted alphabetically in order to ensure that output is repeatable.
115
123
116
-
117
-
118
-
See the *Getting started* section for examples, and note that
124
+
See the *Getting started* section for examples.
119
125
120
126
## logging.output(...)
121
127
122
128
Pass each argument to `logging.dump()` and output the results to `stderr`, separated by single spaces and terminated (if necessary) with a newline.
123
129
124
-
Note: Actually (as a slight optimization) only `table` and `userdata` arguments are passed to `logging.dump()`. Other arguments are passed to the built-in `tostring()` function.
130
+
Note: Only `table` and `userdata` arguments are passed to
131
+
`logging.dump()`. Other arguments are passed to the built-in `tostring()`
132
+
function. This is partly an optimization and partly to prevent string arguments
0 commit comments