Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Expansions working on templates

  • Loading branch information...
commit 2cfbc2184a47ebc7c861174f9e6ae6c75f6468af 1 parent 8d5540c
@hiddenmemory authored
View
9 Tests/Test01.html
@@ -0,0 +1,9 @@
+{{# def page title author }}
+<html>
+ <head>
+ <title>{{ title }}</title>
+ <meta name="author" value="{{ author }}">
+ </head>
+ <body>{{ this }}</body>
+</html>
+{{/ def }}
View
21 Tests/Test02.html
@@ -0,0 +1,21 @@
+<html>
+ <head>
+ <title>{{ title }}</title>
+ <meta name="author" value="{{ author }}">
+ </head>
+ <body>
+ <h1>{{title}}</h1>
+ <h2>Client: {{client}}</h2>
+
+ {{description}}
+
+ <h3>Platform</h3>
+ <blockquote>{{platform}}</blockquote>
+
+ <h3>Testimonial</h3>
+ {{Testimonial}}
+
+ <h4>Technologies</h4>
+ {{Technologies}}
+ </body>
+</html>
View
31 Tipi.xcodeproj/project.pbxproj
@@ -10,7 +10,7 @@
838CA66E152DB08F0013C064 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 838CA66D152DB08F0013C064 /* Foundation.framework */; };
838CA671152DB08F0013C064 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA670152DB08F0013C064 /* main.m */; };
838CA675152DB08F0013C064 /* Tipi.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 838CA674152DB08F0013C064 /* Tipi.1 */; };
- 838CA67E152DB0DA0013C064 /* TPParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA67D152DB0DA0013C064 /* TPParser.m */; };
+ 838CA67E152DB0DA0013C064 /* TPInputParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA67D152DB0DA0013C064 /* TPInputParser.m */; };
838CA681152DB11E0013C064 /* TPTextDataParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA680152DB11E0013C064 /* TPTextDataParser.m */; };
838CA689152DB55C0013C064 /* NSString+HiddenMemory.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA688152DB55C0013C064 /* NSString+HiddenMemory.m */; };
838CA68C152DB59F0013C064 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA68B152DB59F0013C064 /* RegexKitLite.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
@@ -37,6 +37,8 @@
838CA71E152DB8A10013C064 /* discountWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA700152DB8A10013C064 /* discountWrapper.m */; };
838CA71F152DB8A10013C064 /* markdownWrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 838CA701152DB8A10013C064 /* markdownWrapper.c */; };
838CA720152DB8A10013C064 /* mkdioWrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 838CA703152DB8A10013C064 /* mkdioWrapper.c */; };
+ 838CA726152DBEEB0013C064 /* TPTemplateParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA725152DBEEB0013C064 /* TPTemplateParser.m */; };
+ 838CA729152DC02D0013C064 /* TPTemplateNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 838CA728152DC02D0013C064 /* TPTemplateNode.m */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -58,8 +60,8 @@
838CA670152DB08F0013C064 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
838CA673152DB08F0013C064 /* Tipi-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tipi-Prefix.pch"; sourceTree = "<group>"; };
838CA674152DB08F0013C064 /* Tipi.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = Tipi.1; sourceTree = "<group>"; };
- 838CA67C152DB0DA0013C064 /* TPParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPParser.h; sourceTree = "<group>"; };
- 838CA67D152DB0DA0013C064 /* TPParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPParser.m; sourceTree = "<group>"; };
+ 838CA67C152DB0DA0013C064 /* TPDataParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPDataParser.h; sourceTree = "<group>"; };
+ 838CA67D152DB0DA0013C064 /* TPInputParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPInputParser.m; sourceTree = "<group>"; };
838CA67F152DB11E0013C064 /* TPTextDataParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPTextDataParser.h; sourceTree = "<group>"; };
838CA680152DB11E0013C064 /* TPTextDataParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPTextDataParser.m; sourceTree = "<group>"; };
838CA683152DB39F0013C064 /* Test01.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Test01.txt; sourceTree = "<group>"; };
@@ -101,6 +103,12 @@
838CA702152DB8A10013C064 /* markdownWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = markdownWrapper.h; sourceTree = "<group>"; };
838CA703152DB8A10013C064 /* mkdioWrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mkdioWrapper.c; sourceTree = "<group>"; };
838CA704152DB8A10013C064 /* mkdioWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mkdioWrapper.h; sourceTree = "<group>"; };
+ 838CA723152DBE250013C064 /* Test01.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Test01.html; sourceTree = "<group>"; };
+ 838CA724152DBEEB0013C064 /* TPTemplateParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPTemplateParser.h; sourceTree = "<group>"; };
+ 838CA725152DBEEB0013C064 /* TPTemplateParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPTemplateParser.m; sourceTree = "<group>"; };
+ 838CA727152DC02D0013C064 /* TPTemplateNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPTemplateNode.h; sourceTree = "<group>"; };
+ 838CA728152DC02D0013C064 /* TPTemplateNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TPTemplateNode.m; sourceTree = "<group>"; };
+ 83C656BC152DD61500454E32 /* Test02.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Test02.html; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -145,7 +153,6 @@
838CA66F152DB08F0013C064 /* Tipi */ = {
isa = PBXGroup;
children = (
- 838CA692152DB8A00013C064 /* Discount */,
838CA682152DB39F0013C064 /* Tests */,
838CA67B152DB0BF0013C064 /* Tipi */,
838CA670152DB08F0013C064 /* main.m */,
@@ -176,6 +183,8 @@
isa = PBXGroup;
children = (
838CA683152DB39F0013C064 /* Test01.txt */,
+ 838CA723152DBE250013C064 /* Test01.html */,
+ 83C656BC152DD61500454E32 /* Test02.html */,
);
path = Tests;
sourceTree = SOURCE_ROOT;
@@ -245,12 +254,16 @@
838CA721152DBA4B0013C064 /* Parsers */ = {
isa = PBXGroup;
children = (
- 838CA67C152DB0DA0013C064 /* TPParser.h */,
- 838CA67D152DB0DA0013C064 /* TPParser.m */,
+ 838CA67C152DB0DA0013C064 /* TPDataParser.h */,
+ 838CA67D152DB0DA0013C064 /* TPInputParser.m */,
838CA67F152DB11E0013C064 /* TPTextDataParser.h */,
838CA680152DB11E0013C064 /* TPTextDataParser.m */,
838CA68F152DB7BA0013C064 /* TPMarkdownDataParser.h */,
838CA690152DB7BB0013C064 /* TPMarkdownDataParser.m */,
+ 838CA724152DBEEB0013C064 /* TPTemplateParser.h */,
+ 838CA725152DBEEB0013C064 /* TPTemplateParser.m */,
+ 838CA727152DC02D0013C064 /* TPTemplateNode.h */,
+ 838CA728152DC02D0013C064 /* TPTemplateNode.m */,
);
name = Parsers;
sourceTree = "<group>";
@@ -258,6 +271,7 @@
838CA722152DBA560013C064 /* Helpers */ = {
isa = PBXGroup;
children = (
+ 838CA692152DB8A00013C064 /* Discount */,
838CA68A152DB59F0013C064 /* RegexKitLite.h */,
838CA68B152DB59F0013C064 /* RegexKitLite.m */,
838CA687152DB55C0013C064 /* NSString+HiddenMemory.h */,
@@ -318,7 +332,7 @@
buildActionMask = 2147483647;
files = (
838CA671152DB08F0013C064 /* main.m in Sources */,
- 838CA67E152DB0DA0013C064 /* TPParser.m in Sources */,
+ 838CA67E152DB0DA0013C064 /* TPInputParser.m in Sources */,
838CA681152DB11E0013C064 /* TPTextDataParser.m in Sources */,
838CA689152DB55C0013C064 /* NSString+HiddenMemory.m in Sources */,
838CA68C152DB59F0013C064 /* RegexKitLite.m in Sources */,
@@ -344,6 +358,8 @@
838CA71E152DB8A10013C064 /* discountWrapper.m in Sources */,
838CA71F152DB8A10013C064 /* markdownWrapper.c in Sources */,
838CA720152DB8A10013C064 /* mkdioWrapper.c in Sources */,
+ 838CA726152DBEEB0013C064 /* TPTemplateParser.m in Sources */,
+ 838CA729152DC02D0013C064 /* TPTemplateNode.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -436,6 +452,7 @@
838CA67A152DB08F0013C064 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
View
2  Tipi/NSString+HiddenMemory.h
@@ -40,4 +40,6 @@
+ (NSString*)stringByCreatingWhitespaceOfLength:(NSInteger)length;
- (NSString*)stringByTrimmingWhitespace;
+- (NSString*)removePrefix:(NSString*)prefix suffix:(NSString*)suffix;
+
@end
View
15 Tipi/NSString+HiddenMemory.m
@@ -26,7 +26,6 @@ + (NSString*)bytesToHuman:(size_t)value {
return @"";
}
-
- (NSString *)stringByEncodingXMLEntities {
// Scanner
NSScanner *scanner = [[NSScanner alloc] initWithString:self];
@@ -275,4 +274,18 @@ - (NSString*)stringByTrimmingWhitespace {
return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
+- (NSString*)removePrefix:(NSString*)prefix suffix:(NSString*)suffix {
+ NSString *str = self;
+
+ if( [str hasPrefix:prefix] ) {
+ str = [str stringByReplacingCharactersInRange:NSMakeRange(0, [prefix length]) withString:@""];
+ }
+
+ if( [str hasSuffix:suffix] ) {
+ str = [str stringByReplacingCharactersInRange:NSMakeRange([str length] - [suffix length], [suffix length]) withString:@""];
+ }
+
+ return str;
+}
+
@end
View
2  Tipi/TPParser.h → Tipi/TPDataParser.h
@@ -8,6 +8,6 @@
#import <Foundation/Foundation.h>
-@interface TPParser : NSObject
+@interface TPDataParser : NSObject
- (NSDictionary*)values;
@end
View
4 Tipi/TPParser.m → Tipi/TPInputParser.m
@@ -6,9 +6,9 @@
// Copyright (c) 2012 hiddenMemory Ltd. All rights reserved.
//
-#import "TPParser.h"
+#import "TPDataParser.h"
-@implementation TPParser
+@implementation TPDataParser
- (NSDictionary*)values {
return [NSDictionary dictionary];
View
13 Tipi/TPMarkdownDataParser.m
@@ -16,7 +16,18 @@ - (NSDictionary*)values {
NSMutableDictionary *markdownValues = [NSMutableDictionary dictionary];
for( NSString *key in [values allKeys] ) {
- [markdownValues setObject:discountToHTML([values objectForKey:key]) forKey:key];
+ NSMutableString *htmlSnippet = [NSMutableString stringWithString:discountToHTML([values objectForKey:key])];
+
+ if( [htmlSnippet hasPrefix:@"<p>"] ) {
+ [htmlSnippet deleteCharactersInRange:NSMakeRange(0, [@"<p>" length])];
+ }
+ if( [htmlSnippet hasSuffix:@"</p>"] ) {
+ NSUInteger tagLength = [@"</p>" length];
+ [htmlSnippet deleteCharactersInRange:NSMakeRange([htmlSnippet length] - tagLength, tagLength)];
+ }
+
+ [markdownValues setObject:htmlSnippet
+ forKey:key];
}
return markdownValues;
View
27 Tipi/TPTemplateNode.h
@@ -0,0 +1,27 @@
+//
+// TPTemplateNode.h
+// Tipi
+//
+// Created by Chris Ross on 05/04/2012.
+// Copyright (c) 2012 hiddenMemory Ltd. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef enum {
+ TPNodeUnknown,
+ TPNodeText,
+ TPNodeDefinition,
+ TPNodeApplication
+} TPNodeType;
+
+@interface TPTemplateNode : NSObject
+@property (assign) TPNodeType type;
+@property (strong) NSString *originalValue;
+@property (strong) NSString *name;
+@property (readonly) NSMutableArray *values;
+@property (readonly) NSMutableArray *childNodes;
+
++ (TPTemplateNode*)node;
+- (NSString*)expansionUsingValues:(NSDictionary*)values;
+@end
View
73 Tipi/TPTemplateNode.m
@@ -0,0 +1,73 @@
+//
+// TPTemplateNode.m
+// Tipi
+//
+// Created by Chris Ross on 05/04/2012.
+// Copyright (c) 2012 hiddenMemory Ltd. All rights reserved.
+//
+
+#import "TPTemplateNode.h"
+#import "NSString+HiddenMemory.h"
+
+@implementation TPTemplateNode
+@synthesize type, originalValue, name, values, childNodes;
+
++ (TPTemplateNode*)node{
+ return [[TPTemplateNode alloc] init];
+}
+- (id)init {
+ self = [super init];
+ if( self ) {
+ self.type = TPNodeUnknown;
+ self.originalValue = @"";
+ self.name = @"";
+ values = [NSMutableArray array];
+ childNodes = [NSMutableArray array];
+ }
+ return self;
+}
+- (NSString*)descriptionWithDepth:(int)depth {
+ NSMutableString *description = nil;
+
+ if( self.type == TPNodeText ) {
+ description = [NSMutableString stringWithFormat:@"%@<Text> '%@'\n",
+ [NSString stringByCreatingWhitespaceOfLength:depth],
+ [self.originalValue stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]];
+ }
+ else {
+ description = [NSMutableString stringWithFormat:@"%@<Node> %@(%@)\n",
+ [NSString stringByCreatingWhitespaceOfLength:depth],
+ self.name,
+ [values componentsJoinedByString:@", "]];
+ }
+
+ for( TPTemplateNode *node in childNodes ) {
+ [description appendString:[node descriptionWithDepth:depth + 1]];
+ }
+
+ return description;
+}
+- (NSString*)description {
+ return [self descriptionWithDepth:0];
+}
+- (NSString*)expansionUsingValues:(NSDictionary*)_values {
+ NSMutableString *expansion = [NSMutableString string];
+
+ if( self.type == TPNodeText ) {
+ [expansion appendString:self.originalValue];
+ }
+ else {
+ NSString *key = [self.name lowercaseString];
+ if( [_values objectForKey:key] ) {
+ [expansion appendString:[_values objectForKey:key]];
+ }
+ }
+
+ for( TPTemplateNode *node in childNodes ) {
+ [expansion appendString:[node expansionUsingValues:_values]];
+ }
+
+ return expansion;
+}
+
+@end
View
14 Tipi/TPTemplateParser.h
@@ -0,0 +1,14 @@
+//
+// TPTemplateParser.h
+// Tipi
+//
+// Created by Chris Ross on 05/04/2012.
+// Copyright (c) 2012 hiddenMemory Ltd. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface TPTemplateParser : NSObject
++ (TPTemplateParser*)parserForFile:(NSString*)path;
+- (NSString*)expansionUsingValues:(NSDictionary*)values;
+@end
View
129 Tipi/TPTemplateParser.m
@@ -0,0 +1,129 @@
+//
+// TPTemplateParser.m
+// Tipi
+//
+// Created by Chris Ross on 05/04/2012.
+// Copyright (c) 2012 hiddenMemory Ltd. All rights reserved.
+//
+
+#import "TPTemplateParser.h"
+#import "TPTemplateNode.h"
+#import "NSString+HiddenMemory.h"
+
+@interface TPTemplateParser () {
+ TPTemplateNode *root;
+
+ NSString *tagStart, *tagEnd;
+ NSString *tagBlockOpen, *tagBlockClose;
+}
+- (id)initWithFileAtPath:(NSString*)path;
+- (void)parseContent:(NSMutableString*)content parent:(TPTemplateNode*)parent;
+- (void)parseTag:(NSMutableString*)content parent:(TPTemplateNode*)parent;
+@end
+
+@implementation TPTemplateParser
++ (TPTemplateParser*)parserForFile:(NSString*)path {
+ return [[[self class] alloc] initWithFileAtPath:path];
+}
+- (id)initWithFileAtPath:(NSString*)path {
+ self = [super init];
+ if( self ) {
+ root = [TPTemplateNode node];
+
+ tagStart = @"{{";
+ tagBlockOpen = @"#";
+ tagBlockClose = @"/";
+ tagEnd = @"}}";
+
+ NSMutableString *content = [NSMutableString stringWithContentsOfFile:path
+ encoding:NSUTF8StringEncoding
+ error:nil];
+
+ [self parseContent:content parent:root];
+
+ NSLog(@"Node: %@", [root description]);
+ }
+ return self;
+}
+- (NSString*)expansionUsingValues:(NSDictionary*)values {
+ return [root expansionUsingValues:values];
+}
+- (void)parseContent:(NSMutableString*)content parent:(TPTemplateNode*)parent {
+ while( [content length] ) {
+ NSLog(@"Content: '%@'", content);
+
+ NSRange range = [content rangeOfString:tagStart];
+ BOOL shouldParseTag = YES;
+
+ if( range.location == NSNotFound ) {
+ range.location = [content length];
+ shouldParseTag = NO;
+ }
+
+ TPTemplateNode *node = [TPTemplateNode node];
+ node.type = TPNodeText;
+ node.name = @"";
+ node.originalValue = [content substringToIndex:range.location];
+ [node.values addObject:node.originalValue];
+ [parent.childNodes addObject:node];
+
+ [content deleteCharactersInRange:NSMakeRange(0, range.location)];
+
+ if( shouldParseTag ) {
+ [self parseTag:content parent:parent];
+ }
+ }
+}
+- (void)parseTag:(NSMutableString*)content parent:(TPTemplateNode*)parent {
+ if( [content hasPrefix:tagStart] ) {
+ NSRange tagContentRange = [content rangeOfString:tagEnd];
+
+ if( tagContentRange.location != NSNotFound ) {
+ TPTemplateNode *node = [TPTemplateNode node];
+ node.originalValue = [content substringToIndex:tagContentRange.location + tagEnd.length];
+
+ NSMutableArray *parts = [NSMutableArray arrayWithArray:[[[node.originalValue removePrefix:tagStart suffix:tagEnd] stringByTrimmingWhitespace] componentsSeparatedByString:@" "]];
+
+ [content deleteCharactersInRange:NSMakeRange(0, node.originalValue.length)];
+
+ [parent.childNodes addObject:node];
+
+ if( [[parts objectAtIndex:0] hasPrefix:tagBlockOpen] ) {
+ if( [[parts objectAtIndex:0] isEqualToString:tagBlockOpen] ) {
+ [parts removeObjectAtIndex:0];
+ }
+ else {
+ [parts replaceObjectAtIndex:0 withObject:[[parts objectAtIndex:0] removePrefix:tagStart suffix:nil]];
+ }
+
+ node.type = TPNodeDefinition;
+ node.name = [parts objectAtIndex:0];
+
+ if( [parts count] > 1 ) {
+ [node.values addObjectsFromArray:[parts subarrayWithRange:NSMakeRange(1, [parts count] - 1)]];
+ }
+
+ [self parseContent:content parent:node];
+ }
+ else if( [[parts objectAtIndex:0] hasPrefix:tagBlockClose] ) {
+ if( [[parts objectAtIndex:0] isEqualToString:tagBlockClose] ) {
+ [parts removeObjectAtIndex:0];
+ }
+ else {
+ [parts replaceObjectAtIndex:0 withObject:[[parts objectAtIndex:0] removePrefix:tagBlockClose suffix:nil]];
+ }
+ }
+ else {
+ node.type = TPNodeApplication;
+ node.name = [parts objectAtIndex:0];
+ if( [parts count] > 1 ) {
+ [node.values addObjectsFromArray:[parts subarrayWithRange:NSMakeRange(1, [parts count] - 1)]];
+ }
+ }
+ }
+ else {
+ [NSException raise:@"TagParseError" format:@"Error parsing tag"];
+ }
+ }
+}
+@end
View
4 Tipi/TPTextDataParser.h
@@ -6,8 +6,8 @@
// Copyright (c) 2012 hiddenMemory Ltd. All rights reserved.
//
-#import "TPParser.h"
+#import "TPDataParser.h"
-@interface TPTextDataParser : TPParser
+@interface TPTextDataParser : TPDataParser
+ (TPTextDataParser*)parserForFile:(NSString*)path;
@end
View
4 Tipi/TPTextDataParser.m
@@ -46,13 +46,13 @@ - (id)initWithFile:(NSString *)path {
currentValue = [NSMutableString string];
}
- currentKey = [line substringToIndex:prefixRange.location];
+ currentKey = [[line substringToIndex:prefixRange.location] lowercaseString];
[currentValue appendString:[line substringFromIndex:prefixRange.location + 1]];
}
}
if( [currentKey isEqualToString:@""] == NO ) {
- [_values setObject:currentValue forKey:currentKey];
+ [_values setObject:currentValue forKey:[currentKey lowercaseString]];
}
for( NSString *key in [_values allKeys] ) {
View
8 Tipi/main.m
@@ -8,14 +8,18 @@
#import <Foundation/Foundation.h>
-#import "TPParser.h"
+#import "TPDataParser.h"
#import "TPMarkdownDataParser.h"
+#import "TPTemplateParser.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
- TPParser *p = [TPMarkdownDataParser parserForFile:@"/Users/chris/Repositories/git/hiddenMemory/Tipi/Tests/Test01.txt"];
+ TPDataParser *p = [TPMarkdownDataParser parserForFile:@"/Users/chris/Repositories/git/hiddenMemory/Tipi/Tests/Test01.txt"];
NSLog(@"p.values = %@", [p values]);
+
+ TPTemplateParser *q = [TPTemplateParser parserForFile:@"/Users/chris/Repositories/git/hiddenMemory/Tipi/Tests/Test02.html"];
+ NSLog(@"Expansion: %@", [q expansionUsingValues:p.values]);
}
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.