1 /*
2  * marker-markdown.h
3  *
4  * Copyright (C) 2017 - 2018 Fabio Colacio
5  *
6  * Marker is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public License as
8  * published by the Free Software Foundation; either version 3 of the
9  * License, or (at your option) any later version.
10  *
11  * Marker is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with Marker; see the file LICENSE.md. If not,
18  * see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef __MARKER_MARKDOWN_H__
23 #define __MARKER_MARKDOWN_H__
24 
25 #include <stddef.h>
26 #include "scidown/src/document.h"
27 
28 typedef enum {
29   MATHJS_OFF,
30   MATHJS_NET,
31   MATHJS_LOCAL
32 } MarkerMathJSMode;
33 
34 typedef enum{
35   HIGHLIGHT_OFF,
36   HIGHLIGHT_NET,
37   HIGHLIGHT_LOCAL
38 } MarkerHighlightMode;
39 
40 typedef enum{
41   MERMAID_OFF,
42   MERMAID_NET,
43   MERMAID_LOCAL
44 } MarkerMermaidMode;
45 
46 char                *marker_markdown_css                         (const char         *stylesheet_location);
47 char                *marker_markdown_scidown_css                 ();
48 
49 char                *marker_markdown_to_html                     (const char         *markdown,
50                                                                   size_t              size,
51                                                                   char               *base_folder,
52                                                                   MarkerMathJSMode     katex_mode,
53                                                                   MarkerHighlightMode highlight_mode,
54                                                                   MarkerMermaidMode   mermaid_mode,
55                                                                   const char         *stylesheet_location,
56                                                                   int                 cursor_position);
57 
58 char                *marker_markdown_to_html_with_css_inline     (const char         *markdown,
59                                                                   size_t              size,
60                                                                   char               *base_folder,
61                                                                   MarkerMathJSMode     katex_mode,
62                                                                   MarkerHighlightMode highlight_mode,
63                                                                   MarkerMermaidMode   mermaid_mode,
64                                                                   const char         *stylesheet_location,
65                                                                   int                 cursor_position);
66 
67 char                *marker_markdown_to_latex                    (const char         *markdown,
68                                                                   size_t              size,
69                                                                   char               *base_folder,
70                                                                   MarkerMathJSMode     katex_mode,
71                                                                   MarkerHighlightMode highlight_mode,
72                                                                   MarkerMermaidMode   mermaid_mode,
73                                                                   const char         *stylesheet_location);
74 
75 void                 marker_markdown_to_html_file                (const char         *markdown,
76                                                                   size_t              size,
77                                                                   char               *base_folder,
78                                                                   MarkerMathJSMode     katex_mode,
79                                                                   MarkerHighlightMode highlight_mode,
80                                                                   MarkerMermaidMode   mermaid_mode,
81                                                                   const char         *stylesheet_location,
82                                                                   const char         *filepath);
83 
84 void                 marker_markdown_to_html_file_with_css_inline(const char         *markdown,
85                                                                   size_t              size,
86                                                                   char               *base_folder,
87                                                                   MarkerMathJSMode     katex_mode,
88                                                                   MarkerHighlightMode highlight_mode,
89                                                                   MarkerMermaidMode   mermaid_mode,
90                                                                   const char         *stylesheet_location,
91                                                                   const char         *filepath);
92 
93 void                 marker_markdown_to_latex_file               (const char         *markdown,
94                                                                   size_t              size,
95                                                                   char               *base_folder,
96                                                                   MarkerMathJSMode     katex_mode,
97                                                                   MarkerHighlightMode highlight_mode,
98                                                                   MarkerMermaidMode   mermaid_mode,
99                                                                   const char         *filepath);
100 
101 metadata           *marker_markdown_metadata                     (const char         *markdown,
102                                                                   size_t              size);
103 
104 #endif
105