-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bfa14d4
Showing
52 changed files
with
3,047 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# references: | ||
# * http://www.objc.io/issue-6/travis-ci.html | ||
# * https://github.com/supermarin/xcpretty#usage | ||
|
||
osx_image: xcode7.3 | ||
language: objective-c | ||
# cache: cocoapods | ||
# podfile: Example/Podfile | ||
# before_install: | ||
# - gem install cocoapods # Since Travis is not always on latest version | ||
# - pod install --project-directory=Example | ||
script: | ||
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MarkDownEditor.xcworkspace -scheme MarkDownEditor-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty | ||
- pod lib lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2017 Cu-Toof <toanf9dn@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Be sure to run `pod lib lint MarkDownEditor.podspec' to ensure this is a | ||
# valid spec before submitting. | ||
# | ||
# Any lines starting with a # are optional, but their use is encouraged | ||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'MarkDownEditor' | ||
s.version = '1.0.0' | ||
s.summary = 'Read MarkDown File.' | ||
|
||
# This description is used to generate tags and improve search results. | ||
# * Think: What does it do? Why did you write it? What is the focus? | ||
# * Try to keep it short, snappy and to the point. | ||
# * Write the description between the DESC delimiters below. | ||
# * Finally, don't worry about the indent, CocoaPods strips it! | ||
|
||
s.description = <<-DESC | ||
MarkDownEditor help you read MarkDown file in iOS. | ||
DESC | ||
|
||
s.homepage = 'https://github.com/Cu-Toof/MarkDownEditor' | ||
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = { 'Cu-Toof' => 'toanf9dn@gmail.com' } | ||
s.source = { :git => 'https://github.com/Cu-Toof/MarkDownEditor.git', :tag => s.version.to_s } | ||
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' | ||
|
||
s.ios.deployment_target = '8.0' | ||
|
||
s.source_files = 'MarkDownEditor/Classes/**/*' | ||
|
||
# s.resource_bundles = { | ||
# 'MarkDownEditor' => ['MarkDownEditor/Assets/*.png'] | ||
# } | ||
|
||
# s.public_header_files = 'Pod/Classes/**/*.h' | ||
s.frameworks = 'UIKit' | ||
s.dependency 'cmark', '~> 0.21.0' | ||
s.dependency 'Ono', '~> 1.1.3' | ||
end |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// CMAttributeRun.h | ||
// MarkDownEditor | ||
// | ||
// Created by Indragie on 1/15/15. | ||
// Copyright (c) 2015 Indragie Karunaratne. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "CMPlatformDefines.h" | ||
|
||
@interface CMAttributeRun : NSObject | ||
@property (nonatomic, readonly) NSDictionary *attributes; | ||
@property (nonatomic, readonly) CMFontSymbolicTraits fontTraits; | ||
@property (nonatomic) NSInteger orderedListItemNumber; | ||
@property (nonatomic, readonly) BOOL listTight; | ||
|
||
- (instancetype)initWithAttributes:(NSDictionary *)attributes | ||
fontTraits:(CMFontSymbolicTraits)fontTraits | ||
orderedListNumber:(NSInteger)orderedListNumber; | ||
|
||
@end | ||
|
||
CMAttributeRun * CMDefaultAttributeRun(NSDictionary *attributes); | ||
CMAttributeRun * CMTraitAttributeRun(NSDictionary *attributes, CMFontSymbolicTraits traits); | ||
CMAttributeRun * CMOrderedListAttributeRun(NSDictionary *attributes, NSInteger startingNumber); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// CMAttributeRun.m | ||
// MarkDownEditor | ||
// | ||
// Created by Indragie on 1/15/15. | ||
// Copyright (c) 2015 Indragie Karunaratne. All rights reserved. | ||
// | ||
|
||
#import "CMAttributeRun.h" | ||
|
||
CMAttributeRun * CMDefaultAttributeRun(NSDictionary *attributes) | ||
{ | ||
return [[CMAttributeRun alloc] initWithAttributes:attributes fontTraits:0 orderedListNumber:0]; | ||
} | ||
|
||
CMAttributeRun * CMTraitAttributeRun(NSDictionary *attributes, CMFontSymbolicTraits traits) | ||
{ | ||
return [[CMAttributeRun alloc] initWithAttributes:attributes fontTraits:traits orderedListNumber:0]; | ||
} | ||
|
||
CMAttributeRun * CMOrderedListAttributeRun(NSDictionary *attributes, NSInteger startingNumber) | ||
{ | ||
return [[CMAttributeRun alloc] initWithAttributes:attributes fontTraits:0 orderedListNumber:startingNumber]; | ||
} | ||
|
||
@implementation CMAttributeRun | ||
|
||
- (instancetype)initWithAttributes:(NSDictionary *)attributes | ||
fontTraits:(CMFontSymbolicTraits)fontTraits | ||
orderedListNumber:(NSInteger)orderedListNumber | ||
{ | ||
if ((self = [super init])) { | ||
_attributes = attributes; | ||
_fontTraits = fontTraits; | ||
_orderedListItemNumber = orderedListNumber; | ||
} | ||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// CMAttributedStringRenderer.h | ||
// MarkDownEditor | ||
// | ||
// Created by Indragie on 1/14/15. | ||
// Copyright (c) 2015 Indragie Karunaratne. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class CMDocument; | ||
@class CMTextAttributes; | ||
@protocol CMHTMLElementTransformer; | ||
/** | ||
* Renders an attributed string from a Markdown document | ||
*/ | ||
@interface CMAttributedStringRenderer : NSObject | ||
|
||
/** | ||
* Designated initializer. | ||
* | ||
* @param document A Markdown document. | ||
* @param attributes Attributes used to style the string. | ||
* | ||
* @return An initialized instance of the receiver. | ||
*/ | ||
- (instancetype)initWithDocument:(CMDocument *)document attributes:(CMTextAttributes *)attributes; | ||
|
||
/** | ||
* Registers a handler to transform HTML elements. | ||
* | ||
* Only a single transformer can be registered for an element. If a transformer | ||
* is already registered for an element, it will be replaced. | ||
* | ||
* @param transformer The transformer to register. | ||
*/ | ||
- (void)registerHTMLElementTransformer:(id<CMHTMLElementTransformer>)transformer; | ||
|
||
/** | ||
* Renders an attributed string from the Markdown document. | ||
* | ||
* @return An attributed string containing the contents of the Markdown document, | ||
* styled using the attributes set on the receiver. | ||
*/ | ||
- (NSAttributedString *)render; | ||
|
||
@end |
Oops, something went wrong.