Skip to content

Commit

Permalink
Add Markdown support for ODF
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher committed Apr 3, 2011
1 parent 11d6864 commit 0942756
Show file tree
Hide file tree
Showing 3 changed files with 366 additions and 2 deletions.
4 changes: 3 additions & 1 deletion markdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main(int argc, char * argv[]) {
g_option_group_add_entries (ext_group, ext_entries);
g_option_context_add_group (context, ext_group);
g_option_context_set_description (context, "Converts text in specified files (or stdin) from markdown to FORMAT.\n"
"Available FORMATs: html, latex, groff-mm");
"Available FORMATs: html, latex, groff-mm, odf");
if (!g_option_context_parse (context, &argc, &argv, &error)) {
g_print ("option parsing failed: %s\n", error->message);
exit (1);
Expand Down Expand Up @@ -136,6 +136,8 @@ int main(int argc, char * argv[]) {
output_format = LATEX_FORMAT;
else if (strcmp(opt_to, "groff-mm") == 0)
output_format = GROFF_MM_FORMAT;
else if (strcmp(opt_to, "odf") == 0)
output_format = ODF_FORMAT;
else {
fprintf(stderr, "%s: Unknown output format '%s'\n", progname, opt_to);
exit(EXIT_FAILURE);
Expand Down
3 changes: 2 additions & 1 deletion markdown_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ enum markdown_extensions {
enum markdown_formats {
HTML_FORMAT,
LATEX_FORMAT,
GROFF_MM_FORMAT
GROFF_MM_FORMAT,
ODF_FORMAT
};

GString * markdown_to_g_string(char *text, int extensions, int output_format);
Expand Down
Loading

0 comments on commit 0942756

Please sign in to comment.