Skip to content

Commit 51dd2ce

Browse files
committedMay 27, 2018
some steps to make it compilable on windows
1 parent 5989aeb commit 51dd2ce

File tree

5 files changed

+144
-7
lines changed

5 files changed

+144
-7
lines changed
 

‎build.io

+9-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ AddonBuilder clone do(
66
if(hasLib == nil,
77
writeln("No libmarkdown installed — attempting to compile and install")
88

9-
// Download
10-
uri := "https://github.com/Orc/discount.git"
11-
if(srcDir exists, srcDir remove; srcDir create, srcDir create)
12-
packageDownloader := Eerie PackageDownloader detect(uri, srcDir path)
13-
packageDownloader download
14-
159
// Compile
1610
if((platform == "windows") or (platform == "mingw"),
1711
// compile for windows
12+
appendLibSearchPath(Path with(Directory currentWorkingDirectory, "deps/w64/lib") asOSPath)
13+
appendHeaderSearchPath(Path with(Directory currentWorkingDirectory, "/deps/w64/include") asOSPath)
1814
,
15+
// Download
16+
uri := "https://github.com/Orc/discount.git"
17+
if(srcDir exists, srcDir remove; srcDir create, srcDir create)
18+
packageDownloader := Eerie PackageDownloader detect(uri, srcDir path)
19+
packageDownloader download
20+
1921
Eerie sh("cd #{srcDir path} && ./configure.sh --shared --pkg-config && make && make install" interpolate)
2022
)
2123
)
@@ -26,7 +28,7 @@ AddonBuilder clone do(
2628
clean := method(
2729
resend
2830
if((platform == "windows") or (platform == "mingw"),
29-
// compile for windows
31+
"no clean up command for windows platform" println
3032
,
3133
System system("cd #{srcDir path} && make clean" interpolate)
3234
)

‎deps/w64/bin/markdown.exe

89.5 KB
Binary file not shown.

‎deps/w64/include/mkdio.h

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#ifndef _MKDIO_D
2+
#define _MKDIO_D
3+
4+
#include <stdio.h>
5+
6+
typedef void MMIOT;
7+
8+
typedef unsigned long mkd_flag_t;
9+
10+
/* line builder for markdown()
11+
*/
12+
MMIOT *mkd_in(FILE*,mkd_flag_t); /* assemble input from a file */
13+
MMIOT *mkd_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
14+
15+
/* line builder for github flavoured markdown
16+
*/
17+
MMIOT *gfm_in(FILE*,mkd_flag_t); /* assemble input from a file */
18+
MMIOT *gfm_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
19+
20+
void mkd_basename(MMIOT*,char*);
21+
22+
void mkd_initialize();
23+
void mkd_with_html5_tags();
24+
void mkd_shlib_destructor();
25+
26+
/* compilation, debugging, cleanup
27+
*/
28+
int mkd_compile(MMIOT*, mkd_flag_t);
29+
void mkd_cleanup(MMIOT*);
30+
31+
/* markup functions
32+
*/
33+
int mkd_dump(MMIOT*, FILE*, int, char*);
34+
int markdown(MMIOT*, FILE*, mkd_flag_t);
35+
int mkd_line(char *, int, char **, mkd_flag_t);
36+
typedef int (*mkd_sta_function_t)(const int,const void*);
37+
void mkd_string_to_anchor(char *, int, mkd_sta_function_t, void*, int);
38+
int mkd_xhtmlpage(MMIOT*,int,FILE*);
39+
40+
/* header block access
41+
*/
42+
char* mkd_doc_title(MMIOT*);
43+
char* mkd_doc_author(MMIOT*);
44+
char* mkd_doc_date(MMIOT*);
45+
46+
/* compiled data access
47+
*/
48+
int mkd_document(MMIOT*, char**);
49+
int mkd_toc(MMIOT*, char**);
50+
int mkd_css(MMIOT*, char **);
51+
int mkd_xml(char *, int, char **);
52+
53+
/* write-to-file functions
54+
*/
55+
int mkd_generatehtml(MMIOT*,FILE*);
56+
int mkd_generatetoc(MMIOT*,FILE*);
57+
int mkd_generatexml(char *, int,FILE*);
58+
int mkd_generatecss(MMIOT*,FILE*);
59+
#define mkd_style mkd_generatecss
60+
int mkd_generateline(char *, int, FILE*, mkd_flag_t);
61+
#define mkd_text mkd_generateline
62+
63+
/* url generator callbacks
64+
*/
65+
typedef char * (*mkd_callback_t)(const char*, const int, void*);
66+
typedef void (*mkd_free_t)(char*, void*);
67+
68+
void mkd_e_url(void *, mkd_callback_t);
69+
void mkd_e_flags(void *, mkd_callback_t);
70+
void mkd_e_free(void *, mkd_free_t );
71+
void mkd_e_data(void *, void *);
72+
73+
/* version#.
74+
*/
75+
extern char markdown_version[];
76+
void mkd_mmiot_flags(FILE *, MMIOT *, int);
77+
void mkd_flags_are(FILE*, mkd_flag_t, int);
78+
79+
void mkd_ref_prefix(MMIOT*, char*);
80+
81+
82+
/* special flags for markdown() and mkd_text()
83+
*/
84+
#define MKD_NOLINKS 0x00000001 /* don't do link processing, block <a> tags */
85+
#define MKD_NOIMAGE 0x00000002 /* don't do image processing, block <img> */
86+
#define MKD_NOPANTS 0x00000004 /* don't run smartypants() */
87+
#define MKD_NOHTML 0x00000008 /* don't allow raw html through AT ALL */
88+
#define MKD_STRICT 0x00000010 /* disable SUPERSCRIPT, RELAXED_EMPHASIS */
89+
#define MKD_TAGTEXT 0x00000020 /* process text inside an html tag; no
90+
* <em>, no <bold>, no html or [] expansion */
91+
#define MKD_NO_EXT 0x00000040 /* don't allow pseudo-protocols */
92+
#define MKD_NOEXT MKD_NO_EXT /* ^^^ (aliased for user convenience) */
93+
#define MKD_CDATA 0x00000080 /* generate code for xml ![CDATA[...]] */
94+
#define MKD_NOSUPERSCRIPT 0x00000100 /* no A^B */
95+
#define MKD_NORELAXED 0x00000200 /* emphasis happens /everywhere/ */
96+
#define MKD_NOTABLES 0x00000400 /* disallow tables */
97+
#define MKD_NOSTRIKETHROUGH 0x00000800 /* forbid ~~strikethrough~~ */
98+
#define MKD_TOC 0x00001000 /* do table-of-contents processing */
99+
#define MKD_1_COMPAT 0x00002000 /* compatibility with MarkdownTest_1.0 */
100+
#define MKD_AUTOLINK 0x00004000 /* make http://foo.com link even without <>s */
101+
#define MKD_SAFELINK 0x00008000 /* paranoid check for link protocol */
102+
#define MKD_NOHEADER 0x00010000 /* don't process header blocks */
103+
#define MKD_TABSTOP 0x00020000 /* expand tabs to 4 spaces */
104+
#define MKD_NODIVQUOTE 0x00040000 /* forbid >%class% blocks */
105+
#define MKD_NOALPHALIST 0x00080000 /* forbid alphabetic lists */
106+
#define MKD_NODLIST 0x00100000 /* forbid definition lists */
107+
#define MKD_EXTRA_FOOTNOTE 0x00200000 /* enable markdown extra-style footnotes */
108+
#define MKD_NOSTYLE 0x00400000 /* don't extract <style> blocks */
109+
#define MKD_NODLDISCOUNT 0x00800000 /* disable discount-style definition lists */
110+
#define MKD_DLEXTRA 0x01000000 /* enable extra-style definition lists */
111+
#define MKD_FENCEDCODE 0x02000000 /* enabled fenced code blocks */
112+
#define MKD_IDANCHOR 0x04000000 /* use id= anchors for TOC links */
113+
#define MKD_GITHUBTAGS 0x08000000 /* allow dash and underscore in element names */
114+
#define MKD_URLENCODEDANCHOR 0x10000000 /* urlencode non-identifier chars instead of replacing with dots */
115+
#define MKD_LATEX 0x40000000 /* handle embedded LaTeX escapes */
116+
#define MKD_EXPLICITLIST 0x80000000 /* don't combine numbered/bulletted lists */
117+
118+
#define MKD_EMBED MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT
119+
120+
/* special flags for mkd_in() and mkd_string()
121+
*/
122+
123+
124+
#endif/*_MKDIO_D*/

‎deps/w64/lib/libmarkdown.a

225 KB
Binary file not shown.

‎deps/w64/lib/pkgconfig/libmarkdown.pc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
prefix=C:/Users/Ales/Desktop/discount/build
2+
exec_prefix=C:/Users/Ales/Desktop/discount/build
3+
libdir=C:/Users/Ales/Desktop/discount/build/lib
4+
includedir=C:/Users/Ales/Desktop/discount/build/include
5+
6+
Name: libmarkdown
7+
Version: 2.2.4b2
8+
Description: C implementation of John Gruber's Markdown markup language
9+
10+
Libs: -L${libdir} -lmarkdown
11+
Cflags: -I${includedir}

0 commit comments

Comments
 (0)