Permalink
Browse files

Added extra reference extension option for concrete OutputGenerators.

Subclasses can decide to use different reference extensions than generated file extensions. This is useful for markdown for example where we want references point to .html while file extensions to .markdown.
  • Loading branch information...
1 parent 23f72c5 commit 329b06724d0e787722eebea7176e9b0f7b348bb9 @tomaz committed Aug 20, 2009
Showing with 29 additions and 3 deletions.
  1. +12 −3 OutputGenerator.m
  2. +17 −0 OutputInfoProvider.h
View
@@ -9,6 +9,7 @@
#import "OutputGenerator.h"
#import "CommandLineParser.h"
#import "Systemator.h"
+#import "LoggingProvider.h"
@implementation OutputGenerator
@@ -54,13 +55,13 @@ - (NSString*) outputObjectFilenameForObject:(NSDictionary*) objectData
//----------------------------------------------------------------------------------------
- (NSString*) outputIndexFilename
{
- return [NSString stringWithFormat:@"index%@", [self outputFilesExtension]];
+ return [NSString stringWithFormat:@"index%@", [self outputReferencesExtension]];
}
//----------------------------------------------------------------------------------------
- (NSString*) outputHierarchyFilename
{
- return [NSString stringWithFormat:@"hierarchy%@", [self outputFilesExtension]];
+ return [NSString stringWithFormat:@"hierarchy%@", [self outputReferencesExtension]];
}
//----------------------------------------------------------------------------------------
@@ -70,6 +71,12 @@ - (NSString*) outputFilesExtension
}
//----------------------------------------------------------------------------------------
+- (NSString*) outputReferencesExtension
+{
+ return [self outputFilesExtension];
+}
+
+//----------------------------------------------------------------------------------------
- (NSString*) outputBasePath
{
return @"";
@@ -94,6 +101,8 @@ - (void) generateOutput
{
if (self.isOutputGenerationEnabled)
{
+ logNormal(@"Generating %@ output...", [[self outputBasePath] lastPathComponent]);
+
// Create required output directories.
[self createOutputDirectories];
@@ -173,7 +182,7 @@ - (void) registerDependentGenerator:(id<OutputProcessing>) generator
- (NSString*) pathByReplacingTemplatePlaceholdersInPath:(NSString*) path
{
return [path stringByReplacingOccurrencesOfString:kTKPlaceholderExtension
- withString:[self outputFilesExtension]];
+ withString:[self outputReferencesExtension]];
}
@end
View
@@ -62,14 +62,31 @@ can get all required information it needs.
/** Returns the output files extension.
+Output file extension is added to all generated output files.
+
@return Returns the output files extension.
+@see outputReferencesExtension
@see outputObjectFilenameForObject:
@see outputIndexFilename
@see outputHierarchyFilename
@see outputBasePath
*/
- (NSString*) outputFilesExtension;
+/** Returns the output references extension.
+
+References extension is used while generating the references inside output files. In]
+most cases this should be the same as @c outputFilesExtension().
+
+@return Returns the references files extension.
+@see outputFilesExtension
+@see outputObjectFilenameForObject:
+@see outputIndexFilename
+@see outputHierarchyFilename
+@see outputBasePath
+*/
+- (NSString*) outputReferencesExtension;
+
/** Returns the base path where output files are generated.
This is full path to the base directory under which all files are generated.

0 comments on commit 329b067

Please sign in to comment.