Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added the discount-config folder.

Run update.sh to run the discount condigure and make process.
This will update the dynamic headers included in this folder.
  • Loading branch information...
commit c11fd8a80d144c714b2c7c04e299061e18fdba73 1 parent 0537853
@mugginsoft mugginsoft authored
View
28 QLMarkdown.xcodeproj/project.pbxproj
@@ -33,6 +33,11 @@
8D576312048677EA00EA77CD /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB77B6FE84183AC02AAC07 /* main.c */; settings = {ATTRIBUTES = (); }; };
8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; };
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; };
+ AB40554314D008B3009A583A /* blocktags in Resources */ = {isa = PBXBuildFile; fileRef = AB40553E14D008B3009A583A /* blocktags */; };
+ AB40554414D008B3009A583A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = AB40553F14D008B3009A583A /* config.h */; };
+ AB40554514D008B3009A583A /* mkdio.h in Headers */ = {isa = PBXBuildFile; fileRef = AB40554014D008B3009A583A /* mkdio.h */; };
+ AB40554614D008B3009A583A /* README.markdown in Resources */ = {isa = PBXBuildFile; fileRef = AB40554114D008B3009A583A /* README.markdown */; };
+ AB40554714D008B3009A583A /* update.sh in Resources */ = {isa = PBXBuildFile; fileRef = AB40554214D008B3009A583A /* update.sh */; };
C86B05270671AA6E00DD9006 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C86B05260671AA6E00DD9006 /* CoreServices.framework */; };
F28CFBFD0A3EC0AF000ABFF5 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */; };
F28CFC030A3EC0C6000ABFF5 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */; };
@@ -67,6 +72,11 @@
61E3BCFA0870B4F2002186A0 /* GenerateThumbnailForURL.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = GenerateThumbnailForURL.m; sourceTree = "<group>"; };
8D576316048677EA00EA77CD /* QLMarkdown.qlgenerator */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QLMarkdown.qlgenerator; sourceTree = BUILT_PRODUCTS_DIR; };
8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ AB40553E14D008B3009A583A /* blocktags */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = blocktags; sourceTree = "<group>"; };
+ AB40553F14D008B3009A583A /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
+ AB40554014D008B3009A583A /* mkdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mkdio.h; sourceTree = "<group>"; };
+ AB40554114D008B3009A583A /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.markdown; sourceTree = "<group>"; };
+ AB40554214D008B3009A583A /* update.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update.sh; sourceTree = "<group>"; };
C86B05260671AA6E00DD9006 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = /System/Library/Frameworks/QuickLook.framework; sourceTree = "<absolute>"; };
@@ -92,6 +102,7 @@
089C166AFE841209C02AAC07 /* QLMarkdown */ = {
isa = PBXGroup;
children = (
+ AB40553D14D008B3009A583A /* discount-config */,
4446CFDF0F41898200BAC3F4 /* discount */,
08FB77AFFE84173DC02AAC07 /* Source */,
089C167CFE841241C02AAC07 /* Resources */,
@@ -167,6 +178,18 @@
path = discount;
sourceTree = "<group>";
};
+ AB40553D14D008B3009A583A /* discount-config */ = {
+ isa = PBXGroup;
+ children = (
+ AB40553E14D008B3009A583A /* blocktags */,
+ AB40553F14D008B3009A583A /* config.h */,
+ AB40554014D008B3009A583A /* mkdio.h */,
+ AB40554114D008B3009A583A /* README.markdown */,
+ AB40554214D008B3009A583A /* update.sh */,
+ );
+ path = "discount-config";
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -181,6 +204,8 @@
4446CFFE0F41899C00BAC3F4 /* markdown.h in Headers */,
4446D0000F41899C00BAC3F4 /* mkdio.h in Headers */,
4446D0060F41899C00BAC3F4 /* discount-wrapper.h in Headers */,
+ AB40554414D008B3009A583A /* config.h in Headers */,
+ AB40554514D008B3009A583A /* mkdio.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -238,6 +263,9 @@
files = (
8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */,
4446D0240F41AD4700BAC3F4 /* styles.css in Resources */,
+ AB40554314D008B3009A583A /* blocktags in Resources */,
+ AB40554614D008B3009A583A /* README.markdown in Resources */,
+ AB40554714D008B3009A583A /* update.sh in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
19 discount-config/README.markdown
@@ -0,0 +1,19 @@
+# [Discount][] instructions #
+
+This folder holds the files generated by discount's `configure.sh` script that are used by MarkdownLive and QLMarkdown.
+
+## Upgrading discount ##
+
+Discount is included as a [fake submodule][]. To upgrade or test other versions of discount, delete the files in the `discount` directory and clone a new local repository into it:
+
+ rm -rf discount/
+ git clone git://github.com/Orc/discount.git discount
+
+## Config files ##
+
+When discount is changed, regenerate the config files. The included `update.sh` script should do this automatically.
+
+If you want to update the files by hand, remove the "configuration for markdown, generated" comments at the head of `config.h` to avoid adding needless patches to the git history.
+
+[discount]:https://github.com/Orc/discount
+[fake submodule]:http://debuggable.com/posts/git-fake-submodules:4b563ee4-f3cc-4061-967e-0e48cbdd56cb
View
33 discount-config/blocktags
@@ -0,0 +1,33 @@
+static struct kw blocktags[] = {
+ { "P", 1, 0 },
+ { "DL", 2, 0 },
+ { "H1", 2, 0 },
+ { "H2", 2, 0 },
+ { "H3", 2, 0 },
+ { "H4", 2, 0 },
+ { "H5", 2, 0 },
+ { "H6", 2, 0 },
+ { "HR", 2, 1 },
+ { "OL", 2, 0 },
+ { "UL", 2, 0 },
+ { "BDO", 3, 0 },
+ { "DFN", 3, 0 },
+ { "DIV", 3, 0 },
+ { "MAP", 3, 0 },
+ { "PRE", 3, 0 },
+ { "WBR", 3, 0 },
+ { "XMP", 3, 0 },
+ { "NOBR", 4, 0 },
+ { "STYLE", 5, 0 },
+ { "TABLE", 5, 0 },
+ { "CENTER", 6, 0 },
+ { "IFRAME", 6, 0 },
+ { "OBJECT", 6, 0 },
+ { "SCRIPT", 6, 0 },
+ { "ADDRESS", 7, 0 },
+ { "LISTING", 7, 0 },
+ { "PLAINTEXT", 9, 0 },
+ { "BLOCKQUOTE", 10, 0 },
+};
+
+#define NR_blocktags 29
View
24 discount-config/config.h
@@ -0,0 +1,24 @@
+#ifndef __AC_MARKDOWN_D
+#define __AC_MARKDOWN_D 1
+
+
+#define OS_DARWIN 1
+#define USE_DISCOUNT_DL 1
+#define DWORD unsigned int
+#define WORD unsigned short
+#define BYTE unsigned char
+#define HAVE_PWD_H 1
+#define HAVE_GETPWUID 1
+#define HAVE_SRANDOM 1
+#define INITRNG(x) srandom((unsigned int)x)
+#define HAVE_BZERO 1
+#define HAVE_RANDOM 1
+#define COINTOSS() (random()&1)
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_FCHDIR 1
+#define TABSTOP 4
+#define PATH_FIND "/usr/bin/find"
+#define PATH_SED "/usr/bin/sed"
+
+#endif/* __AC_MARKDOWN_D */
View
109 discount-config/mkdio.h
@@ -0,0 +1,109 @@
+#ifndef _MKDIO_D
+#define _MKDIO_D
+
+#include <stdio.h>
+
+typedef void MMIOT;
+
+typedef unsigned int mkd_flag_t;
+
+/* line builder for markdown()
+ */
+MMIOT *mkd_in(FILE*,mkd_flag_t); /* assemble input from a file */
+MMIOT *mkd_string(const char*,int,mkd_flag_t); /* assemble input from a buffer */
+
+void mkd_basename(MMIOT*,char*);
+
+void mkd_initialize();
+void mkd_with_html5_tags();
+void mkd_shlib_destructor();
+
+/* compilation, debugging, cleanup
+ */
+int mkd_compile(MMIOT*, mkd_flag_t);
+int mkd_cleanup(MMIOT*);
+
+/* markup functions
+ */
+int mkd_dump(MMIOT*, FILE*, int, char*);
+int markdown(MMIOT*, FILE*, mkd_flag_t);
+int mkd_line(char *, int, char **, mkd_flag_t);
+typedef int (*mkd_sta_function_t)(const int,const void*);
+void mkd_string_to_anchor(char *, int, mkd_sta_function_t, void*, int);
+int mkd_xhtmlpage(MMIOT*,int,FILE*);
+
+/* header block access
+ */
+char* mkd_doc_title(MMIOT*);
+char* mkd_doc_author(MMIOT*);
+char* mkd_doc_date(MMIOT*);
+
+/* compiled data access
+ */
+int mkd_document(MMIOT*, char**);
+int mkd_toc(MMIOT*, char**);
+int mkd_css(MMIOT*, char **);
+int mkd_xml(char *, int, char **);
+
+/* write-to-file functions
+ */
+int mkd_generatehtml(MMIOT*,FILE*);
+int mkd_generatetoc(MMIOT*,FILE*);
+int mkd_generatexml(char *, int,FILE*);
+int mkd_generatecss(MMIOT*,FILE*);
+#define mkd_style mkd_generatecss
+int mkd_generateline(char *, int, FILE*, mkd_flag_t);
+#define mkd_text mkd_generateline
+
+/* url generator callbacks
+ */
+typedef char * (*mkd_callback_t)(const char*, const int, void*);
+typedef void (*mkd_free_t)(char*, void*);
+
+void mkd_e_url(void *, mkd_callback_t);
+void mkd_e_flags(void *, mkd_callback_t);
+void mkd_e_free(void *, mkd_free_t );
+void mkd_e_data(void *, void *);
+
+/* version#.
+ */
+extern char markdown_version[];
+void mkd_mmiot_flags(FILE *, MMIOT *, int);
+void mkd_flags_are(FILE*, mkd_flag_t, int);
+
+void mkd_ref_prefix(MMIOT*, char*);
+
+
+/* special flags for markdown() and mkd_text()
+ */
+#define MKD_NOLINKS 0x00000001 /* don't do link processing, block <a> tags */
+#define MKD_NOIMAGE 0x00000002 /* don't do image processing, block <img> */
+#define MKD_NOPANTS 0x00000004 /* don't run smartypants() */
+#define MKD_NOHTML 0x00000008 /* don't allow raw html through AT ALL */
+#define MKD_STRICT 0x00000010 /* disable SUPERSCRIPT, RELAXED_EMPHASIS */
+#define MKD_TAGTEXT 0x00000020 /* process text inside an html tag; no
+ * <em>, no <bold>, no html or [] expansion */
+#define MKD_NO_EXT 0x00000040 /* don't allow pseudo-protocols */
+#define MKD_NOEXT MKD_NO_EXT /* ^^^ (aliased for user convenience) */
+#define MKD_CDATA 0x00000080 /* generate code for xml ![CDATA[...]] */
+#define MKD_NOSUPERSCRIPT 0x00000100 /* no A^B */
+#define MKD_NORELAXED 0x00000200 /* emphasis happens /everywhere/ */
+#define MKD_NOTABLES 0x00000400 /* disallow tables */
+#define MKD_NOSTRIKETHROUGH 0x00000800 /* forbid ~~strikethrough~~ */
+#define MKD_TOC 0x00001000 /* do table-of-contents processing */
+#define MKD_1_COMPAT 0x00002000 /* compatibility with MarkdownTest_1.0 */
+#define MKD_AUTOLINK 0x00004000 /* make http://foo.com link even without <>s */
+#define MKD_SAFELINK 0x00008000 /* paranoid check for link protocol */
+#define MKD_NOHEADER 0x00010000 /* don't process header blocks */
+#define MKD_TABSTOP 0x00020000 /* expand tabs to 4 spaces */
+#define MKD_NODIVQUOTE 0x00040000 /* forbid >%class% blocks */
+#define MKD_NOALPHALIST 0x00080000 /* forbid alphabetic lists */
+#define MKD_NODLIST 0x00100000 /* forbid definition lists */
+#define MKD_EXTRA_FOOTNOTE 0x00200000 /* enable markdown extra-style footnotes */
+#define MKD_EMBED MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT
+
+/* special flags for mkd_in() and mkd_string()
+ */
+
+
+#endif/*_MKDIO_D*/
View
38 discount-config/update.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+status_msg () {
+ echo -e "\033[1m$1\033[0m"
+}
+
+error_msg () {
+ echo -e "\033[31m$1\033[0m" >&2
+ tput sgr0
+}
+
+status_msg "Running configure.sh..."
+
+cd `dirname $0`/../discount/
+./configure.sh
+
+# make the blocktags
+make blocktags
+
+status_msg "Copying important files..."
+
+if head -n 1 config.h | grep -q "^/\*$"; then
+ # remove generated comments in config.h
+ sed '1,/^ *\*\/ *$/ { d; }' <config.h >../discount-config/config.h && echo 'config.h'
+else
+ cp config.h ../discount-config/config.h && echo 'config.h'
+ error_msg "Can't locate config.h comments!"
+ error_msg "Check the diff before committing (and fix this script if you can)"
+fi
+cp mkdio.h ../discount-config/mkdio.h && echo 'mkdio.h'
+cp blocktags ../discount-config/blocktags && echo 'blocktags'
+
+status_msg "Clean files from working directory..."
+
+# clean the working directory of generated files and folders
+git clean -f -d
+
+status_msg "Done!"
Please sign in to comment.
Something went wrong with that request. Please try again.