From 7366c46e7fb7af448e5a28460f89fb1d11a7f53e Mon Sep 17 00:00:00 2001 From: Jacco Taal Date: Thu, 20 Mar 2014 08:13:09 +0100 Subject: [PATCH 1/4] added support for handling newlines. single newlines are changed into space character to support proper wordwrapping by uitextview --- grammar/MarkdownTokens.cpp | 1 + grammar/MarkdownTokens.h | 1 + grammar/markdown.grammar | 5 +- src/MarkdownTokenizer.m | 97 ++++++++++++++------------ src/MarkdownTokens.h | 1 + src/MarkdownTokens.m | 1 + src/NSAttributedStringMarkdownParser.m | 89 ++++++++++++++++------- 7 files changed, 124 insertions(+), 71 deletions(-) diff --git a/grammar/MarkdownTokens.cpp b/grammar/MarkdownTokens.cpp index 903c7c9..1f03e5a 100644 --- a/grammar/MarkdownTokens.cpp +++ b/grammar/MarkdownTokens.cpp @@ -27,5 +27,6 @@ const char* markdownnames[] = { "NEWLINE", "BULLETSTART", "MARKDOWNCODESPAN", + "WHITESPACE" "UNKNOWN" }; diff --git a/grammar/MarkdownTokens.h b/grammar/MarkdownTokens.h index b83b4e8..9ac8e15 100644 --- a/grammar/MarkdownTokens.h +++ b/grammar/MarkdownTokens.h @@ -30,6 +30,7 @@ typedef enum { MARKDOWNNEWLINE, MARKDOWNBULLETSTART, MARKDOWNCODESPAN, + MARKDOWNWHITESPACE, MARKDOWNUNKNOWN, } MarkdownParserCodes; diff --git a/grammar/markdown.grammar b/grammar/markdown.grammar index 434d577..9499716 100644 --- a/grammar/markdown.grammar +++ b/grammar/markdown.grammar @@ -16,6 +16,7 @@ header1 ^#{1,6}.* header2 .+\n[=-]+\n bulletstart ^[-]+[ ] codeline [ ] +spaces \s+ protocol (http|ftp)s?\:\/\/ subdomain {nmchar}\. @@ -50,7 +51,9 @@ nl \n|\r\n|\r|\f [ ]{2,}$ {markdownConsume(yytext, MARKDOWNNEWLINE, yyscanner);} [\n]{2,} {markdownConsume(yytext, MARKDOWNPARAGRAPH, yyscanner);} -[ \n\t\f] {markdownConsume(yytext, MARKDOWNUNKNOWN, yyscanner);} +[ ]{1,} {markdownConsume(yytext, MARKDOWNWHITESPACE, yyscanner);} +[ \n\t\f] {markdownConsume(yytext, MARKDOWNWHITESPACE, yyscanner);} + . {markdownConsume(yytext, MARKDOWNUNKNOWN, yyscanner);} %% diff --git a/src/MarkdownTokenizer.m b/src/MarkdownTokenizer.m index 62cb743..9ec353c 100644 --- a/src/MarkdownTokenizer.m +++ b/src/MarkdownTokenizer.m @@ -29,7 +29,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -67,7 +67,6 @@ typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -75,7 +74,6 @@ typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -106,6 +104,8 @@ #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -362,13 +362,13 @@ */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ + yyleng = (size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 15 -#define YY_END_OF_BUFFER 16 +#define YY_NUM_RULES 16 +#define YY_END_OF_BUFFER 17 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -378,11 +378,11 @@ }; static yyconst flex_int16_t yy_accept[311] = { 0, - 0, 0, 16, 14, 13, 13, 13, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 6, 14, 0, 0, - 12, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 17, 15, 14, 14, 13, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 6, 15, 0, 0, + 12, 13, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 0, 6, - 6, 10, 0, 0, 12, 11, 0, 1, 0, 1, + 6, 10, 0, 0, 12, 11, 13, 1, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 7, 0, 0, 0, 0, 0, 0, @@ -1005,6 +1005,10 @@ void markdownset_lineno (int line_number ,yyscan_t yyscanner ); +int markdownget_column (yyscan_t yyscanner ); + +void markdownset_column (int column_no ,yyscan_t yyscanner ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -1045,7 +1049,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1056,7 +1060,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1142,10 +1146,10 @@ register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 38 "markdown.grammar" +#line 39 "markdown.grammar" -#line 1128 "lex.markdown.c" +#line 1132 "lex.markdown.c" if ( !yyg->yy_init ) { @@ -1232,56 +1236,56 @@ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 40 "markdown.grammar" +#line 41 "markdown.grammar" {markdownConsume(yytext, MARKDOWNEM, yyscanner);} YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 41 "markdown.grammar" +#line 42 "markdown.grammar" {markdownConsume(yytext, MARKDOWNSTRONG, yyscanner);} YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 42 "markdown.grammar" +#line 43 "markdown.grammar" {markdownConsume(yytext, MARKDOWNSTRONGEM, yyscanner);} YY_BREAK case 4: YY_RULE_SETUP -#line 43 "markdown.grammar" +#line 44 "markdown.grammar" {markdownConsume(yytext, MARKDOWNSTRIKETHROUGH, yyscanner);} YY_BREAK case 5: YY_RULE_SETUP -#line 44 "markdown.grammar" +#line 45 "markdown.grammar" {markdownConsume(yytext, MARKDOWNCODESPAN, yyscanner);} YY_BREAK case 6: YY_RULE_SETUP -#line 45 "markdown.grammar" +#line 46 "markdown.grammar" {markdownConsume(yytext, MARKDOWNHEADER, yyscanner);} YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 46 "markdown.grammar" +#line 47 "markdown.grammar" {markdownConsume(yytext, MARKDOWNMULTILINEHEADER, yyscanner);} YY_BREAK case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 47 "markdown.grammar" +#line 48 "markdown.grammar" {markdownConsume(yytext, MARKDOWNURL, yyscanner);} YY_BREAK case 9: YY_RULE_SETUP -#line 48 "markdown.grammar" +#line 49 "markdown.grammar" {markdownConsume(yytext, MARKDOWNHREF, yyscanner);} YY_BREAK case 10: YY_RULE_SETUP -#line 49 "markdown.grammar" +#line 50 "markdown.grammar" {markdownConsume(yytext, MARKDOWNBULLETSTART, yyscanner);} YY_BREAK case 11: @@ -1289,32 +1293,37 @@ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 51 "markdown.grammar" +#line 52 "markdown.grammar" {markdownConsume(yytext, MARKDOWNNEWLINE, yyscanner);} YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP -#line 52 "markdown.grammar" +#line 53 "markdown.grammar" {markdownConsume(yytext, MARKDOWNPARAGRAPH, yyscanner);} YY_BREAK case 13: -/* rule 13 can match eol */ YY_RULE_SETUP -#line 53 "markdown.grammar" -{markdownConsume(yytext, MARKDOWNUNKNOWN, yyscanner);} +#line 54 "markdown.grammar" +{markdownConsume(yytext, MARKDOWNWHITESPACE, yyscanner);} YY_BREAK case 14: +/* rule 14 can match eol */ YY_RULE_SETUP -#line 54 "markdown.grammar" -{markdownConsume(yytext, MARKDOWNUNKNOWN, yyscanner);} +#line 55 "markdown.grammar" +{markdownConsume(yytext, MARKDOWNWHITESPACE, yyscanner);} YY_BREAK case 15: YY_RULE_SETUP -#line 56 "markdown.grammar" +#line 57 "markdown.grammar" +{markdownConsume(yytext, MARKDOWNUNKNOWN, yyscanner);} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 59 "markdown.grammar" ECHO; YY_BREAK -#line 1297 "lex.markdown.c" +#line 1306 "lex.markdown.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1508,7 +1517,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); @@ -1644,6 +1653,7 @@ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 310); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -1696,7 +1706,7 @@ static int input (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( markdownwrap(yyscanner ) ) - return 0; + return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -1838,10 +1848,6 @@ void markdown_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) markdownfree((void *) b ,yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a markdownrestart() or at EOF. @@ -2051,8 +2057,8 @@ YY_BUFFER_STATE markdown_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to markdownlex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -2060,7 +2066,8 @@ YY_BUFFER_STATE markdown_scan_bytes (yyconst char * yybytes, yy_size_t _yybyte { YY_BUFFER_STATE b; char *buf; - yy_size_t n, i; + yy_size_t n; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2206,7 +2213,7 @@ void markdownset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "markdownset_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "markdownset_lineno called with no buffer" ); yylineno = line_number; } @@ -2221,7 +2228,7 @@ void markdownset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "markdownset_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "markdownset_column called with no buffer" ); yycolumn = column_no; } @@ -2433,7 +2440,7 @@ void markdownfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 56 "markdown.grammar" +#line 59 "markdown.grammar" diff --git a/src/MarkdownTokens.h b/src/MarkdownTokens.h index b83b4e8..9ac8e15 100644 --- a/src/MarkdownTokens.h +++ b/src/MarkdownTokens.h @@ -30,6 +30,7 @@ typedef enum { MARKDOWNNEWLINE, MARKDOWNBULLETSTART, MARKDOWNCODESPAN, + MARKDOWNWHITESPACE, MARKDOWNUNKNOWN, } MarkdownParserCodes; diff --git a/src/MarkdownTokens.m b/src/MarkdownTokens.m index 903c7c9..1f03e5a 100644 --- a/src/MarkdownTokens.m +++ b/src/MarkdownTokens.m @@ -27,5 +27,6 @@ "NEWLINE", "BULLETSTART", "MARKDOWNCODESPAN", + "WHITESPACE" "UNKNOWN" }; diff --git a/src/NSAttributedStringMarkdownParser.m b/src/NSAttributedStringMarkdownParser.m index 8dad7d4..0a47c8f 100644 --- a/src/NSAttributedStringMarkdownParser.m +++ b/src/NSAttributedStringMarkdownParser.m @@ -162,7 +162,7 @@ - (NSDictionary *)paragraphStyle { CGFloat firstLineHeadIndent = 15.0; CGFloat headIndent = 30.0; - CGFloat firstTabStop = 35.0; // width of your indent + CGFloat firstTabStop = 30.0; // width of your indent CGFloat lineSpacing = 0.45; #ifdef TARGET_OS_IPHONE @@ -172,6 +172,8 @@ - (NSDictionary *)paragraphStyle { style.paragraphSpacing = paragraphSpacing; style.paragraphSpacingBefore = paragraphSpacingBefore; style.firstLineHeadIndent = firstLineHeadIndent; + style.lineBreakMode = NSLineBreakByWordWrapping; + style.headIndent = headIndent; style.lineSpacing = lineSpacing; style.alignment = alignment; @@ -261,6 +263,27 @@ - (void)consumeToken:(int)token text:(char*)text { NSMutableDictionary* attributes = [NSMutableDictionary dictionary]; [attributes addEntriesFromDictionary:[self attributesForFont:self.topFont]]; + BOOL static addNewlineAndEatWhitespace = false; + BOOL static eatWhitespaceAfter = false; + if (addNewlineAndEatWhitespace) { + [_accum appendAttributedString:[[NSAttributedString alloc] initWithString:@"\n\n" attributes:attributes] ]; + + NSRange spacesRange = [textAsString rangeOfString:@"^\\s*" options:NSRegularExpressionSearch]; + + textAsString = [textAsString substringFromIndex:spacesRange.length]; + addNewlineAndEatWhitespace = false; + if (token == MARKDOWNWHITESPACE || token == MARKDOWNNEWLINE|| token == MARKDOWNPARAGRAPH) + token = MARKDOWNUNKNOWN; + } + if (eatWhitespaceAfter) { + NSRange spacesRange = [textAsString rangeOfString:@"^\\s*" options:NSRegularExpressionSearch]; + + textAsString = [textAsString substringFromIndex:spacesRange.length]; + if (token == MARKDOWNWHITESPACE || token == MARKDOWNNEWLINE || token == MARKDOWNPARAGRAPH) + token = MARKDOWNUNKNOWN; + eatWhitespaceAfter = false; + } + switch (token) { case MARKDOWNEM: { // * * textAsString = [textAsString substringWithRange:NSMakeRange(1, textAsString.length - 2)]; @@ -297,6 +320,7 @@ - (void)consumeToken:(int)token text:(char*)text { // We already appended the recursive parser's results in recurseOnString. textAsString = nil; + addNewlineAndEatWhitespace = true; } break; } @@ -314,20 +338,22 @@ - (void)consumeToken:(int)token text:(char*)text { // We already appended the recursive parser's results in recurseOnString. textAsString = nil; + addNewlineAndEatWhitespace = true; break; } case MARKDOWNPARAGRAPH: { - textAsString = @"\n\n"; - + textAsString = nil; //@"\n\n"; + addNewlineAndEatWhitespace = true; + if (_bulletStarts.count > 0) { // Treat nested bullet points as flat ones... - + // Finish off the previous dash and start a new one. NSInteger lastBulletStart = [[_bulletStarts lastObject] intValue]; [_bulletStarts removeLastObject]; - + [_accum addAttributes:[self paragraphStyle] - range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)]; + range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)]; } break; } @@ -341,11 +367,17 @@ - (void)consumeToken:(int)token text:(char*)text { [_bulletStarts removeLastObject]; [_accum addAttributes:[self paragraphStyle] - range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)]; + range:NSMakeRange(lastBulletStart, _accum.length - lastBulletStart)]; } [_bulletStarts addObject:@(_accum.length)]; - textAsString = @"•\t"; + textAsString = @"\n•\t"; + addNewlineAndEatWhitespace = false; + eatWhitespaceAfter = true; + break; + } + case MARKDOWNWHITESPACE: { + textAsString = @" "; break; } case MARKDOWNNEWLINE: { @@ -359,34 +391,41 @@ - (void)consumeToken:(int)token text:(char*)text { [_links addObject:link]; break; } - case MARKDOWNHREF: { // [Title] (url "tooltip") - NSTextCheckingResult *result = [hrefRegex() firstMatchInString:textAsString options:0 range:NSMakeRange(0, textAsString.length)]; + case MARKDOWNHREF: { // [Title] (url "tooltip") + NSTextCheckingResult *result = [hrefRegex() firstMatchInString:textAsString options:0 range:NSMakeRange(0, textAsString.length)]; - NSRange linkTitleRange = [result rangeAtIndex:1]; - NSRange linkURLRange = [result rangeAtIndex:2]; - NSRange tooltipRange = [result rangeAtIndex:5]; + NSRange linkTitleRange = [result rangeAtIndex:1]; + NSRange linkURLRange = [result rangeAtIndex:2]; + NSRange tooltipRange = [result rangeAtIndex:5]; - if (linkTitleRange.location != NSNotFound && linkURLRange.location != NSNotFound) { - NSAttributedStringMarkdownLink *link = [[NSAttributedStringMarkdownLink alloc] init]; + if (linkTitleRange.location != NSNotFound && linkURLRange.location != NSNotFound) { + NSAttributedStringMarkdownLink *link = [[NSAttributedStringMarkdownLink alloc] init]; - link.url = [NSURL URLWithString:[textAsString substringWithRange:linkURLRange]]; - link.range = NSMakeRange(_accum.length, linkTitleRange.length); + link.url = [NSURL URLWithString:[textAsString substringWithRange:linkURLRange]]; + link.range = NSMakeRange(_accum.length, linkTitleRange.length); - if (tooltipRange.location != NSNotFound) { - link.tooltip = [textAsString substringWithRange:tooltipRange]; - } + if (tooltipRange.location != NSNotFound) { + link.tooltip = [textAsString substringWithRange:tooltipRange]; + } - [_links addObject:link]; - textAsString = [textAsString substringWithRange:linkTitleRange]; - } - break; + [_links addObject:link]; + textAsString = [textAsString substringWithRange:linkTitleRange]; } + break; + } default: { break; } } - if (textAsString.length > 0) { + if (addNewlineAndEatWhitespace) { + [_accum appendAttributedString:[[NSAttributedString alloc] initWithString:@"\n\n" attributes:attributes] ]; + NSRange spacesRange = [textAsString rangeOfString:@"^\\s*" options:NSRegularExpressionSearch]; + + textAsString = [textAsString substringFromIndex:spacesRange.length]; + addNewlineAndEatWhitespace = false; + } + NSAttributedString* attributedString = [[NSAttributedString alloc] initWithString:textAsString attributes:attributes]; [_accum appendAttributedString:attributedString]; } From 69af42d23519a97bbebc9e1a9981e9d39e85792c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Payche=CC=80re?= Date: Mon, 31 Mar 2014 18:18:27 +0200 Subject: [PATCH 2/4] Fixed test of target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Paychère --- src/NSAttributedStringMarkdownParser.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NSAttributedStringMarkdownParser.m b/src/NSAttributedStringMarkdownParser.m index 0a47c8f..a603c76 100644 --- a/src/NSAttributedStringMarkdownParser.m +++ b/src/NSAttributedStringMarkdownParser.m @@ -165,7 +165,7 @@ - (NSDictionary *)paragraphStyle { CGFloat firstTabStop = 30.0; // width of your indent CGFloat lineSpacing = 0.45; -#ifdef TARGET_OS_IPHONE +#if TARGET_OS_IPHONE NSTextAlignment alignment = NSTextAlignmentLeft; NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; From 1836ab6606e2fdfa4aa0e4412fc02d9d2173f561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Payche=CC=80re?= Date: Mon, 31 Mar 2014 18:20:31 +0200 Subject: [PATCH 3/4] Create pod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replaced submodule by pod dependency - Created test project on OSX - Added a unit test to validate Signed-off-by: Stefan Paychère --- .gitmodules | 6 - .../MarkdownOSX.xcodeproj/project.pbxproj | 556 ++++++++++ .../MarkdownOSX/Base.lproj/MainMenu.xib | 680 +++++++++++++ .../AppIcon.appiconset/Contents.json | 58 ++ .../MarkdownOSX/MarkdownOSX/MDTAppDelegate.h | 15 + .../MarkdownOSX/MarkdownOSX/MDTAppDelegate.m | 18 + .../MarkdownOSX/MarkdownOSX-Info.plist | 34 + .../MarkdownOSX/MarkdownOSX-Prefix.pch | 9 + .../MarkdownOSX/en.lproj/Credits.rtf | 29 + .../MarkdownOSX/en.lproj/InfoPlist.strings | 2 + TestApps/MarkdownOSX/MarkdownOSX/main.m | 14 + .../MarkdownOSXTests-Info.plist | 22 + .../MarkdownOSXTests/MarkdownOSXTests.m | 76 ++ .../en.lproj/InfoPlist.strings | 2 + TestApps/MarkdownOSX/Podfile | 5 + TestApps/MarkdownOSX/Podfile.lock | 10 + .../Pods/BuildHeaders/fmemopen/fmemopen.h | 1 + .../Pods/Headers/fmemopen/fmemopen.h | 1 + TestApps/MarkdownOSX/Pods/Manifest.lock | 10 + .../Pods/Pods-acknowledgements.markdown | 3 + .../Pods/Pods-acknowledgements.plist | 29 + TestApps/MarkdownOSX/Pods/Pods-dummy.m | 5 + TestApps/MarkdownOSX/Pods/Pods-environment.h | 14 + .../Pods/Pods-fmemopen-Private.xcconfig | 5 + .../MarkdownOSX/Pods/Pods-fmemopen-dummy.m | 5 + .../MarkdownOSX/Pods/Pods-fmemopen-prefix.pch | 5 + .../MarkdownOSX/Pods/Pods-fmemopen.xcconfig | 0 TestApps/MarkdownOSX/Pods/Pods-resources.sh | 68 ++ TestApps/MarkdownOSX/Pods/Pods.xcconfig | 5 + .../Pods/Pods.xcodeproj/project.pbxproj | 962 ++++++++++++++++++ TestApps/MarkdownOSX/Pods/fmemopen/README.md | 49 + TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.c | 92 ++ TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.h | 52 + 33 files changed, 2836 insertions(+), 6 deletions(-) create mode 100644 TestApps/MarkdownOSX/MarkdownOSX.xcodeproj/project.pbxproj create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/Base.lproj/MainMenu.xib create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.h create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.m create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Info.plist create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Prefix.pch create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/en.lproj/Credits.rtf create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/en.lproj/InfoPlist.strings create mode 100644 TestApps/MarkdownOSX/MarkdownOSX/main.m create mode 100644 TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests-Info.plist create mode 100644 TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests.m create mode 100644 TestApps/MarkdownOSX/MarkdownOSXTests/en.lproj/InfoPlist.strings create mode 100644 TestApps/MarkdownOSX/Podfile create mode 100644 TestApps/MarkdownOSX/Podfile.lock create mode 120000 TestApps/MarkdownOSX/Pods/BuildHeaders/fmemopen/fmemopen.h create mode 120000 TestApps/MarkdownOSX/Pods/Headers/fmemopen/fmemopen.h create mode 100644 TestApps/MarkdownOSX/Pods/Manifest.lock create mode 100644 TestApps/MarkdownOSX/Pods/Pods-acknowledgements.markdown create mode 100644 TestApps/MarkdownOSX/Pods/Pods-acknowledgements.plist create mode 100644 TestApps/MarkdownOSX/Pods/Pods-dummy.m create mode 100644 TestApps/MarkdownOSX/Pods/Pods-environment.h create mode 100644 TestApps/MarkdownOSX/Pods/Pods-fmemopen-Private.xcconfig create mode 100644 TestApps/MarkdownOSX/Pods/Pods-fmemopen-dummy.m create mode 100644 TestApps/MarkdownOSX/Pods/Pods-fmemopen-prefix.pch create mode 100644 TestApps/MarkdownOSX/Pods/Pods-fmemopen.xcconfig create mode 100755 TestApps/MarkdownOSX/Pods/Pods-resources.sh create mode 100644 TestApps/MarkdownOSX/Pods/Pods.xcconfig create mode 100644 TestApps/MarkdownOSX/Pods/Pods.xcodeproj/project.pbxproj create mode 100644 TestApps/MarkdownOSX/Pods/fmemopen/README.md create mode 100644 TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.c create mode 100644 TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.h diff --git a/.gitmodules b/.gitmodules index 2d9ba3a..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +0,0 @@ -[submodule "fmemopen"] - path = fmemopen - url = git@github.com:jverkoey/fmemopen.git -[submodule "nimbus"] - path = nimbus - url = git://github.com/jverkoey/nimbus.git diff --git a/TestApps/MarkdownOSX/MarkdownOSX.xcodeproj/project.pbxproj b/TestApps/MarkdownOSX/MarkdownOSX.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c8fc174 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX.xcodeproj/project.pbxproj @@ -0,0 +1,556 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1CD5D64F9AC04BC0B3C08B8B /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA50B7B79A9E44ADBAD1DC62 /* libPods.a */; }; + F848D1D018E9C0C6009C0E35 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F848D1CF18E9C0C6009C0E35 /* Cocoa.framework */; }; + F848D1DA18E9C0C6009C0E35 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F848D1D818E9C0C6009C0E35 /* InfoPlist.strings */; }; + F848D1DC18E9C0C6009C0E35 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F848D1DB18E9C0C6009C0E35 /* main.m */; }; + F848D1E018E9C0C6009C0E35 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F848D1DE18E9C0C6009C0E35 /* Credits.rtf */; }; + F848D1E318E9C0C6009C0E35 /* MDTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F848D1E218E9C0C6009C0E35 /* MDTAppDelegate.m */; }; + F848D1E618E9C0C6009C0E35 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F848D1E418E9C0C6009C0E35 /* MainMenu.xib */; }; + F848D1E818E9C0C6009C0E35 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F848D1E718E9C0C6009C0E35 /* Images.xcassets */; }; + F848D1EF18E9C0C6009C0E35 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F848D1EE18E9C0C6009C0E35 /* XCTest.framework */; }; + F848D1F018E9C0C6009C0E35 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F848D1CF18E9C0C6009C0E35 /* Cocoa.framework */; }; + F848D1F818E9C0C6009C0E35 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F848D1F618E9C0C6009C0E35 /* InfoPlist.strings */; }; + F848D1FA18E9C0C6009C0E35 /* MarkdownOSXTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F848D1F918E9C0C6009C0E35 /* MarkdownOSXTests.m */; }; + F848D20A18E9C0FC009C0E35 /* MarkdownTokenizer.m in Sources */ = {isa = PBXBuildFile; fileRef = F848D20418E9C0FC009C0E35 /* MarkdownTokenizer.m */; }; + F848D20B18E9C0FC009C0E35 /* MarkdownTokens.m in Sources */ = {isa = PBXBuildFile; fileRef = F848D20618E9C0FC009C0E35 /* MarkdownTokens.m */; }; + F848D20C18E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F848D20918E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + F848D1F118E9C0C6009C0E35 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F848D1C418E9C0C5009C0E35 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F848D1CB18E9C0C6009C0E35; + remoteInfo = MarkdownOSX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 523E6D6887CB4C8C988734AB /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; + F848D1CC18E9C0C6009C0E35 /* MarkdownOSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarkdownOSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F848D1CF18E9C0C6009C0E35 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + F848D1D218E9C0C6009C0E35 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + F848D1D318E9C0C6009C0E35 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + F848D1D418E9C0C6009C0E35 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + F848D1D718E9C0C6009C0E35 /* MarkdownOSX-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MarkdownOSX-Info.plist"; sourceTree = ""; }; + F848D1D918E9C0C6009C0E35 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + F848D1DB18E9C0C6009C0E35 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + F848D1DD18E9C0C6009C0E35 /* MarkdownOSX-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MarkdownOSX-Prefix.pch"; sourceTree = ""; }; + F848D1DF18E9C0C6009C0E35 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + F848D1E118E9C0C6009C0E35 /* MDTAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MDTAppDelegate.h; sourceTree = ""; }; + F848D1E218E9C0C6009C0E35 /* MDTAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MDTAppDelegate.m; sourceTree = ""; }; + F848D1E518E9C0C6009C0E35 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + F848D1E718E9C0C6009C0E35 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + F848D1ED18E9C0C6009C0E35 /* MarkdownOSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MarkdownOSXTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F848D1EE18E9C0C6009C0E35 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + F848D1F518E9C0C6009C0E35 /* MarkdownOSXTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MarkdownOSXTests-Info.plist"; sourceTree = ""; }; + F848D1F718E9C0C6009C0E35 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + F848D1F918E9C0C6009C0E35 /* MarkdownOSXTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MarkdownOSXTests.m; sourceTree = ""; }; + F848D20418E9C0FC009C0E35 /* MarkdownTokenizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MarkdownTokenizer.m; sourceTree = ""; }; + F848D20518E9C0FC009C0E35 /* MarkdownTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkdownTokens.h; sourceTree = ""; }; + F848D20618E9C0FC009C0E35 /* MarkdownTokens.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MarkdownTokens.m; sourceTree = ""; }; + F848D20718E9C0FC009C0E35 /* NimbusMarkdown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NimbusMarkdown.h; sourceTree = ""; }; + F848D20818E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAttributedStringMarkdownParser.h; sourceTree = ""; }; + F848D20918E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSAttributedStringMarkdownParser.m; sourceTree = ""; }; + F848D20D18E9C5CD009C0E35 /* NimbusKit-markdown.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = "NimbusKit-markdown.podspec"; path = "../../NimbusKit-markdown.podspec"; sourceTree = ""; }; + FA50B7B79A9E44ADBAD1DC62 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F848D1C918E9C0C6009C0E35 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F848D1D018E9C0C6009C0E35 /* Cocoa.framework in Frameworks */, + 1CD5D64F9AC04BC0B3C08B8B /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F848D1EA18E9C0C6009C0E35 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F848D1F018E9C0C6009C0E35 /* Cocoa.framework in Frameworks */, + F848D1EF18E9C0C6009C0E35 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F848D1C318E9C0C5009C0E35 = { + isa = PBXGroup; + children = ( + F848D20D18E9C5CD009C0E35 /* NimbusKit-markdown.podspec */, + F848D20318E9C0FC009C0E35 /* src */, + F848D1D518E9C0C6009C0E35 /* MarkdownOSX */, + F848D1F318E9C0C6009C0E35 /* MarkdownOSXTests */, + F848D1CE18E9C0C6009C0E35 /* Frameworks */, + F848D1CD18E9C0C6009C0E35 /* Products */, + 523E6D6887CB4C8C988734AB /* Pods.xcconfig */, + ); + sourceTree = ""; + }; + F848D1CD18E9C0C6009C0E35 /* Products */ = { + isa = PBXGroup; + children = ( + F848D1CC18E9C0C6009C0E35 /* MarkdownOSX.app */, + F848D1ED18E9C0C6009C0E35 /* MarkdownOSXTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + F848D1CE18E9C0C6009C0E35 /* Frameworks */ = { + isa = PBXGroup; + children = ( + F848D1CF18E9C0C6009C0E35 /* Cocoa.framework */, + F848D1EE18E9C0C6009C0E35 /* XCTest.framework */, + F848D1D118E9C0C6009C0E35 /* Other Frameworks */, + FA50B7B79A9E44ADBAD1DC62 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + F848D1D118E9C0C6009C0E35 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + F848D1D218E9C0C6009C0E35 /* AppKit.framework */, + F848D1D318E9C0C6009C0E35 /* CoreData.framework */, + F848D1D418E9C0C6009C0E35 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + F848D1D518E9C0C6009C0E35 /* MarkdownOSX */ = { + isa = PBXGroup; + children = ( + F848D1E118E9C0C6009C0E35 /* MDTAppDelegate.h */, + F848D1E218E9C0C6009C0E35 /* MDTAppDelegate.m */, + F848D1E418E9C0C6009C0E35 /* MainMenu.xib */, + F848D1E718E9C0C6009C0E35 /* Images.xcassets */, + F848D1D618E9C0C6009C0E35 /* Supporting Files */, + ); + path = MarkdownOSX; + sourceTree = ""; + }; + F848D1D618E9C0C6009C0E35 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F848D1D718E9C0C6009C0E35 /* MarkdownOSX-Info.plist */, + F848D1D818E9C0C6009C0E35 /* InfoPlist.strings */, + F848D1DB18E9C0C6009C0E35 /* main.m */, + F848D1DD18E9C0C6009C0E35 /* MarkdownOSX-Prefix.pch */, + F848D1DE18E9C0C6009C0E35 /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + F848D1F318E9C0C6009C0E35 /* MarkdownOSXTests */ = { + isa = PBXGroup; + children = ( + F848D1F918E9C0C6009C0E35 /* MarkdownOSXTests.m */, + F848D1F418E9C0C6009C0E35 /* Supporting Files */, + ); + path = MarkdownOSXTests; + sourceTree = ""; + }; + F848D1F418E9C0C6009C0E35 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F848D1F518E9C0C6009C0E35 /* MarkdownOSXTests-Info.plist */, + F848D1F618E9C0C6009C0E35 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + F848D20318E9C0FC009C0E35 /* src */ = { + isa = PBXGroup; + children = ( + F848D20418E9C0FC009C0E35 /* MarkdownTokenizer.m */, + F848D20518E9C0FC009C0E35 /* MarkdownTokens.h */, + F848D20618E9C0FC009C0E35 /* MarkdownTokens.m */, + F848D20718E9C0FC009C0E35 /* NimbusMarkdown.h */, + F848D20818E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.h */, + F848D20918E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.m */, + ); + name = src; + path = ../../src; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F848D1CB18E9C0C6009C0E35 /* MarkdownOSX */ = { + isa = PBXNativeTarget; + buildConfigurationList = F848D1FD18E9C0C6009C0E35 /* Build configuration list for PBXNativeTarget "MarkdownOSX" */; + buildPhases = ( + 82B276DF5542420AAD953EB1 /* Check Pods Manifest.lock */, + F848D1C818E9C0C6009C0E35 /* Sources */, + F848D1C918E9C0C6009C0E35 /* Frameworks */, + F848D1CA18E9C0C6009C0E35 /* Resources */, + 34B635DC26154CE6A8571FA6 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MarkdownOSX; + productName = MarkdownOSX; + productReference = F848D1CC18E9C0C6009C0E35 /* MarkdownOSX.app */; + productType = "com.apple.product-type.application"; + }; + F848D1EC18E9C0C6009C0E35 /* MarkdownOSXTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F848D20018E9C0C6009C0E35 /* Build configuration list for PBXNativeTarget "MarkdownOSXTests" */; + buildPhases = ( + F848D1E918E9C0C6009C0E35 /* Sources */, + F848D1EA18E9C0C6009C0E35 /* Frameworks */, + F848D1EB18E9C0C6009C0E35 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F848D1F218E9C0C6009C0E35 /* PBXTargetDependency */, + ); + name = MarkdownOSXTests; + productName = MarkdownOSXTests; + productReference = F848D1ED18E9C0C6009C0E35 /* MarkdownOSXTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F848D1C418E9C0C5009C0E35 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = MDT; + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = "Epyx SA"; + TargetAttributes = { + F848D1EC18E9C0C6009C0E35 = { + TestTargetID = F848D1CB18E9C0C6009C0E35; + }; + }; + }; + buildConfigurationList = F848D1C718E9C0C5009C0E35 /* Build configuration list for PBXProject "MarkdownOSX" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F848D1C318E9C0C5009C0E35; + productRefGroup = F848D1CD18E9C0C6009C0E35 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F848D1CB18E9C0C6009C0E35 /* MarkdownOSX */, + F848D1EC18E9C0C6009C0E35 /* MarkdownOSXTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F848D1CA18E9C0C6009C0E35 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F848D1DA18E9C0C6009C0E35 /* InfoPlist.strings in Resources */, + F848D1E818E9C0C6009C0E35 /* Images.xcassets in Resources */, + F848D1E018E9C0C6009C0E35 /* Credits.rtf in Resources */, + F848D1E618E9C0C6009C0E35 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F848D1EB18E9C0C6009C0E35 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F848D1F818E9C0C6009C0E35 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 34B635DC26154CE6A8571FA6 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 82B276DF5542420AAD953EB1 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F848D1C818E9C0C6009C0E35 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F848D20A18E9C0FC009C0E35 /* MarkdownTokenizer.m in Sources */, + F848D1E318E9C0C6009C0E35 /* MDTAppDelegate.m in Sources */, + F848D20C18E9C0FC009C0E35 /* NSAttributedStringMarkdownParser.m in Sources */, + F848D20B18E9C0FC009C0E35 /* MarkdownTokens.m in Sources */, + F848D1DC18E9C0C6009C0E35 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F848D1E918E9C0C6009C0E35 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F848D1FA18E9C0C6009C0E35 /* MarkdownOSXTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + F848D1F218E9C0C6009C0E35 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F848D1CB18E9C0C6009C0E35 /* MarkdownOSX */; + targetProxy = F848D1F118E9C0C6009C0E35 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + F848D1D818E9C0C6009C0E35 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + F848D1D918E9C0C6009C0E35 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + F848D1DE18E9C0C6009C0E35 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + F848D1DF18E9C0C6009C0E35 /* en */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + F848D1E418E9C0C6009C0E35 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + F848D1E518E9C0C6009C0E35 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + F848D1F618E9C0C6009C0E35 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + F848D1F718E9C0C6009C0E35 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F848D1FB18E9C0C6009C0E35 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + F848D1FC18E9C0C6009C0E35 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; + }; + name = Release; + }; + F848D1FE18E9C0C6009C0E35 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 523E6D6887CB4C8C988734AB /* Pods.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MarkdownOSX/MarkdownOSX-Prefix.pch"; + INFOPLIST_FILE = "MarkdownOSX/MarkdownOSX-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + F848D1FF18E9C0C6009C0E35 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 523E6D6887CB4C8C988734AB /* Pods.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MarkdownOSX/MarkdownOSX-Prefix.pch"; + INFOPLIST_FILE = "MarkdownOSX/MarkdownOSX-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + F848D20118E9C0C6009C0E35 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MarkdownOSX.app/Contents/MacOS/MarkdownOSX"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MarkdownOSX/MarkdownOSX-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "MarkdownOSXTests/MarkdownOSXTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + F848D20218E9C0C6009C0E35 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MarkdownOSX.app/Contents/MacOS/MarkdownOSX"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "MarkdownOSX/MarkdownOSX-Prefix.pch"; + INFOPLIST_FILE = "MarkdownOSXTests/MarkdownOSXTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F848D1C718E9C0C5009C0E35 /* Build configuration list for PBXProject "MarkdownOSX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F848D1FB18E9C0C6009C0E35 /* Debug */, + F848D1FC18E9C0C6009C0E35 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F848D1FD18E9C0C6009C0E35 /* Build configuration list for PBXNativeTarget "MarkdownOSX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F848D1FE18E9C0C6009C0E35 /* Debug */, + F848D1FF18E9C0C6009C0E35 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F848D20018E9C0C6009C0E35 /* Build configuration list for PBXNativeTarget "MarkdownOSXTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F848D20118E9C0C6009C0E35 /* Debug */, + F848D20218E9C0C6009C0E35 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F848D1C418E9C0C5009C0E35 /* Project object */; +} diff --git a/TestApps/MarkdownOSX/MarkdownOSX/Base.lproj/MainMenu.xib b/TestApps/MarkdownOSX/MarkdownOSX/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..8fa4c5e --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/Base.lproj/MainMenu.xib @@ -0,0 +1,680 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestApps/MarkdownOSX/MarkdownOSX/Images.xcassets/AppIcon.appiconset/Contents.json b/TestApps/MarkdownOSX/MarkdownOSX/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.h b/TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.h new file mode 100644 index 0000000..3c023e7 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.h @@ -0,0 +1,15 @@ +// +// MDTAppDelegate.h +// MarkdownOSX +// +// Created by Stefan Paychère on 31/03/14. +// Copyright (c) 2014 Epyx SA. All rights reserved. +// + +#import + +@interface MDTAppDelegate : NSObject + +@property (assign) IBOutlet NSWindow *window; + +@end diff --git a/TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.m b/TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.m new file mode 100644 index 0000000..06d9e32 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.m @@ -0,0 +1,18 @@ +// +// MDTAppDelegate.m +// MarkdownOSX +// +// Created by Stefan Paychère on 31/03/14. +// Copyright (c) 2014 Epyx SA. All rights reserved. +// + +#import "MDTAppDelegate.h" + +@implementation MDTAppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + // Insert code here to initialize your application +} + +@end diff --git a/TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Info.plist b/TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Info.plist new file mode 100644 index 0000000..3158ced --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + ch.epyx.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2014 Epyx SA. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Prefix.pch b/TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Prefix.pch new file mode 100644 index 0000000..35d7640 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/TestApps/MarkdownOSX/MarkdownOSX/en.lproj/Credits.rtf b/TestApps/MarkdownOSX/MarkdownOSX/en.lproj/Credits.rtf new file mode 100644 index 0000000..46576ef --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/en.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/TestApps/MarkdownOSX/MarkdownOSX/en.lproj/InfoPlist.strings b/TestApps/MarkdownOSX/MarkdownOSX/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/TestApps/MarkdownOSX/MarkdownOSX/main.m b/TestApps/MarkdownOSX/MarkdownOSX/main.m new file mode 100644 index 0000000..b9c53a6 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSX/main.m @@ -0,0 +1,14 @@ +// +// main.m +// MarkdownOSX +// +// Created by Stefan Paychère on 31/03/14. +// Copyright (c) 2014 Epyx SA. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) +{ + return NSApplicationMain(argc, argv); +} diff --git a/TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests-Info.plist b/TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests-Info.plist new file mode 100644 index 0000000..0fd3076 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ch.epyx.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests.m b/TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests.m new file mode 100644 index 0000000..9842d62 --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests.m @@ -0,0 +1,76 @@ +// +// MarkdownOSXTests.m +// MarkdownOSXTests +// +// Created by Stefan Paychère on 31/03/14. +// Copyright (c) 2014 Epyx SA. All rights reserved. +// + +#import +#import "NSAttributedStringMarkdownParser.h" + +@interface MarkdownOSXTests : XCTestCase + +@end + +@implementation MarkdownOSXTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testMarkdown +{ + NSString *testString = @"# Header 1\n"\ + "## Header 2\n"\ + "### Header 3\n"\ + "#### Header 4\n"\ + "##### Header 5\n"\ + "###### Header 6\n"\ + "\n"\ + "*italics*\n"\ + "**bold**\n"\ + "***bold italic***\n"\ + "~~strikethrough~~\n"\ + "\n"\ + "http://google.com urls\n"\ + "[Text] (http://apple.com \"alt text\") urls\n"; + + NSAttributedStringMarkdownParser *parser = [[NSAttributedStringMarkdownParser alloc]init]; + + NSAttributedString *result = [parser attributedStringFromMarkdownString:testString]; + XCTAssertNotNil(result, @"parser should return something"); + XCTAssertTrue([result isKindOfClass:[NSAttributedString class]], @"Result should be an NSAttributedString"); + //TODO: Add some content checking + + NSArray *links = [parser links]; + XCTAssertNotNil(links, @"parser should return an Array of links"); + XCTAssertTrue([links isKindOfClass:[NSArray class]], @"links should be an NSArray"); + XCTAssertTrue([links count] == 2, @"There should be 2 links in the sample text"); + + NSAttributedStringMarkdownLink *link = [links objectAtIndex:0]; + XCTAssertTrue([link isKindOfClass:[NSAttributedStringMarkdownLink class]], @"link should be an NSAttributedStringMarkdownLink"); + XCTAssertNotNil(link.url, @"There should be an NSURL attribute"); + XCTAssertTrue([link.url isKindOfClass:[NSURL class]], @"link should be an NSURL"); + XCTAssertTrue([link.url isEqualTo:[NSURL URLWithString:@"http://google.com"]], @"URL should point to http://google.com (%@)", link.url); + XCTAssertTrue(link.range.location == 100, @"range.location should be 100 (%lu)", (unsigned long)link.range.location); + XCTAssertTrue(link.range.length == 17, @"range.length should be 17 (%lu)", (unsigned long)link.range.length); + + link = [links objectAtIndex:1]; + XCTAssertTrue([link isKindOfClass:[NSAttributedStringMarkdownLink class]], @"link should be an NSAttributedStringMarkdownLink"); + XCTAssertNotNil(link.url, @"There should be an NSURL attribute"); + XCTAssertTrue([link.url isKindOfClass:[NSURL class]], @"link should be an NSURL"); + XCTAssertTrue([link.url isEqualTo:[NSURL URLWithString:@"http://apple.com"]], @"URL should point to http://apple.com (%@)", link.url); + XCTAssertTrue(link.range.location == 131, @"range.location should be 100 (%lu)", (unsigned long)link.range.location); + XCTAssertTrue(link.range.length == 16, @"range.length should be 17 (%lu)", (unsigned long)link.range.length); +} + +@end diff --git a/TestApps/MarkdownOSX/MarkdownOSXTests/en.lproj/InfoPlist.strings b/TestApps/MarkdownOSX/MarkdownOSXTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/TestApps/MarkdownOSX/MarkdownOSXTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/TestApps/MarkdownOSX/Podfile b/TestApps/MarkdownOSX/Podfile new file mode 100644 index 0000000..82410f5 --- /dev/null +++ b/TestApps/MarkdownOSX/Podfile @@ -0,0 +1,5 @@ +platform :osx, '10.8' + +pod 'fmemopen', '~> 0.0.1' + +link_with 'MarkdownOSX' \ No newline at end of file diff --git a/TestApps/MarkdownOSX/Podfile.lock b/TestApps/MarkdownOSX/Podfile.lock new file mode 100644 index 0000000..076bba3 --- /dev/null +++ b/TestApps/MarkdownOSX/Podfile.lock @@ -0,0 +1,10 @@ +PODS: + - fmemopen (0.0.1) + +DEPENDENCIES: + - fmemopen (~> 0.0.1) + +SPEC CHECKSUMS: + fmemopen: 9985c0b5696288ac034514edc2eeaea6e5ae77ca + +COCOAPODS: 0.30.0 diff --git a/TestApps/MarkdownOSX/Pods/BuildHeaders/fmemopen/fmemopen.h b/TestApps/MarkdownOSX/Pods/BuildHeaders/fmemopen/fmemopen.h new file mode 120000 index 0000000..627b1da --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/BuildHeaders/fmemopen/fmemopen.h @@ -0,0 +1 @@ +../../fmemopen/fmemopen.h \ No newline at end of file diff --git a/TestApps/MarkdownOSX/Pods/Headers/fmemopen/fmemopen.h b/TestApps/MarkdownOSX/Pods/Headers/fmemopen/fmemopen.h new file mode 120000 index 0000000..627b1da --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Headers/fmemopen/fmemopen.h @@ -0,0 +1 @@ +../../fmemopen/fmemopen.h \ No newline at end of file diff --git a/TestApps/MarkdownOSX/Pods/Manifest.lock b/TestApps/MarkdownOSX/Pods/Manifest.lock new file mode 100644 index 0000000..076bba3 --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Manifest.lock @@ -0,0 +1,10 @@ +PODS: + - fmemopen (0.0.1) + +DEPENDENCIES: + - fmemopen (~> 0.0.1) + +SPEC CHECKSUMS: + fmemopen: 9985c0b5696288ac034514edc2eeaea6e5ae77ca + +COCOAPODS: 0.30.0 diff --git a/TestApps/MarkdownOSX/Pods/Pods-acknowledgements.markdown b/TestApps/MarkdownOSX/Pods/Pods-acknowledgements.markdown new file mode 100644 index 0000000..255149a --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - http://cocoapods.org diff --git a/TestApps/MarkdownOSX/Pods/Pods-acknowledgements.plist b/TestApps/MarkdownOSX/Pods/Pods-acknowledgements.plist new file mode 100644 index 0000000..e4edebe --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/TestApps/MarkdownOSX/Pods/Pods-dummy.m b/TestApps/MarkdownOSX/Pods/Pods-dummy.m new file mode 100644 index 0000000..ade64bd --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/TestApps/MarkdownOSX/Pods/Pods-environment.h b/TestApps/MarkdownOSX/Pods/Pods-environment.h new file mode 100644 index 0000000..013f0c9 --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-environment.h @@ -0,0 +1,14 @@ + +// To check if a library is compiled with CocoaPods you +// can use the `COCOAPODS` macro definition which is +// defined in the xcconfigs so it is available in +// headers also when they are imported in the client +// project. + + +// fmemopen +#define COCOAPODS_POD_AVAILABLE_fmemopen +#define COCOAPODS_VERSION_MAJOR_fmemopen 0 +#define COCOAPODS_VERSION_MINOR_fmemopen 0 +#define COCOAPODS_VERSION_PATCH_fmemopen 1 + diff --git a/TestApps/MarkdownOSX/Pods/Pods-fmemopen-Private.xcconfig b/TestApps/MarkdownOSX/Pods/Pods-fmemopen-Private.xcconfig new file mode 100644 index 0000000..1ef2cd6 --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-fmemopen-Private.xcconfig @@ -0,0 +1,5 @@ +#include "Pods-fmemopen.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/fmemopen" "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/fmemopen" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT} \ No newline at end of file diff --git a/TestApps/MarkdownOSX/Pods/Pods-fmemopen-dummy.m b/TestApps/MarkdownOSX/Pods/Pods-fmemopen-dummy.m new file mode 100644 index 0000000..61ef3be --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-fmemopen-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_fmemopen : NSObject +@end +@implementation PodsDummy_Pods_fmemopen +@end diff --git a/TestApps/MarkdownOSX/Pods/Pods-fmemopen-prefix.pch b/TestApps/MarkdownOSX/Pods/Pods-fmemopen-prefix.pch new file mode 100644 index 0000000..2e9257c --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-fmemopen-prefix.pch @@ -0,0 +1,5 @@ +#ifdef __OBJC__ +#import +#endif + +#import "Pods-environment.h" diff --git a/TestApps/MarkdownOSX/Pods/Pods-fmemopen.xcconfig b/TestApps/MarkdownOSX/Pods/Pods-fmemopen.xcconfig new file mode 100644 index 0000000..e69de29 diff --git a/TestApps/MarkdownOSX/Pods/Pods-resources.sh b/TestApps/MarkdownOSX/Pods/Pods-resources.sh new file mode 100755 index 0000000..39c2549 --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods-resources.sh @@ -0,0 +1,68 @@ +#!/bin/sh +set -e + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcassets) + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]]; then + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ `xcrun --find actool` ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/TestApps/MarkdownOSX/Pods/Pods.xcconfig b/TestApps/MarkdownOSX/Pods/Pods.xcconfig new file mode 100644 index 0000000..7199adb --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/fmemopen" +OTHER_CFLAGS = $(inherited) "-isystem${PODS_ROOT}/Headers" "-isystem${PODS_ROOT}/Headers/fmemopen" +OTHER_LDFLAGS = -ObjC +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/TestApps/MarkdownOSX/Pods/Pods.xcodeproj/project.pbxproj b/TestApps/MarkdownOSX/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..5bf677f --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,962 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 0445DC4B133D4F6C8C4F6EBF + + children + + F11A14DE98B94BFD81746CFD + 8783C4FE8D564FBE879ED085 + 110FCDE8A78C432E9D3EAC4E + 062C1349ACAB4FD680796AB8 + 86B4956AB01A47E68AEE7EF9 + 8DBF4967FD6C4C77B56991DB + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 062C1349ACAB4FD680796AB8 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-dummy.m + sourceTree + <group> + + 069ACC61D77440AD9AAD4FFD + + fileRef + 062C1349ACAB4FD680796AB8 + isa + PBXBuildFile + + 0A3D95E3F69445548D68907A + + baseConfigurationReference + F11A14DE98B94BFD81746CFD + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_ENABLE_OBJC_EXCEPTIONS + YES + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + MACOSX_DEPLOYMENT_TARGET + 10.8 + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + SDKROOT + macosx + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 110FCDE8A78C432E9D3EAC4E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Pods-acknowledgements.plist + sourceTree + <group> + + 36EFA42C6EB14ADAAE0C981D + + buildActionMask + 2147483647 + files + + B751319F5EB0486AB1D56C19 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 39560FEC35A240FCA3F5C719 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-fmemopen.xcconfig + sourceTree + <group> + + 3C31C3C17D7D4A2E90EF4208 + + fileRef + 3DEA6EAC0AEA444B84B61C31 + isa + PBXBuildFile + + 3D18C48B87B94D08BC4B4A10 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-fmemopen.a + sourceTree + BUILT_PRODUCTS_DIR + + 3DEA6EAC0AEA444B84B61C31 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + fmemopen.h + sourceTree + <group> + + 43D21A698BA543D592E57EBD + + buildConfigurationList + EBC0B54D614E408A8FC5107F + buildPhases + + 825390A27C304B77A1E07EA4 + 8B2B9421FEFB4FE8B0E80125 + + buildRules + + dependencies + + 8DC3ABCF86BF4BBF976B95A8 + + isa + PBXNativeTarget + name + Pods + productName + Pods + productReference + B47D6B853E2043D38E220B74 + productType + com.apple.product-type.library.static + + 4A09EEB2B86D4A2790736975 + + buildConfigurationList + 837B173464AC467CAE42FA04 + buildPhases + + 7F176E841F8C40AB9952D53C + 36EFA42C6EB14ADAAE0C981D + 61E496DAA9604A43BFA3B6EB + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Pods-fmemopen + productName + Pods-fmemopen + productReference + 3D18C48B87B94D08BC4B4A10 + productType + com.apple.product-type.library.static + + 4BAD8B2CAB514AA589547859 + + baseConfigurationReference + F11A14DE98B94BFD81746CFD + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + YES + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_ENABLE_OBJC_EXCEPTIONS + YES + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + MACOSX_DEPLOYMENT_TARGET + 10.8 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + SDKROOT + macosx + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Release + + 4E4610002CFE492990533B28 + + children + + 5E74E2744FC24081842F8999 + 86AB09F340AB4F45BBFB6171 + A1CF731F808E4DA7B358A83D + 9F45DE12F0BA4EC88FACC3A3 + E67E89AE911544498C5B5243 + + isa + PBXGroup + sourceTree + <group> + + 5793AB54E776417A8C0FF567 + + fileRef + E03F6CEFE01C42138B20A018 + isa + PBXBuildFile + + 5E74E2744FC24081842F8999 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + name + Podfile + path + ../Podfile + sourceTree + SOURCE_ROOT + xcLanguageSpecificationIdentifier + xcode.lang.ruby + + 61E496DAA9604A43BFA3B6EB + + buildActionMask + 2147483647 + files + + 3C31C3C17D7D4A2E90EF4208 + + isa + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 6BF5FCE99F0D48D4AB4EECCC + + baseConfigurationReference + F982F2A0181940CAA4FD8429 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_ENABLE_OBJC_EXCEPTIONS + YES + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Pods-fmemopen-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + MACOSX_DEPLOYMENT_TARGET + 10.8 + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + SDKROOT + macosx + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 78526832DBED41EFAF5D0457 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-fmemopen-dummy.m + sourceTree + <group> + + 79EBB4FB7FF043DCA08A1DB8 + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + NO + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES_ERROR + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES_ERROR + COPY_PHASE_STRIP + NO + ENABLE_NS_ASSERTIONS + NO + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES_ERROR + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + MACOSX_DEPLOYMENT_TARGET + 10.8 + STRIP_INSTALLED_PRODUCT + NO + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 7F176E841F8C40AB9952D53C + + buildActionMask + 2147483647 + files + + A985637E667B42AFA4632B79 + 5793AB54E776417A8C0FF567 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 825390A27C304B77A1E07EA4 + + buildActionMask + 2147483647 + files + + 069ACC61D77440AD9AAD4FFD + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 837B173464AC467CAE42FA04 + + buildConfigurations + + 6BF5FCE99F0D48D4AB4EECCC + B8C2944A1D20482792AF837C + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 83E01C7A27124DB5A0E2FC8D + + children + + E03F6CEFE01C42138B20A018 + 3DEA6EAC0AEA444B84B61C31 + AD298F00426243309F096013 + + isa + PBXGroup + name + fmemopen + path + fmemopen + sourceTree + <group> + + 86AB09F340AB4F45BBFB6171 + + children + + B47C326EF97B49BEAEAFF964 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 86B4956AB01A47E68AEE7EF9 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-environment.h + sourceTree + <group> + + 8783C4FE8D564FBE879ED085 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text + path + Pods-acknowledgements.markdown + sourceTree + <group> + + 8B2B9421FEFB4FE8B0E80125 + + buildActionMask + 2147483647 + files + + CCEA024518DA4269AC10BE1F + DC222D465BF14C66ACF6CC59 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 8DBF4967FD6C4C77B56991DB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.script.sh + path + Pods-resources.sh + sourceTree + <group> + + 8DC3ABCF86BF4BBF976B95A8 + + isa + PBXTargetDependency + target + 4A09EEB2B86D4A2790736975 + targetProxy + BEC5A19372924EA39C823ADC + + 9F45DE12F0BA4EC88FACC3A3 + + children + + B47D6B853E2043D38E220B74 + 3D18C48B87B94D08BC4B4A10 + + isa + PBXGroup + name + Products + sourceTree + <group> + + A1CF731F808E4DA7B358A83D + + children + + 83E01C7A27124DB5A0E2FC8D + + isa + PBXGroup + name + Pods + sourceTree + <group> + + A985637E667B42AFA4632B79 + + fileRef + 78526832DBED41EFAF5D0457 + isa + PBXBuildFile + + AD298F00426243309F096013 + + children + + 39560FEC35A240FCA3F5C719 + F982F2A0181940CAA4FD8429 + 78526832DBED41EFAF5D0457 + DBC7A6BE4ED142408D8F6BE6 + + isa + PBXGroup + name + Support Files + sourceTree + SOURCE_ROOT + + B47C326EF97B49BEAEAFF964 + + children + + D8478089F2574D2490817583 + + isa + PBXGroup + name + OS X + sourceTree + <group> + + B47D6B853E2043D38E220B74 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods.a + sourceTree + BUILT_PRODUCTS_DIR + + B66CF9D566AA482E91A0F7D6 + + attributes + + LastUpgradeCheck + 0510 + + buildConfigurationList + E091938E30E54F359A6F2B20 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + + mainGroup + 4E4610002CFE492990533B28 + productRefGroup + 9F45DE12F0BA4EC88FACC3A3 + projectDirPath + + projectReferences + + projectRoot + + targets + + 43D21A698BA543D592E57EBD + 4A09EEB2B86D4A2790736975 + + + B751319F5EB0486AB1D56C19 + + fileRef + D8478089F2574D2490817583 + isa + PBXBuildFile + + B8C2944A1D20482792AF837C + + baseConfigurationReference + F982F2A0181940CAA4FD8429 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COMBINE_HIDPI_IMAGES + YES + COPY_PHASE_STRIP + YES + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_ENABLE_OBJC_EXCEPTIONS + YES + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Pods-fmemopen-prefix.pch + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + MACOSX_DEPLOYMENT_TARGET + 10.8 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + SDKROOT + macosx + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Release + + BEC5A19372924EA39C823ADC + + containerPortal + B66CF9D566AA482E91A0F7D6 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 4A09EEB2B86D4A2790736975 + remoteInfo + Pods-fmemopen + + CCEA024518DA4269AC10BE1F + + fileRef + D8478089F2574D2490817583 + isa + PBXBuildFile + + D8478089F2574D2490817583 + + isa + PBXFileReference + lastKnownFileType + wrapper.framework + name + Cocoa.framework + path + Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework + sourceTree + DEVELOPER_DIR + + DBC7A6BE4ED142408D8F6BE6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-fmemopen-prefix.pch + sourceTree + <group> + + DC222D465BF14C66ACF6CC59 + + fileRef + 3D18C48B87B94D08BC4B4A10 + isa + PBXBuildFile + + E03F6CEFE01C42138B20A018 + + includeInIndex + 1 + isa + PBXFileReference + path + fmemopen.c + sourceTree + <group> + + E091938E30E54F359A6F2B20 + + buildConfigurations + + FF5FCD4623A54CA2BB61FF45 + 79EBB4FB7FF043DCA08A1DB8 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + E67E89AE911544498C5B5243 + + children + + 0445DC4B133D4F6C8C4F6EBF + + isa + PBXGroup + name + Targets Support Files + sourceTree + <group> + + EBC0B54D614E408A8FC5107F + + buildConfigurations + + 0A3D95E3F69445548D68907A + 4BAD8B2CAB514AA589547859 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + F11A14DE98B94BFD81746CFD + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods.xcconfig + sourceTree + <group> + + F982F2A0181940CAA4FD8429 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-fmemopen-Private.xcconfig + sourceTree + <group> + + FF5FCD4623A54CA2BB61FF45 + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + NO + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES_ERROR + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES_ERROR + COPY_PHASE_STRIP + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES_ERROR + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + MACOSX_DEPLOYMENT_TARGET + 10.8 + ONLY_ACTIVE_ARCH + YES + STRIP_INSTALLED_PRODUCT + NO + + isa + XCBuildConfiguration + name + Debug + + + rootObject + B66CF9D566AA482E91A0F7D6 + + diff --git a/TestApps/MarkdownOSX/Pods/fmemopen/README.md b/TestApps/MarkdownOSX/Pods/fmemopen/README.md new file mode 100644 index 0000000..476810e --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/fmemopen/README.md @@ -0,0 +1,49 @@ +fmemopen for Mac OS and iOS +=========================== + +Originally ported from [ingenuitas python-tesseract](https://github.com/ingenuitas/python-tesseract/blob/master/fmemopen.c). Ported by Jeff Verkoeyen under the Apache 2.0 License. + +From the fmemopen man page: + +> FILE *fmemopen(void *buf, size_t size, const char *mode); +> +> The fmemopen() function opens a stream that permits the access specified by mode. The stream +> allows I/O to be performed on the string or memory buffer pointed to by buf. This buffer must be +> at least size bytes long. + +Alas, this method does not exist on BSD operating systems (specifically Mac OS X and iOS). It is +possible to recreate this functionality using a BSD-specific method called `funopen`. + +From the funopen man page: + +> FILE * funopen(const void *cookie, int (*readfn)(void *, char *, int), +> int (*writefn)(void *, const char *, int), fpos_t (*seekfn)(void *, fpos_t, int), +> int (*closefn)(void *)); +> +> The funopen() function associates a stream with up to four ``I/O functions''. Either readfn or +> writefn must be specified; the others can be given as an appropriately-typed NULL pointer. These +> I/O functions will be used to read, write, seek and close the new stream. + +fmemopen.c provides a simple implementation of fmemopen using funopen so that you can create FILE +pointers to blocks of memory. + +Adding it to your Project +========================= + +Drag fmemopen.h and fmemopen.c to your project and add them to your target. `#include "fmemopen.h"` +wherever you need to use `fmemopen`. + +Examples +======== + +```obj-c +#import "fmemopen.h" + +NSString* string = @"fmemopen in Objective-C"; +const char* cstr = [string UTF8String]; +FILE* file = fmemopen((void *)cstr, sizeof(char) * (string.length + 1), "r"); + +// fread on file will now read the contents of the NSString + +fclose(file); +``` diff --git a/TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.c b/TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.c new file mode 100644 index 0000000..13d41e1 --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.c @@ -0,0 +1,92 @@ +// +// Copyright 2012 Jeff Verkoeyen +// Originally ported from https://github.com/ingenuitas/python-tesseract/blob/master/fmemopen.c +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include +#include +#include +#include + +struct fmem { + size_t pos; + size_t size; + char *buffer; +}; +typedef struct fmem fmem_t; + +static int readfn(void *handler, char *buf, int size) { + fmem_t *mem = handler; + size_t available = mem->size - mem->pos; + + if (size > available) { + size = available; + } + memcpy(buf, mem->buffer + mem->pos, sizeof(char) * size); + mem->pos += size; + + return size; +} + +static int writefn(void *handler, const char *buf, int size) { + fmem_t *mem = handler; + size_t available = mem->size - mem->pos; + + if (size > available) { + size = available; + } + memcpy(mem->buffer + mem->pos, buf, sizeof(char) * size); + mem->pos += size; + + return size; +} + +static fpos_t seekfn(void *handler, fpos_t offset, int whence) { + size_t pos; + fmem_t *mem = handler; + + switch (whence) { + case SEEK_SET: pos = offset; break; + case SEEK_CUR: pos = mem->pos + offset; break; + case SEEK_END: pos = mem->size + offset; break; + default: return -1; + } + + if (pos > mem->size) { + return -1; + } + + mem->pos = pos; + return (fpos_t)pos; +} + +static int closefn(void *handler) { + free(handler); + return 0; +} + +FILE *fmemopen(void *buf, size_t size, const char *mode) { + // This data is released on fclose. + fmem_t* mem = (fmem_t *) malloc(sizeof(fmem_t)); + + // Zero-out the structure. + memset(mem, 0, sizeof(fmem_t)); + + mem->size = size; + mem->buffer = buf; + + // funopen's man page: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/funopen.3.html + return funopen(mem, readfn, writefn, seekfn, closefn); +} diff --git a/TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.h b/TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.h new file mode 100644 index 0000000..3d06b20 --- /dev/null +++ b/TestApps/MarkdownOSX/Pods/fmemopen/fmemopen.h @@ -0,0 +1,52 @@ +// +// Copyright 2012 Jeff Verkoeyen +// Originally ported from https://github.com/ingenuitas/python-tesseract/blob/master/fmemopen.c +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef FMEMOPEN_H_ +#define FMEMOPEN_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * A BSD port of the fmemopen Linux method using funopen. + * + * man docs for fmemopen: + * http://linux.die.net/man/3/fmemopen + * + * man docs for funopen: + * https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/funopen.3.html + * + * This method is ported from ingenuitas' python-tesseract project. + * + * You must call fclose on the returned file pointer or memory will be leaked. + * + * @param buf The data that will be used to back the FILE* methods. Must be at least + * @c size bytes. + * @param size The size of the @c buf data. + * @param mode The permitted stream operation modes. + * @returns A pointer that can be used in the fread/fwrite/fseek/fclose family of methods. + * If a failure occurred NULL will be returned. + */ +FILE *fmemopen(void *buf, size_t size, const char *mode); + +#ifdef __cplusplus +} +#endif + +#endif // #ifndef FMEMOPEN_H_ From d7d2dd74cae1928added5ccdbf78e247c7f4dfdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Payche=CC=80re?= Date: Mon, 31 Mar 2014 18:24:03 +0200 Subject: [PATCH 4/4] Podspec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Paychère --- NimbusKit-markdown.podspec | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 NimbusKit-markdown.podspec diff --git a/NimbusKit-markdown.podspec b/NimbusKit-markdown.podspec new file mode 100644 index 0000000..c400beb --- /dev/null +++ b/NimbusKit-markdown.podspec @@ -0,0 +1,20 @@ +Pod::Spec.new do |s| + s.name = 'NimbusKit-markdown' + s.version = '0.0.2' + s.license = 'Apache License, Version 2.0' + s.summary = 'A Markdown NSAttributedString parser.' + s.author = { "Jeff Verkoeyen" => "jverkoey@gmail.com" } + s.homepage = 'https://github.com/jverkoey/NSAttributedStringMarkdownParser' + s.source = { :git => 'https://github.com/epyx-src/markdown.git', :tag => s.version.to_s } + + s.requires_arc = true + + s.ios.deployment_target = '7.0' + s.osx.deployment_target = '10.8' + + s.public_header_files = 'src/**/*.h' + s.source_files = 'src/**/*.{h,m}' + + s.dependency 'fmemopen', '~> 0.0.1' + +end