Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/osx pod #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions NimbusKit-markdown.podspec
Original file line number Diff line number Diff line change
@@ -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
556 changes: 556 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

680 changes: 680 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/Base.lproj/MainMenu.xib

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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"
}
}
15 changes: 15 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.h
Original file line number Diff line number Diff line change
@@ -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 <Cocoa/Cocoa.h>

@interface MDTAppDelegate : NSObject <NSApplicationDelegate>

@property (assign) IBOutlet NSWindow *window;

@end
18 changes: 18 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/MDTAppDelegate.m
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>ch.epyx.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 Epyx SA. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
9 changes: 9 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/MarkdownOSX-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
29 changes: 29 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/en.lproj/Credits.rtf
Original file line number Diff line number Diff line change
@@ -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\
}
2 changes: 2 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

14 changes: 14 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSX/main.m
Original file line number Diff line number Diff line change
@@ -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 <Cocoa/Cocoa.h>

int main(int argc, const char * argv[])
{
return NSApplicationMain(argc, argv);
}
22 changes: 22 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>ch.epyx.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
76 changes: 76 additions & 0 deletions TestApps/MarkdownOSX/MarkdownOSXTests/MarkdownOSXTests.m
Original file line number Diff line number Diff line change
@@ -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 <XCTest/XCTest.h>
#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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

5 changes: 5 additions & 0 deletions TestApps/MarkdownOSX/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
platform :osx, '10.8'

pod 'fmemopen', '~> 0.0.1'

link_with 'MarkdownOSX'
10 changes: 10 additions & 0 deletions TestApps/MarkdownOSX/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PODS:
- fmemopen (0.0.1)

DEPENDENCIES:
- fmemopen (~> 0.0.1)

SPEC CHECKSUMS:
fmemopen: 9985c0b5696288ac034514edc2eeaea6e5ae77ca

COCOAPODS: 0.30.0
1 change: 1 addition & 0 deletions TestApps/MarkdownOSX/Pods/BuildHeaders/fmemopen/fmemopen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions TestApps/MarkdownOSX/Pods/Headers/fmemopen/fmemopen.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions TestApps/MarkdownOSX/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions TestApps/MarkdownOSX/Pods/Pods-acknowledgements.markdown

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions TestApps/MarkdownOSX/Pods/Pods-acknowledgements.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions TestApps/MarkdownOSX/Pods/Pods-dummy.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading