1 #if !defined( PARSER_H )
5 * Functions necessary to parse a file and transform its content into
6 * a deck of slides containing lines. All based on markdown formating
8 * Copyright (C) 2014 Michael Goehler
10 * This file is part of mdp.
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * function: markdown_load is the main function which reads a file handle,
27 * and initializes deck, slides and lines
28 * function: markdown_analyse which is used to identify line wide formating
30 * function: markdown_debug to print a report of the generated data structure
31 * function: adjust_line_length to calculate line length excluding markup
32 * function: is_utf8 detects multi-byte char
33 * function: length_utf8 calculates the amount of bytes used for a multi-byte
35 * function: next_nonblank, next_blank, next_word to calculate string offset's
45 #define UNORDERED_LIST_MAX_LEVEL 3
47 deck_t *markdown_load(FILE *input);
48 int markdown_analyse(cstring_t *text, int prev);
49 void markdown_debug(deck_t *deck, int debug);
50 void adjust_line_length(line_t *line);
51 bool is_utf8(char ch);
52 int length_utf8(char ch);
53 int next_nonblank(cstring_t *text, int i);
54 int prev_blank(cstring_t *text, int i);
55 int next_blank(cstring_t *text, int i);
56 int next_word(cstring_t *text, int i);
58 #endif // !defined( PARSER_H )