Skip to content

Commit

Permalink
adding support for OSX 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur committed Mar 29, 2016
1 parent 14c9281 commit 216cb18
Show file tree
Hide file tree
Showing 51 changed files with 1,873 additions and 27 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#Change Log
All notable changes to this project will be documented in this file.
`TSMarkdownParser` adheres to [Semantic Versioning](http://semver.org/).

---

## [2.0.2](https://github.com/laptobbe/TSMarkdownParser/releases/tag/2.0.2) (2016/03/29)
Released on 2016/03/29. All issues associated with this milestone can be found using this [filter](https://github.com/laptobbe/TSMarkdownParser/issues?q=milestone%3A2.0.2+is%3Aclosed).

#### Added
* Added support to OS X 10.7
* Added a changelog [#41](https://github.com/laptobbe/TSMarkdownParser/issues/41)
10 changes: 6 additions & 4 deletions TSMarkdownParser.podspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Pod::Spec.new do |s|
s.name = "TSMarkdownParser"
s.version = "2.0.0"
s.summary = "A markdown to NSAttributedString parser for iOS"
s.version = "2.0.2"
s.summary = "A markdown to NSAttributedString parser for iOS and OSX"

s.description = <<-DESC
TSMarkdownParser is a markdown to NSAttributedString parser for iOS implemented using NSRegularExpressions.
TSMarkdownParser is a markdown to NSAttributedString parser for iOS, TVOS and OSX implemented using NSRegularExpressions.
It supports many of the standard tags layed out by John Gruber on his site [Daring Fireball](http://daringfireball.net/projects/markdown/syntax).
It is also very extendable via Regular Expressions making it easy to add your own custom tags or a totally different parsing syntax if you like.
DESC
Expand All @@ -15,8 +15,10 @@ Pod::Spec.new do |s|
s.social_media_url = "http://twitter.com/laptobbe"
s.ios.deployment_target = "6.0"
s.tvos.deployment_target = "9.0"
s.osx.deployment_target = "10.7"
s.source = { :git => "https://github.com/laptobbe/TSMarkdownParser.git", :tag => s.version.to_s }
s.source_files = "TSMarkdownParser/**/*.{h,m}"
s.requires_arc = true
s.framework = 'UIKit'
s.ios.framework = 'UIKit'
s.tvos.framework = 'UIKit'
end
320 changes: 308 additions & 12 deletions TSMarkdownParser.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F5971CAA63F90034AE2D"
BuildableName = "TSMarkdownParserExample OSX.app"
BlueprintName = "TSMarkdownParserExample OSX"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F5971CAA63F90034AE2D"
BuildableName = "TSMarkdownParserExample OSX.app"
BlueprintName = "TSMarkdownParserExample OSX"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F5971CAA63F90034AE2D"
BuildableName = "TSMarkdownParserExample OSX.app"
BlueprintName = "TSMarkdownParserExample OSX"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F5971CAA63F90034AE2D"
BuildableName = "TSMarkdownParserExample OSX.app"
BlueprintName = "TSMarkdownParserExample OSX"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES"
hideIssues = "NO">
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81B78D91C54B4B800A1DE36"
BuildableName = "TSMarkdownParser.app"
BlueprintName = "TSMarkdownParserExample"
BlueprintName = "TSMarkdownParserExample iOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand All @@ -35,7 +34,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81B78D91C54B4B800A1DE36"
BuildableName = "TSMarkdownParser.app"
BlueprintName = "TSMarkdownParserExample"
BlueprintName = "TSMarkdownParserExample iOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand All @@ -58,7 +57,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81B78D91C54B4B800A1DE36"
BuildableName = "TSMarkdownParser.app"
BlueprintName = "TSMarkdownParserExample"
BlueprintName = "TSMarkdownParserExample iOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -77,7 +76,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "C81B78D91C54B4B800A1DE36"
BuildableName = "TSMarkdownParser.app"
BlueprintName = "TSMarkdownParserExample"
BlueprintName = "TSMarkdownParserExample iOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F57F1CAA637C0034AE2D"
BuildableName = "TSMarkdownParserExample tvOS.app"
BlueprintName = "TSMarkdownParserExample tvOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F57F1CAA637C0034AE2D"
BuildableName = "TSMarkdownParserExample tvOS.app"
BlueprintName = "TSMarkdownParserExample tvOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F57F1CAA637C0034AE2D"
BuildableName = "TSMarkdownParserExample tvOS.app"
BlueprintName = "TSMarkdownParserExample tvOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3700F57F1CAA637C0034AE2D"
BuildableName = "TSMarkdownParserExample tvOS.app"
BlueprintName = "TSMarkdownParserExample tvOS"
ReferencedContainer = "container:TSMarkdownParser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
5 changes: 5 additions & 0 deletions TSMarkdownParser/TSBaseParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
//

#import "TSBaseParser.h"
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
#endif


@interface TSExpressionBlockPair : NSObject
Expand Down
5 changes: 5 additions & 0 deletions TSMarkdownParser/TSMarkdownParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
// Copyright (c) 2014 Computertalk Sweden. All rights reserved.
//

#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
#endif
#import "TSBaseParser.h"

NS_ASSUME_NONNULL_BEGIN
Expand Down
11 changes: 10 additions & 1 deletion TSMarkdownParser/TSMarkdownParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
//

#import "TSMarkdownParser.h"

#if !TARGET_OS_IPHONE
typedef NSColor UIColor;
typedef NSImage UIImage;
typedef NSFont UIFont;
#endif

@implementation TSMarkdownParser

Expand All @@ -34,7 +38,12 @@ - (instancetype)init {
_monospaceAttributes = @{ NSFontAttributeName: [UIFont fontWithName:@"Menlo" size:12],
NSForegroundColorAttributeName: [UIColor colorWithRed:0.95 green:0.54 blue:0.55 alpha:1] };
_strongAttributes = @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:12] };

#if TARGET_OS_IPHONE
_emphasisAttributes = @{ NSFontAttributeName: [UIFont italicSystemFontOfSize:12] };
#else
_emphasisAttributes = @{ NSFontAttributeName: [[NSFontManager sharedFontManager] convertFont:[UIFont systemFontOfSize:12] toHaveTrait:NSItalicFontMask] };
#endif

return self;
}
Expand Down
15 changes: 15 additions & 0 deletions TSMarkdownParserExample OSX/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// AppDelegate.h
// TSMarkdownParserExample OSX
//
// Created by Antoine Cœur on 3/29/16.
// Copyright © 2016 Computertalk Sweden. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>


@end

25 changes: 25 additions & 0 deletions TSMarkdownParserExample OSX/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// AppDelegate.m
// TSMarkdownParserExample OSX
//
// Created by Antoine Cœur on 3/29/16.
// Copyright © 2016 Computertalk Sweden. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}

@end
Loading

0 comments on commit 216cb18

Please sign in to comment.