123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- #ifndef __LATEX__
- #define __LATEX__
- #include <stdbool.h>
- #include <time.h>
- #include <hoedown/document.h>
- #include <hoedown/buffer.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- /*********
- * TYPES *
- *********/
- struct hoedown_latex_title_data {
- char* title;
- char* author;
- char* date;
- bool date_given;
- };
- typedef struct hoedown_latex_title_data hoedown_latex_title_data;
- struct hoedown_latex_renderer_state {
- void *opaque;
- hoedown_latex_title_data titledata;
- bool use_minted;
- int column_number;
- };
- typedef struct hoedown_latex_renderer_state hoedown_latex_renderer_state;
- typedef struct latex_character_escape {
- char special;
- char* repl;
- } latex_character_escape;
- /*************
- * CONSTANTS *
- *************/
- static const latex_character_escape escapes[] = {
- {'\\', "\\backslash"},
- {'&', "\\&"},
- {'#', "\\#"},
- {'_', "\\_"},
- {'%', "\\%"},
- {'~', "$\\sim$"},
- {'{', "$\\{$"},
- {'}', "$\\}$"},
- {'^', "$\\wedge$"}
- };
- /* Partial list of languages supported by minted. */
- static const char* pygment_langs[] = {
- "ActionScript",
- "Ada",
- "ANTLR",
- "AppleScript",
- "Assembly",
- "Asymptote",
- "Awk",
- "Befunge",
- "Boo",
- "BrainFuck",
- "C",
- "C++",
- "C#",
- "Clojure",
- "CoffeeScript",
- "ColdFusion",
- "Common Lisp",
- "Coq",
- "Cryptol",
- "Cython",
- "D",
- "Dart",
- "Delphi",
- "Dylan",
- "Erlang",
- "Factor",
- "Fancy",
- "Fortran",
- "F#",
- "GAP",
- "Gherkin",
- "Groovy",
- "Haskell",
- "IDL",
- "Io",
- "Java",
- "JavaScript",
- "Lasso",
- "LLVM",
- "Logtalk",
- "Lua",
- "Matlab",
- "MiniD",
- "Modelica",
- "Modula-2",
- "MuPad",
- "Nemerle",
- "Nimrod",
- "Objective-C",
- "Objective-J",
- "Octave",
- "OCaml",
- "PHP",
- "Perl",
- "PovRay",
- "PostScript",
- "PowerShell",
- "Prolog",
- "Python",
- "REBOL",
- "Red",
- "Redcode",
- "Ruby",
- "Rust",
- "S",
- "S-Plus",
- "R",
- "Scala",
- "Scheme",
- "Scilab",
- "Smalltalk",
- "SNOBOL",
- "Tcl",
- "Vala",
- "Verilog",
- "VHDL",
- "XQuery",
- "Zephir",
- "Cheetah",
- "Django",
- "Jinja",
- "ERB",
- "Genshi",
- "JSP",
- "Myghty",
- "Mako",
- "Smarty",
- "Tea",
- "Bash",
- "BBCode",
- "CMake",
- "CSS",
- "Diff",
- "DTD",
- "Gnuplot",
- "Groff",
- "HTML",
- "INI",
- "IRC",
- "Makefiles",
- "MoinMoin",
- "Trac",
- "MySQL",
- "Nginx",
- "POV-Ray",
- "Ragel",
- "Redcode",
- "ReST",
- "Robot",
- "SQL",
- "SQLite",
- "Squid",
- "TeX",
- "tcsh",
- "Vim",
- "XML",
- "XSLT",
- "YAML"
- };
- /*************
- * FUNCTIONS *
- *************/
- /* hoedown_latex_renderer_new: allocates a regular LaTeX renderer */
- hoedown_renderer *hoedown_latex_renderer_new(hoedown_latex_title_data* td, bool mint)
- __attribute__ ((malloc));
- /* hoedown_latex_renderer_free: deallocate a LaTeX renderer */
- void hoedown_latex_renderer_free(hoedown_renderer * renderer);
- void hoedown_render(FILE* fp, hoedown_latex_title_data* td, bool mint);
- void free_title_data(hoedown_latex_title_data* td);
- #ifdef __cplusplus
- }
- #endif
- #endif /** __LATEX__ **/
|