summaryrefslogtreecommitdiff
path: root/src/cmark.h
blob: 07cee1439e40a57b5307017267dc804763943ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _CMARK_H_
#define _CMARK_H_

#include <stdbool.h>
#include <stdio.h>
#include "buffer.h"
#include "ast.h"

#ifdef __cplusplus
extern "C" {
#endif

#define CMARK_VERSION "0.1"
#define CMARK_CODE_INDENT 4

#define CMARK_MAX_LINK_LABEL_LENGTH 1000

cmark_node_block *cmark_parse_document(const unsigned char *buffer, size_t len);
cmark_node_block *cmark_parse_file(FILE *f);

void cmark_debug_print(cmark_node_block *root);
void cmark_render_html(cmark_strbuf *html, cmark_node_block *root);

unsigned char *cmark_markdown_to_html(unsigned char *text, int len);

#ifndef CMARK_NO_SHORT_NAMES
  #define VERSION                   CMARK_VERSION
  #define CODE_INDENT               CMARK_CODE_INDENT
  #define MAX_LINK_LABEL_LENGTH     CMARK_MAX_LINK_LABEL_LENGTH
#endif

#ifdef __cplusplus
}
#endif

#endif