/* --pdf: Also render PDF output. */
static int render_pdf;
+/* --csv: Also render CSV output. */
+static int render_csv;
+
/* ASCII driver, for ASCII driver test mode. */
static struct output_driver *ascii_driver;
table = tables[n_tables - 1];
if (transpose)
table = table_transpose (table);
- table_item_submit (table_item_create (table, NULL));
+ table_item_submit (table_item_create (table, NULL, NULL));
}
else
draw (input);
}
#endif
+ /* Render to <base>.csv. */
+ if (render_csv)
+ {
+ string_map_clear (&options);
+ string_map_insert_nocopy (&options, xstrdup ("output-file"),
+ xasprintf ("%s.csv", output_base));
+ driver = output_driver_create (&options);
+ if (driver == NULL)
+ exit (EXIT_FAILURE);
+ output_driver_register (driver);
+ }
+
/* Render to <base>.odt. */
string_map_replace_nocopy (&options, xstrdup ("output-file"),
xasprintf ("%s.odt", output_base));
{"no-txt", no_argument, &render_txt, 0},
{"no-stdout", no_argument, &render_stdout, 0},
{"pdf", no_argument, &render_pdf, 1},
+ {"csv", no_argument, &render_csv, 1},
{"output", required_argument, NULL, 'o'},
{"help", no_argument, NULL, OPT_HELP},
{NULL, 0, NULL, 0},
default:
error (1, 0, "unexpected subtable modifier \"%c\"", *text);
}
- tab_subtable (tab, c, r, c + cs - 1, r + rs - 1, opt, table);
+ tab_subtable (tab, c, r, c + cs - 1, r + rs - 1, opt,
+ table_item_create (table, NULL, NULL));
}
else
- tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt, text);
+ {
+ char *pos = text;
+ char *content;
+ int i;
+
+ for (i = 0; (content = strsep (&pos, "#")) != NULL; i++)
+ if (!i)
+ tab_joint_text (tab, c, r, c + cs - 1, r + rs - 1, opt,
+ content);
+ else
+ tab_footnote (tab, c, r, "%s", content);
+ }
}
return &tab->table;