Neat outputs (in progress) - abseabse/peos GitHub Wiki
General information
There should be a function, that takes the output from tasker_tags() and tasker_get() and produces neat output.
The function should be customable to allow further development without complete rewrites of code.
TODO write examples.
Parameters
- Max overall width (in symbols);
- Max column width (in symbol);
- Column intervals.
Parameters are kept in a file options.txt in a separate group. If there is no such a file, system will use default parameters from code.
Input specification
- Dictionary;
- List of lists. First list contains column names, other lists contains rows of values.
Procedure (in case of a dictionary)
Step 0: Define minimal width of each column
the longest key and the longest value.
Step 1: Define normal width of each column
Step 1.0: Define profane width for each column (of the two)
If number is lesser than Max column width, use the number, otherwise use Max column width.
Step 1.1: Define actual width for both columns
If normal length + column interval <= Max overall width -- use profane width as actual width. Else take the widest column and shorten it in such a way, that Max overall width constraint is fulfilled.
Step 2: Print rows
(TODO write the algorithm)
Procedure (in case of list)
(TODO write the procedure. Currently implementing the first variant).