Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved documentation generation into Xcode project

  • Loading branch information...
commit 2d77e7a6b10d6409284651aadd64029c554e2860 1 parent c7b6561
@soffes soffes authored
View
3  .gitignore
@@ -5,3 +5,6 @@ build
*.perspectivev3
*.xcworkspace
xcuserdata
+.sass-cache
+Documentation/temp
+Documentation/Output
View
1,220 Documentation/Doxygen/doxyclean.py
@@ -0,0 +1,1220 @@
+#!/usr/bin/python
+
+# Copyright (c) 2008 Matthew Ball
+#
+# 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.
+
+import sys
+import os
+import fnmatch
+import re
+import errno
+from optparse import OptionParser
+from xml.dom import minidom
+
+def _mkdir(newdir):
+ if os.path.isdir(newdir):
+ pass
+ elif os.path.isfile(newdir):
+ raise OSError("a file with the same name as the desired " \
+ "dir, '%s', already exists." % newdir)
+ else:
+ head, tail = os.path.split(newdir)
+ if head and not os.path.isdir(head):
+ _mkdir(head)
+
+ if tail:
+ os.mkdir(newdir)
+
+def longestToShortestCompare(x, y):
+ if len(x) > len(y):
+ return -1
+ elif len(x) < len(y):
+ return 1
+ else:
+ return 0
+
+def fileIsDocumented(filePath):
+ # Only XML files can contain documentation information
+ if not os.path.splitext(filePath)[1] == ".xml":
+ return False
+
+ # Check if the object is documented
+ originaldoc = minidom.parse(filePath)
+ briefList = originaldoc.getElementsByTagName('briefdescription')
+ detailList = originaldoc.getElementsByTagName('detaileddescription')
+
+ for briefItem in briefList:
+ paraList = briefItem.getElementsByTagName('para')
+ if len(paraList) > 0:
+ return True
+
+ for detailItem in detailList:
+ paraList = detailItem.getElementsByTagName('para')
+ if len(paraList) > 0:
+ return True
+
+ return False
+
+def nameForFile(filePath):
+ if not os.path.splitext(filePath)[1] == ".xml":
+ return None
+
+ xmlDoc = minidom.parse(filePath)
+ return xmlDoc.getElementsByTagName("name")[0].firstChild.data
+
+def typeForFile(filePath):
+ if not os.path.splitext(filePath)[1] == ".xml":
+ return None
+
+ xmlDoc = minidom.parse(filePath)
+ return xmlDoc.getElementsByTagName("object")[0].attributes["kind"].value
+
+def cleanXML(filePath, outputDirectory):
+ if not fileIsDocumented(filePath):
+ return
+
+ fileName = os.path.split(filePath)[1]
+
+ global verbose
+ if verbose:
+ print "Cleaning " + fileName
+
+ _mkdir(outputDirectory)
+
+ # Perform the XSL Transform
+ tempPath = os.path.join(outputDirectory, fileName)
+ stylesheetPath = os.path.join(sys.path[0], "object.xslt")
+ os.system("xsltproc -o \"%s\" \"%s\" \"%s\"" % (tempPath, stylesheetPath, filePath))
+
+ # Load the new XML file to get some values from it
+ objectName = nameForFile(tempPath)
+ objectType = typeForFile(tempPath)
+
+ # Determine the appropriate subdirectory for the file
+ if objectType == "class":
+ finalPath = os.path.join(outputDirectory, "Classes")
+ elif objectType == "category":
+ finalPath = os.path.join(outputDirectory, "Categories")
+ elif objectType == "protocol":
+ finalPath = os.path.join(outputDirectory, "Protocols")
+ _mkdir(finalPath)
+
+ # Move the file to its final location
+ finalPath = os.path.join(finalPath, objectName + ".xml")
+ os.system("mv \"%s\" \"%s\"" % (tempPath, finalPath))
+
+def createIndexXML(directory):
+ outputPath = os.path.join(directory, "index.xml")
+ indexXML = minidom.Document()
+
+ projectElement = indexXML.createElement("project")
+ projectElement.setAttribute("name", "##PROJECT##")
+ indexXML.appendChild(projectElement)
+
+ # Add one element per file
+ for (path, dirs, files) in os.walk(directory):
+ for fileName in files:
+ # Only look at XML files
+ if not os.path.splitext(fileName)[1] == ".xml":
+ continue
+
+ # Get information about the file
+ filePath = os.path.join(path, fileName)
+ objectName = nameForFile(filePath)
+ objectType = typeForFile(filePath)
+
+ # Create an <object> element
+ objectElement = indexXML.createElement("object")
+ objectElement.setAttribute("kind", objectType)
+ projectElement.appendChild(objectElement)
+
+ # Create a <name> element
+ nameElement = indexXML.createElement("name")
+ objectElement.appendChild(nameElement)
+ nameText = indexXML.createTextNode(objectName)
+ nameElement.appendChild(nameText)
+
+ # Write the index file
+ f = open(outputPath, "w")
+ indexXML.writexml(f, "", "\t", "\n")
+ f.close()
+
+ return outputPath
+
+def linkify(directory, shouldEstablishIPhoneLinks):
+ indexFile = minidom.parse(os.path.join(directory, "index.xml"))
+ documentedObjects = indexFile.getElementsByTagName("name")
+
+ global verbose
+
+ # Get each file
+ for (path, dirs, files) in os.walk(directory):
+ for fileName in files:
+ # Skip the index and any non-xml files
+ if fileName == "index.xml" or not os.path.splitext(fileName)[1] == ".xml":
+ continue
+
+ filePath = os.path.join(path, fileName)
+
+ if verbose:
+ print "Linkifying " + fileName
+
+ f = open(filePath, "r")
+ fileContents = f.read()
+ f.close()
+
+ # Remove all refs initially
+ # We will recreate them ourselves
+ fileContents = re.sub("\\<ref(?: .*)?\\>(.*?)\\</ref\\>", "\\1", fileContents);
+
+ documentedTargets = {}
+
+ if not shouldEstablishIPhoneLinks:
+ if verbose:
+ print "Establishing links to Foundation"
+ macFoundationClasses = [
+ "NSAffineTransform",
+ "NSAppleEventDescriptor",
+ "NSAppleEventManager",
+ "NSAppleScript",
+ "NSArchiver",
+ "NSArray",
+ "NSAssertionHandler",
+ "NSAttributedString",
+ "NSAutoreleasePool",
+ "NSBlockOperation",
+ "NSBundle",
+ "NSCachedURLResponse",
+ "NSCalendar",
+ "NSCharacterSet",
+ "NSClassDescription",
+ "NSCloneCommand",
+ "NSCloseCommand",
+ "NSCoder",
+ "NSComparisonPredicate",
+ "NSCompoundPredicate",
+ "NSCondition",
+ "NSConditionLock",
+ "NSConnection",
+ "NSCountCommand",
+ "NSCountedSet",
+ "NSCreateCommand",
+ "NSData",
+ "NSDate",
+ "NSDateComponents",
+ "NSDateFormatter",
+ "NSDecimalNumber",
+ "NSDecimalNumberHandler",
+ "NSDeleteCommand",
+ "NSDeserializer",
+ "NSDictionary",
+ "NSDirectoryEnumerator",
+ "NSDistantObject",
+ "NSDistantObjectRequest",
+ "NSDistributedLock",
+ "NSDistributedNotificationCenter",
+ "NSEnumerator",
+ "NSError",
+ "NSException",
+ "NSExistsCommand",
+ "NSExpression",
+ "NSFileHandle",
+ "NSFileManager",
+ "NSFormatter",
+ "NSGarbageCollector",
+ "NSGetCommand",
+ "NSHashTable",
+ "NSHost",
+ "NSHTTPCookie",
+ "NSHTTPCookieStorage",
+ "NSHTTPURLResponse",
+ "NSIndexPath",
+ "NSIndexSet",
+ "NSIndexSpecifier",
+ "NSInputStream",
+ "NSInvocation",
+ "NSInvocationOperation",
+ "NSKeyedArchiver",
+ "NSKeyedUnarchiver",
+ "NSLocale",
+ "NSLock",
+ "NSLogicalTest",
+ "NSMachBootstrapServer",
+ "NSMachPort",
+ "NSMapTable",
+ "NSMessagePort",
+ "NSMessagePortNameServer",
+ "NSMetadataItem",
+ "NSMetadataQuery",
+ "NSMetadataQueryAttributeValueTuple",
+ "NSMetadataQueryResultGroup",
+ "NSMethodSignature",
+ "NSMiddleSpecifier",
+ "NSMoveCommand",
+ "NSMutableArray",
+ "NSMutableAttributedString",
+ "NSMutableCharacterSet",
+ "NSMutableData",
+ "NSMutableDictionary",
+ "NSMutableIndexSet",
+ "NSMutableSet",
+ "NSMutableString",
+ "NSMutableURLRequest",
+ "NSNameSpecifier",
+ "NSNetService",
+ "NSNetServiceBrowser",
+ "NSNotification",
+ "NSNotificationCenter",
+ "NSNotificationQueue",
+ "NSNull",
+ "NSNumber",
+ "NSNumberFormatter",
+ "NSObject",
+ "NSOperation",
+ "NSOperationQueue",
+ "NSOrthography",
+ "NSOutputStream",
+ "NSPipe",
+ "NSPointerArray",
+ "NSPointerFunctions",
+ "NSPort",
+ "NSPortCoder",
+ "NSPortMessage",
+ "NSPortNameServer",
+ "NSPositionalSpecifier",
+ "NSPredicate",
+ "NSProcessInfo",
+ "NSPropertyListSerialization",
+ "NSPropertySpecifier",
+ "NSProtocolChecker",
+ "NSProxy",
+ "NSQuitCommand",
+ "NSRandomSpecifier",
+ "NSRangeSpecifier",
+ "NSRecursiveLock",
+ "NSRelativeSpecifier",
+ "NSRunLoop",
+ "NSScanner",
+ "NSScriptClassDescription",
+ "NSScriptCoercionHandler",
+ "NSScriptCommand",
+ "NSScriptCommandDescription",
+ "NSScriptExecutionContext",
+ "NSScriptObjectSpecifier",
+ "NSScriptSuiteRegistry",
+ "NSScriptWhoseTest",
+ "NSSerializer",
+ "NSSet",
+ "NSSetCommand",
+ "NSSocketPort",
+ "NSSocketPortNameServer",
+ "NSSortDescriptor",
+ "NSSpecifierTest",
+ "NSSpellServer",
+ "NSStream",
+ "NSString",
+ "NSTask",
+ "NSTextCheckingResult",
+ "NSThread",
+ "NSTimer",
+ "NSTimeZone",
+ "NSUnarchiver",
+ "NSUndoManager",
+ "NSUniqueIDSpecifier",
+ "NSURL",
+ "NSURLAuthenticationChallenge",
+ "NSURLCache",
+ "NSURLConnection",
+ "NSURLCredential",
+ "NSURLCredentialStorage",
+ "NSURLDownload",
+ "NSURLHandle",
+ "NSURLProtectionSpace",
+ "NSURLProtocol",
+ "NSURLRequest",
+ "NSURLResponse",
+ "NSUserDefaults",
+ "NSValue",
+ "NSValueTransformer",
+ "NSWhoseSpecifier",
+ "NSXMLDocument",
+ "NSXMLDTD",
+ "NSXMLDTDNode",
+ "NSXMLElement",
+ "NSXMLNode",
+ "NSXMLParser"]
+ documentedTargets.update(dict.fromkeys(macFoundationClasses, "http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/{name}_Class/index"))
+
+ macFoundationProtocols = [
+ "NSCoding",
+ "NSComparisonMethods",
+ "NSConnectionDelegate",
+ "NSCopying",
+ "NSDecimalNumberBehaviors",
+ "NSErrorRecoveryAttempting",
+ "NSFastEnumeration",
+ "NSKeyedArchiverDelegate",
+ "NSKeyedUnarchiverDelegate",
+ "NSKeyValueCoding",
+ "NSKeyValueObserving",
+ "NSLocking",
+ "NSMachPortDelegate",
+ "NSMetadataQueryDelegate",
+ "NSMutableCopying",
+ "NSNetServiceBrowserDelegate",
+ "NSNetServiceDelegate",
+ "NSObjCTypeSerializationCallBack",
+ # "NSObject", # No way to tell if the class or protocol should be
+ # linked, so assume the class
+ "NSPortDelegate",
+ "NSScriptingComparisonMethods",
+ "NSScriptKeyValueCoding",
+ "NSScriptObjectSpecifiers",
+ "NSSpellServerDelegate",
+ "NSStreamDelegate",
+ "NSURLAuthenticationChallengeSender",
+ "NSURLHandleClient",
+ "NSURLProtocolClient",
+ "NSXMLParserDelegate"]
+ documentedTargets.update(dict.fromkeys(macFoundationProtocols, "http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Protocols/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to AppKit"
+ macAppKitClasses = [
+ "NSActionCell",
+ "NSAlert",
+ "NSAnimation",
+ "NSAnimationContext",
+ "NSApplication",
+ "NSArrayController",
+ "NSATSTypesetter",
+ "NSBezierPath",
+ "NSBitmapImageRep",
+ "NSBox",
+ "NSBrowser",
+ "NSBrowserCell",
+ "NSButton",
+ "NSButtonCell",
+ "NSCachedImageRep",
+ "NSCell",
+ "NSCIImageRep",
+ "NSClipView",
+ "NSCollectionView",
+ "NSCollectionViewItem",
+ "NSColor",
+ "NSColorList",
+ "NSColorPanel",
+ "NSColorPicker",
+ "NSColorSpace",
+ "NSColorWell",
+ "NSComboBox",
+ "NSComboBoxCell",
+ "NSControl",
+ "NSController",
+ "NSCursor",
+ "NSCustomImageRep",
+ "NSDatePicker",
+ "NSDatePickerCell",
+ "NSDictionaryController",
+ "NSDockTile",
+ "NSDocument",
+ "NSDocumentController",
+ "NSDrawer",
+ "NSEPSImageRep",
+ "NSEvent",
+ "NSFileWrapper",
+ "NSFont",
+ "NSFontDescriptor",
+ "NSFontManager",
+ "NSFontPanel",
+ "NSForm",
+ "NSFormCell",
+ "NSGlyphGenerator",
+ "NSGlyphInfo",
+ "NSGradient",
+ "NSGraphicsContext",
+ "NSHelpManager",
+ "NSImage",
+ "NSImageCell",
+ "NSImageRep",
+ "NSImageView",
+ "NSLayoutManager",
+ "NSLevelIndicator",
+ "NSLevelIndicatorCell",
+ "NSMatrix",
+ "NSMenu",
+ "NSMenuItem",
+ "NSMenuItemCell",
+ "NSMenuView",
+ "NSMutableParagraphStyle",
+ "NSNib",
+ "NSNibConnector",
+ "NSNibControlConnector",
+ "NSNibOutletConnector",
+ "NSObjectController",
+ "NSOpenGLContext",
+ "NSOpenGLLayer",
+ "NSOpenGLPixelBuffer",
+ "NSOpenGLPixelFormat",
+ "NSOpenGLView",
+ "NSOpenPanel",
+ "NSOutlineView",
+ "NSPageLayout",
+ "NSPanel",
+ "NSParagraphStyle",
+ "NSPasteboard",
+ "NSPasteboardItem",
+ "NSPathCell",
+ "NSPathComponentCell",
+ "NSPathControl",
+ "NSPDFImageRep",
+ "NSPersistentDocument",
+ "NSPICTImageRep",
+ "NSPopUpButton",
+ "NSPopUpButtonCell",
+ "NSPredicateEditor",
+ "NSPredicateEditorRowTemplate",
+ "NSPrinter",
+ "NSPrintInfo",
+ "NSPrintOperation",
+ "NSPrintPanel",
+ "NSProgressIndicator",
+ "NSResponder",
+ "NSRuleEditor",
+ "NSRulerMarker",
+ "NSRulerView",
+ "NSRunningApplication",
+ "NSSavePanel",
+ "NSScreen",
+ "NSScroller",
+ "NSScrollView",
+ "NSSearchField",
+ "NSSearchFieldCell",
+ "NSSecureTextField",
+ "NSSecureTextFieldCell",
+ "NSSegmentedCell",
+ "NSSegmentedControl",
+ "NSShadow",
+ "NSSlider",
+ "NSSliderCell",
+ "NSSound",
+ "NSSpeechRecognizer",
+ "NSSpeechSynthesizer",
+ "NSSpellChecker",
+ "NSSplitView",
+ "NSStatusBar",
+ "NSStatusItem",
+ "NSStepper",
+ "NSStepperCell",
+ "NSTableColumn",
+ "NSTableHeaderCell",
+ "NSTableHeaderView",
+ "NSTableView",
+ "NSTabView",
+ "NSTabViewItem",
+ "NSText",
+ "NSTextAttachment",
+ "NSTextAttachmentCell",
+ "NSTextBlock",
+ "NSTextContainer",
+ "NSTextField",
+ "NSTextFieldCell",
+ "NSTextInputContext",
+ "NSTextList",
+ "NSTextStorage",
+ "NSTextTab",
+ "NSTextTable",
+ "NSTextTableBlock",
+ "NSTextView",
+ "NSTokenField",
+ "NSTokenFieldCell",
+ "NSToolbar",
+ "NSToolbarItem",
+ "NSToolbarItemGroup",
+ "NSTouch",
+ "NSTrackingArea",
+ "NSTreeController",
+ "NSTreeNode",
+ "NSTypesetter",
+ "NSUserDefaultsController",
+ "NSView",
+ "NSViewAnimation",
+ "NSViewController",
+ "NSWindow",
+ "NSWindowController",
+ "NSWorkspace"]
+ documentedTargets.update(dict.fromkeys(macAppKitClasses, "http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/{name}_Class/index"))
+
+ macAppKitProtocols = [
+ "NSAccessibility",
+ "NSAlertDelegate",
+ "NSAnimatablePropertyContainer",
+ "NSAnimationDelegate",
+ "NSApplicationDelegate",
+ "NSBrowserDelegate",
+ "NSChangeSpelling",
+ "NSCollectionViewDelegate",
+ "NSColorPickingCustom",
+ "NSColorPickingDefault",
+ "NSComboBoxCellDataSource",
+ "NSComboBoxDataSource",
+ "NSComboBoxDelegate",
+ "NSControlTextEditingDelegate",
+ "NSDatePickerCellDelegate",
+ "NSDictionaryControllerKeyValuePair",
+ "NSDockTilePlugIn",
+ "NSDraggingDestination",
+ "NSDraggingInfo",
+ "NSDraggingSource",
+ "NSDrawerDelegate",
+ "NSEditor",
+ "NSEditorRegistration",
+ "NSFontPanelValidation",
+ "NSGlyphStorage",
+ "NSIgnoreMisspelledWords",
+ "NSImageDelegate",
+ "NSKeyValueBindingCreation",
+ "NSLayoutManagerDelegate",
+ "NSMatrixDelegate",
+ "NSMenuDelegate",
+ "NSMenuValidation",
+ "NSNibAwaking",
+ "NSOpenSavePanelDelegate",
+ "NSOutlineViewDataSource",
+ "NSOutlineViewDelegate",
+ "NSPasteboardItemDataProvider",
+ "NSPasteboardReading",
+ "NSPasteboardWriting",
+ "NSPathCellDelegate",
+ "NSPathControlDelegate",
+ "NSPlaceholders",
+ "NSPrintPanelAccessorizing",
+ "NSRuleEditorDelegate",
+ "NSServicesRequests",
+ "NSSoundDelegate",
+ "NSSpeechRecognizerDelegate",
+ "NSSpeechSynthesizerDelegate",
+ "NSSplitViewDelegate",
+ "NSTableViewDataSource",
+ "NSTableViewDelegate",
+ "NSTabViewDelegate",
+ "NSTextAttachmentCell",
+ "NSTextDelegate",
+ "NSTextFieldDelegate",
+ "NSTextInput",
+ "NSTextInputClient",
+ "NSTextViewDelegate",
+ "NSTokenFieldCellDelegate",
+ "NSTokenFieldDelegate",
+ "NSToolbarDelegate",
+ "NSToolbarItemValidation",
+ "NSToolTipOwner",
+ "NSUserInterfaceValidations",
+ "NSValidatedUserInterfaceItem",
+ "NSWindowDelegate",
+ "NSWindowScripting"]
+ documentedTargets.update(dict.fromkeys(macAppKitProtocols, "http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Protocols/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to Address Book"
+ macAddressBookClasses = [
+ "ABAddressBook",
+ "ABGroup",
+ "ABMultiValue",
+ "ABMutableMultiValue",
+ "ABPeoplePickerView",
+ "ABPerson",
+ "ABRecord",
+ "ABSearchElement"]
+ documentedTargets.update(dict.fromkeys(macAddressBookClasses, "http://developer.apple.com/mac/library/documentation/UserExperience/Reference/AddressBook/Classes/{name}_Class/index"))
+
+ macAddressBookProtocols = [
+ "ABActionDelegate",
+ "ABImageClient"]
+ documentedTargets.update(dict.fromkeys(macAddressBookProtocols, "http://developer.apple.com/mac/library/documentation/UserExperience/Reference/AddressBook/Protocols/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to Core Data"
+ macCoreDataClasses = [
+ "NSAttributeDescription",
+ "NSEntityDescription",
+ "NSFetchedPropertyDescription",
+ "NSFetchRequestExpression",
+ "NSManagedObject",
+ "NSManagedObjectContext",
+ "NSManagedObjectID",
+ "NSManagedObjectModel",
+ "NSPersistentStoreCoordinator",
+ "NSPropertyDescription",
+ "NSRelationshipDescription"]
+ documentedTargets.update(dict.fromkeys(macCoreDataClasses, "http://developer.apple.com/mac/library/documentation/Cocoa/Reference/CoreDataFramework/Classes/{name}_Class/index"))
+
+ # For whatever reason, some Core Data classes aren't at the same location as the others
+ macOtherCoreDataClasses = [
+ "NSAtomicStore",
+ "NSAtomicStoreCacheNode",
+ "NSEntityMapping",
+ "NSEntityMigrationPolicy",
+ "NSExpressionDescription",
+ "NSFetchRequest",
+ "NSMappingModel",
+ "NSMigrationManager",
+ "NSPersistentStore",
+ "NSPropertyMapping"]
+ documentedTargets.update(dict.fromkeys(macOtherCoreDataClasses, "http://developer.apple.com/mac/library/documentation/Cocoa/Reference/{name}_Class/index"))
+
+ if verbose:
+ print "Establishing links to Core Location"
+ macCoreLocationClasses = [
+ "CLLocation",
+ "CLLocationManager"]
+ documentedTargets.update(dict.fromkeys(macCoreLocationClasses, "http://developer.apple.com/mac/library/documentation/CoreLocation/Reference/{name}_Class/index"))
+
+ macCoreLocationProtocols = [
+ "CLLocationManagerDelegate"]
+ documentedTargets.update(dict.fromkeys(macCoreLocationProtocols, "http://developer.apple.com/mac/library/documentation/CoreLocation/Reference/{name}_Protocol/index"))
+
+ else:
+ if verbose:
+ print "Establishing links to Foundation"
+ iphoneFoundationClasses = [
+ "NSArray",
+ "NSAssertionHandler",
+ "NSAutoreleasePool",
+ "NSBundle",
+ "NSCachedURLResponse",
+ "NSCalendar",
+ "NSCharacterSet",
+ "NSCoder",
+ "NSComparisonPredicate",
+ "NSCompoundPredicate",
+ "NSCondition",
+ "NSConditionLock",
+ "NSCountedSet",
+ "NSData",
+ "NSDate",
+ "NSDateComponents",
+ "NSDateFormatter",
+ "NSDecimalNumber",
+ "NSDecimalNumberHandler",
+ "NSDictionary",
+ "NSDirectoryEnumerator",
+ "NSDistributedNotificationCenter",
+ "NSEnumerator",
+ "NSError",
+ "NSException",
+ "NSExpression",
+ "NSFileHandle",
+ "NSFileManager",
+ "NSFormatter",
+ "NSHTTPCookie",
+ "NSHTTPCookieStorage",
+ "NSHTTPURLResponse",
+ "NSIndexPath",
+ "NSIndexSet",
+ "NSInputStream",
+ "NSInvocation",
+ "NSInvocationOperation",
+ "NSKeyedArchiver",
+ "NSKeyedUnarchiver",
+ "NSLocale",
+ "NSLock",
+ "NSMachPort",
+ "NSMessagePort",
+ "NSMethodSignature",
+ "NSMutableArray",
+ "NSMutableCharacterSet",
+ "NSMutableData",
+ "NSMutableDictionary",
+ "NSMutableIndexSet",
+ "NSMutableSet",
+ "NSMutableString",
+ "NSMutableURLRequest",
+ "NSNetService",
+ "NSNetServiceBrowser",
+ "NSNotification",
+ "NSNotificationCenter",
+ "NSNotificationQueue",
+ "NSNull",
+ "NSNumber",
+ "NSNumberFormatter",
+ "NSObject",
+ "NSOperation",
+ "NSOperationQueue",
+ "NSOutputStream",
+ "NSPipe",
+ "NSPort",
+ "NSPredicate",
+ "NSProcessInfo",
+ "NSPropertyListSerialization",
+ "NSProxy",
+ "NSRecursiveLock",
+ "NSRunLoop",
+ "NSScanner",
+ "NSSet",
+ "NSSortDescriptor",
+ "NSStream",
+ "NSString",
+ "NSThread",
+ "NSTimer",
+ "NSTimeZone",
+ "NSUndoManager",
+ "NSURL",
+ "NSURLAuthenticationChallenge",
+ "NSURLCache",
+ "NSURLConnection",
+ "NSURLCredential",
+ "NSURLCredentialStorage",
+ "NSURLProtectionSpace",
+ "NSURLProtocol",
+ "NSURLRequest",
+ "NSURLResponse",
+ "NSUserDefaults",
+ "NSValue",
+ "NSValueTransformer",
+ "NSXMLParser"]
+ documentedTargets.update(dict.fromkeys(iphoneFoundationClasses, "http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/{name}_Class/index"))
+
+ iphoneFoundationProtocols = [
+ "NSCoding",
+ "NSCopying",
+ "NSDecimalNumberBehaviors",
+ "NSErrorRecoveryAttempting",
+ "NSFastEnumeration",
+ "NSKeyValueCoding",
+ "NSKeyValueObserving",
+ "NSLocking",
+ "NSMutableCopying",
+ "NSObject",
+ "NSURLAuthenticationChallengeSender",
+ "NSURLProtocolClient"]
+ documentedTargets.update(dict.fromkeys(iphoneFoundationProtocols, "http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Protocols/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to AddressBook"
+ iphoneAddressBookClasses = [
+ "ABAddressBook",
+ "ABMultiValue",
+ "ABMutableMultiValue",
+ "ABRecord"]
+ documentedTargets.update(dict.fromkeys(iphoneAddressBookClasses, "http://developer.apple.com/iphone/library/documentation/AddressBook/Reference/{name}Ref_iPhoneOS/index"))
+
+ if verbose:
+ print "Establishing links to AddressBookUI"
+ iphoneAddressBookUIClasses = [
+ "ABNewPersonViewController",
+ "ABPeoplePickerNavigationController",
+ "ABPersonViewController",
+ "ABUnknownPersonViewController"]
+ documentedTargets.update(dict.fromkeys(iphoneAddressBookUIClasses, "http://developer.apple.com/iphone/library/documentation/AddressBookUI/Reference/{name}_Class/index"))
+
+ iphoneAddressBookUIProtocols = [
+ "ABNewPersonViewControllerDelegate",
+ "ABPeoplePickerNavigationControllerDelegate",
+ "ABPersonViewControllerDelegate",
+ "ABUnknownPersonViewControllerDelegate"]
+ documentedTargets.update(dict.fromkeys(iphoneAddressBookUIProtocols, "http://developer.apple.com/iphone/library/documentation/AddressBookUI/Reference/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to Core Data"
+ iphoneCoreDataClasses = [
+ "NSAttributeDescription",
+ "NSEntityDescription",
+ "NSFetchedPropertyDescription",
+ "NSFetchRequest",
+ "NSManagedObject",
+ "NSManagedObjectContext",
+ "NSManagedObjectID",
+ "NSManagedObjectModel",
+ "NSPersistentStoreCoordinator",
+ "NSPropertyDescription",
+ "NSRelationshipDescription"]
+ documentedTargets.update(dict.fromkeys(iphoneCoreDataClasses, "http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/CoreDataFramework/Classes/{name}_Class/index"))
+
+ # For some reason, certain Core Data docs are at a different URL
+ iphoneOtherCoreDataClasses = [
+ "NSAtomicStore",
+ "NSAtomicStoreCacheNode",
+ "NSEntityMapping",
+ "NSEntityMigrationPolicy",
+ "NSExpressionDescription",
+ "NSFetchedResultsController",
+ "NSFetchRequestExpression",
+ "NSMappingModel",
+ "NSMigrationManager",
+ "NSPersistentStore",
+ "NSPropertyMapping"]
+ documentedTargets.update(dict.fromkeys(iphoneOtherCoreDataClasses, "http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/{name}_Class/index"))
+
+ iphoneCoreDataProtocols = [
+ "NSFetchedResultsControllerDelegate",
+ "NSFetchedResultsSectionInfo"]
+ documentedTargets.update(dict.fromkeys(iphoneCoreDataProtocols, "http://developer.apple.com/iphone/library/documentation/CoreData/Reference/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to Core Location"
+ iphoneCoreLocationClasses = [
+ "CLHeading",
+ "CLLocation",
+ "CLLocationManager"]
+ documentedTargets.update(dict.fromkeys(iphoneCoreLocationClasses, "http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/{name}_Class/index"))
+
+ iphoneCoreLocationProtocols = [
+ "CLLocationManagerDelegate"]
+ documentedTargets.update(dict.fromkeys(iphoneCoreLocationProtocols, "http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/{name}_Protocol/index"))
+
+
+ if verbose:
+ print "Establishing links to GameKit"
+ iphoneGameKitClasses = [
+ "GKPeerPickerController",
+ "GKSession",
+ "GKVoiceChatService"]
+ documentedTargets.update(dict.fromkeys(iphoneGameKitClasses, "http://developer.apple.com/iphone/library/documentation/GameKit/Reference/{name}_Class/index"))
+
+ iphoneGameKitProtocols = [
+ "GKPeerPickerControllerDelegate",
+ "GKSessionDelegate",
+ "GKVoiceChatClient"]
+ documentedTargets.update(dict.fromkeys(iphoneGameKitProtocols, "http://developer.apple.com/iphone/library/documentation/GameKit/Reference/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to MapKit"
+ iphoneMapKitClasses = [
+ "MKAnnotationView",
+ "MKMapView",
+ "MKPinAnnotationView",
+ "MKPlacemark",
+ "MKReverseGeocoder",
+ "MKUserLocation"]
+ documentedTargets.update(dict.fromkeys(iphoneMapKitClasses, "http://developer.apple.com/iphone/library/documentation/MapKit/Reference/{name}_Class/index"))
+
+ iphoneMapKitProtocols = [
+ "MKAnnotation",
+ "MKMapViewDelegate",
+ "MKReverseGeocoderDelegate"]
+ documentedTargets.update(dict.fromkeys(iphoneMapKitProtocols, "http://developer.apple.com/iphone/library/documentation/MapKit/Reference/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to MessageUI"
+ iphoneMessageUIClasses = [
+ "MFMailComposeViewController"]
+ documentedTargets.update(dict.fromkeys(iphoneMessageUIClasses, "http://developer.apple.com/iphone/library/documentation/MessageUI/Reference/{name}_Class/index"))
+
+ iphoneMessageUIProtocols = [
+ "MFMailComposeViewControllerDelegate"]
+ documentedTargets.update(dict.fromkeys(iphoneMessageUIProtocols, "http://developer.apple.com/iphone/library/documentation/MessageUI/Reference/{name}_Protocol/index"))
+
+ if verbose:
+ print "Establishing links to StoreKit"
+ iphoneStoreKitClasses = [
+ "SKMutablePayment",
+ "SKPayment",
+ "SKPaymentQueue",
+ "SKPaymentTransaction"]
+ documentedTargets.update(dict.fromkeys(iphoneStoreKitClasses, "http://developer.apple.com/iphone/library/documentation/StoreKit/Reference/{name}_Class/index"))
+
+ # For whatever reason, this one class gets to live somewhere else...
+ iphoneOtherStoreKitClasses = [
+ "SKProduct"]
+ documentedTargets.update(dict.fromkeys(iphoneOtherStoreKitClasses, "http://developer.apple.com/iphone/library/documentation/StoreKit/Reference/{name}_Reference/index"))
+
+ iphoneStoreKitProtocols = [
+ "SKPaymentTransactionObserver"]
+ documentedTargets.update(dict.fromkeys(iphoneStoreKitProtocols, "http://developer.apple.com/iphone/library/documentation/StoreKit/Reference/{name}_Protocol/index"))
+
+ # REALLY?!?
+ iphoneWeirdStoreKitClassesAndProtocols = [
+ "SKProductsRequest",
+ "SKProductsResponse",
+ "SKRequest",
+ "SKProductsRequestDelegate",
+ "SKRequestDelegate"]
+ documentedTargets.update(dict.fromkeys(iphoneWeirdStoreKitClassesAndProtocols, "http://developer.apple.com/iphone/library/documentation/StoreKit/Reference/{name}/index"))
+
+ if verbose:
+ print "Establishing links to UIKit"
+ iphoneUIKitClasses = [
+ "UIAcceleration",
+ "UIAccelerometer",
+ "UIAccessibilityElement",
+ "UIActionSheet",
+ "UIActivityIndicatorView",
+ "UIAlertView",
+ "UIApplication",
+ "UIBarButtonItem",
+ "UIBarItem",
+ "UIButton",
+ "UIColor",
+ "UIControl",
+ "UIDatePicker",
+ "UIDevice",
+ "UIEvent",
+ "UIFont",
+ "UIImage",
+ "UIImagePickerController",
+ "UIImageView",
+ "UILabel",
+ "UILocalizedIndexedCollation",
+ "UIMenuController",
+ "UINavigationBar",
+ "UINavigationController",
+ "UINavigationItem",
+ "UIPageControl",
+ "UIPasteboard",
+ "UIPickerView",
+ "UIProgressView",
+ "UIResponder",
+ "UIScreen",
+ "UIScrollView",
+ "UISearchBar",
+ "UISearchDisplayController",
+ "UISegmentedControl",
+ "UISlider",
+ "UISwitch",
+ "UITabBar",
+ "UITabBarController",
+ "UITabBarItem",
+ "UITableView",
+ "UITableViewCell",
+ "UITableViewController",
+ "UITextField",
+ "UITextView",
+ "UIToolbar",
+ "UITouch",
+ "UIVideoEditorController",
+ "UIView",
+ "UIViewController",
+ "UIWebView",
+ "UIWindow"]
+ documentedTargets.update(dict.fromkeys(iphoneUIKitClasses, "http://developer.apple.com/iphone/library/documentation/UIKit/Reference/{name}_Class/index"))
+
+ iphoneUIKitProtocols = [
+ "UIAccelerometerDelegate",
+ "UIAccessibility",
+ "UIAccessibilityContainer",
+ "UIActionSheetDelegate",
+ "UIAlertViewDelegate",
+ "UIApplicationDelegate",
+ "UIImagePickerControllerDelegate",
+ "UINavigationBarDelegate",
+ "UINavigationControllerDelegate",
+ "UIPickerViewDataSource",
+ "UIPickerViewDelegate",
+ "UIResponderStandardEditActions",
+ "UIScrollViewDelegate",
+ "UISearchBarDelegate",
+ "UISearchDisplayDelegate",
+ "UITabBarControllerDelegate",
+ "UITabBarDelegate",
+ "UITableViewDataSource",
+ "UITableViewDelegate",
+ "UITextFieldDelegate",
+ "UITextInputTraits",
+ "UITextViewDelegate",
+ "UIVideoEditorControllerDelegate",
+ "UIWebViewDelegate"]
+ documentedTargets.update(dict.fromkeys(iphoneUIKitProtocols, "http://developer.apple.com/iphone/library/documentation/UIKit/Reference/{name}_Protocol/index"))
+
+
+ # Establish links to all files in the project
+ for documentedObject in documentedObjects:
+ # We need to get rid of whitespace
+ # (It's a "feature" of minidom)
+ objectName = documentedObject.firstChild.data.replace("\n", "").replace("\t", "")
+ objectType = documentedObject.parentNode.attributes["kind"].value
+
+ if objectType == "class":
+ target = "../Classes/{name}"
+ elif objectType == "category":
+ target = "../Categories/{name}"
+ elif objectType == "protocol":
+ target = "../Protocols/{name}"
+
+ documentedTargets[objectName] = target
+
+ documentedTargetNames = documentedTargets.keys()
+ documentedTargetNames.sort(cmp=longestToShortestCompare)
+ documentedTargetsPattern = "([^\\<\\>]*)(" + '|'.join(documentedTargetNames) + ")"
+ fileContents = re.sub(documentedTargetsPattern, "\\1<ref>\\2</ref>", fileContents)
+
+ fileDOM = minidom.parseString(fileContents)
+ refNodes = fileDOM.getElementsByTagName("ref")
+ for refNode in refNodes:
+ # If it's within the top-level <name> or <file> elements,
+ # remove the <ref>
+ # This is no longer checked in the regex since <name> or <file>
+ # could feasibly be used in other contexts (ie: inheritance lists)
+ if ((refNode.parentNode.tagName == "name") or (refNode.parentNode.tagName == "file")) and (refNode.parentNode.parentNode.tagName == "object"):
+ textNode = fileDOM.createTextNode(refNode.childNodes[0].nodeValue)
+ refNode.parentNode.replaceChild(textNode, refNode)
+ continue
+
+ refName = refNode.childNodes[0].nodeValue
+ formatString = documentedTargets[refName]
+ refTarget = formatString.format(name=refName)
+ refNode.setAttribute("id", refTarget)
+
+ # Write the xml file
+ f = open(filePath, "w")
+ f.write(fileDOM.toxml("UTF-8"))
+ f.close()
+
+def convertToHTML(filePath, outputDirectory):
+ global verbose
+
+ # Get info about the object
+ objectName = nameForFile(filePath)
+ objectType = typeForFile(filePath)
+
+ if verbose:
+ print "Converting " + objectName + ".html"
+
+ if objectType == "class":
+ outputDirectory = os.path.join(outputDirectory, "Classes")
+ elif objectType == "category":
+ outputDirectory = os.path.join(outputDirectory, "Categories")
+ elif objectType == "protocol":
+ outputDirectory = os.path.join(outputDirectory, "Protocols")
+ _mkdir(outputDirectory)
+
+ outputPath = os.path.join(outputDirectory, objectName + ".html")
+
+ stylesheetPath = sys.path[0] + '/object2html.xslt'
+ os.system("xsltproc -o \"%s\" \"%s\" \"%s\"" % (outputPath, stylesheetPath, filePath))
+
+def convertIndexToHTML(filePath, outputDirectory):
+ # Create the index html file
+ stylesheetPath = sys.path[0] + '/index2html.xslt'
+ outputPath = outputDirectory + '/index.html'
+ os.system("xsltproc -o \"%s\" \"%s\" \"%s\"" % (outputPath, stylesheetPath, filePath))
+
+def insertProjectName(directory, projectName):
+ for (path, dirs, files) in os.walk(directory):
+ for fileName in files:
+ filePath = os.path.join(path, fileName)
+
+ # Replace Project with projectName
+ f = open(filePath, "r")
+ text = f.read()
+ f.close()
+ f = open(filePath, "w")
+ f.write(text.replace("##PROJECT##", projectName))
+ f.close()
+
+def main(argv=None):
+ if argv is None:
+ argv = sys.argv
+
+ global verbose
+
+ # Parse command line options
+ optionParser = OptionParser(version="%prog 2.2")
+ optionParser.add_option("-i", "--input", type="string", dest="inputDirectory", default=os.getcwd(), help="The directory containing Doxygen's XML output. Default is the current directory")
+ optionParser.add_option("-o", "--output", type="string", dest="outputDirectory", default=os.getcwd(), help="The directory to output the converted files to. Default is the current directory")
+ optionParser.add_option("-n", "--name", type="string", dest="projectName", default="Untitled", help="The name of the project")
+ optionParser.add_option("-x", "--xml", action="store_false", dest="makeHTML", default=True, help="Only generate XML. If this flag is not set, both XML and HTML will be generated")
+ optionParser.add_option("-p", "--phone", action="store_true", dest="shouldEstablishIPhoneLinks", default=False, help="Establish links to Apple's iPhone framework documentation, rather than to Mac frameworks")
+ optionParser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="Show detailed information")
+ (options, args) = optionParser.parse_args(argv[1:])
+
+ verbose = options.verbose
+
+ if verbose:
+ print "Checking arguments"
+
+ # Check the arguments
+ if not os.path.exists(options.inputDirectory):
+ print >>sys.stderr, "Error: Input path does not exist: %s" % (options.inputDirectory)
+ optionParser.print_help()
+ return errno.ENOENT
+ elif not os.path.isdir(options.inputDirectory):
+ print >>sys.stderr, "Error: Input path is not a directory: %s" % (options.inputDirectory)
+ optionParser.print_help()
+ return errno.ENOTDIR
+ if os.path.exists(options.outputDirectory) and not os.path.isdir(options.outputDirectory):
+ print >>sys.stderr, "Error: Output path is not a directory: %s" % (options.outputDirectory)
+ return errno.ENOTDIR
+ else:
+ _mkdir(options.outputDirectory)
+
+ # Set the xml output directory
+ xmlOutputDirectory = os.path.join(options.outputDirectory, "xml")
+
+ # Clean up the XML files
+ if verbose:
+ print "Cleaning XML files:"
+
+ for fileName in os.listdir(options.inputDirectory):
+ if fnmatch.fnmatch(fileName, "interface_*.xml") or fnmatch.fnmatch(fileName, "protocol_*.xml"):
+ filePath = os.path.join(options.inputDirectory, fileName)
+ cleanXML(filePath, xmlOutputDirectory)
+
+ # Create the index file
+ if verbose:
+ print "Creating index.xml"
+ indexPath = createIndexXML(xmlOutputDirectory)
+
+ # Establish inter-file links
+ if verbose:
+ print "Establishing links:"
+ linkify(xmlOutputDirectory, options.shouldEstablishIPhoneLinks)
+
+ # Convert to HTML
+ if options.makeHTML:
+ if verbose:
+ print "Converting to HTML:"
+ htmlOutputDirectory = os.path.join(options.outputDirectory, "html")
+ if (os.path.exists(os.path.join(xmlOutputDirectory, "Classes"))):
+ for fileName in os.listdir(os.path.join(xmlOutputDirectory, "Classes")):
+ filePath = os.path.join(xmlOutputDirectory, "Classes", fileName)
+ convertToHTML(filePath, htmlOutputDirectory)
+ if (os.path.exists(os.path.join(xmlOutputDirectory, "Categories"))):
+ for fileName in os.listdir(os.path.join(xmlOutputDirectory, "Categories")):
+ filePath = os.path.join(xmlOutputDirectory, "Categories", fileName)
+ convertToHTML(filePath, htmlOutputDirectory)
+ if (os.path.exists(os.path.join(xmlOutputDirectory, "Protocols"))):
+ for fileName in os.listdir(os.path.join(xmlOutputDirectory, "Protocols")):
+ filePath = os.path.join(xmlOutputDirectory, "Protocols", fileName)
+ convertToHTML(filePath, htmlOutputDirectory)
+ if verbose:
+ print "Converting index.html"
+ convertIndexToHTML(indexPath, htmlOutputDirectory)
+
+ if verbose:
+ print "Copying CSS stylesheets"
+ # Copy the CSS files over to the new path
+ cssPath = sys.path[0] + '/../temp/css'
+ os.system("cp -R \"%s\" \"%s\"" % (cssPath, htmlOutputDirectory))
+
+ # Set the project name where necessary
+ if verbose:
+ print "Setting project name"
+ insertProjectName(xmlOutputDirectory, options.projectName)
+ if options.makeHTML:
+ insertProjectName(htmlOutputDirectory, options.projectName)
+
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main())
View
19 Documentation/Doxygen/doxygen.config
@@ -0,0 +1,19 @@
+INPUT = ../SSToolkit/
+OUTPUT_DIRECTORY = temp
+FILE_PATTERNS = *.h
+
+DOCSET_BUNDLE_ID = com.samsoffes.sstoolkit
+
+GENERATE_HTML = NO
+GENERATE_LATEX = NO
+GENERATE_XML = YES
+EXTENSION_MAPPING = YES
+PROJECT_NAME = SSToolkit
+PROJECT_NUMBER = 0.0.0
+
+WARNINGS = NO
+WARN_IF_UNDOCUMENTED = NO
+WARN_IF_DOC_ERROR = NO
+WARN_NO_PARAMDOC = NO
+
+QUIET = YES
View
74 Documentation/Doxygen/index2html.xslt
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="html" omit-xml-declaration="yes" indent="yes" />
+
+ <xsl:template match="/">
+ <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
+ <html>
+ <head>
+ <meta charset="UTF-8" />
+ <title><xsl:apply-templates select="project" mode="title"/></title>
+
+ <meta id="Generator" name="Generator" content="Doxyclean"/>
+ <meta id="GeneratorVersion" name="GeneratorVersion" content="2.2"/>
+
+ <link rel="stylesheet" type="text/css" href="css/common.css"/>
+ <link rel="stylesheet" type="text/css" media="screen" href="css/screen.css"/>
+ <link rel="stylesheet" type="text/css" media="print" href="css/print.css"/>
+ </head>
+ <body>
+ <div id="indexContainer">
+ <h1><xsl:apply-templates select="project" mode="title"/></h1>
+
+ <xsl:if test="count(project/object[@kind='class']) > 0">
+ <div class="column">
+ <h5>Class References</h5>
+ <ul>
+ <xsl:apply-templates select="project/object[@kind='class']"/>
+ </ul>
+ </div>
+ </xsl:if>
+
+ <div class="column">
+ <xsl:if test="count(project/object[@kind='protocol']) > 0">
+ <h5>Protocol References</h5>
+ <ul>
+ <xsl:apply-templates select="project/object[@kind='protocol']"/>
+ </ul>
+ </xsl:if>
+
+ <xsl:if test="count(project/object[@kind='category']) > 0">
+ <h5>Category References</h5>
+ <ul>
+ <xsl:apply-templates select="project/object[@kind='category']"/>
+ </ul>
+ </xsl:if>
+ </div>
+
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="project" mode="title">
+ <xsl:if test="@name">
+ <xsl:value-of select="@name"/>
+ </xsl:if>
+ Project Reference
+ </xsl:template>
+
+ <xsl:template match="object">
+ <li>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:choose>
+ <xsl:when test="@kind='class'">Classes/</xsl:when>
+ <xsl:when test="@kind='category'">Categories/</xsl:when>
+ <xsl:when test="@kind='protocol'">Protocols/</xsl:when>
+ </xsl:choose>
+ <xsl:value-of select="normalize-space(name)"/>.html</xsl:attribute><xsl:value-of select="normalize-space(name)"/>
+ </a>
+ </li>
+ </xsl:template>
+
+</xsl:stylesheet>
View
397 Documentation/Doxygen/object.xslt
@@ -0,0 +1,397 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml" indent="no"/>
+ <xsl:strip-space elements="*"/>
+ <xsl:template match="/">
+ <xsl:apply-templates select="doxygen/compounddef"/>
+ </xsl:template>
+
+ <!-- Formatters -->
+ <xsl:template name="filename">
+ <xsl:param name="path"/>
+ <xsl:choose>
+ <xsl:when test="contains($path,'/')">
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="substring-after($path,'/')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$path"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="prototype">
+ <xsl:choose>
+ <xsl:when test="@kind='property'">@property <xsl:apply-templates select="type"/>
+ <xsl:choose>
+ <xsl:when test="substring(type, string-length(type)-1, 2)=' *'"></xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="name"/>
+ </xsl:when>
+ <xsl:when test="@kind='function'">
+ <xsl:choose>
+ <xsl:when test="@static='no'">- </xsl:when>
+ <xsl:when test="@static='yes'">+ </xsl:when>
+ </xsl:choose>(<xsl:apply-templates select="type"/>)<xsl:call-template name="prototypeWithArguments">
+ <xsl:with-param name="string" select="name"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="prototypeWithArguments">
+ <xsl:param name="string"/>
+ <xsl:choose>
+ <xsl:when test="contains($string,':')">
+ <xsl:value-of select="substring($string,0,string-length(substring-before($string,':'))+2)"/>
+ <xsl:variable name="attribute">
+ <xsl:text>[</xsl:text><xsl:value-of select="substring-before($string,':')"/><xsl:text>]</xsl:text>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="param[attributes=$attribute]">(<xsl:apply-templates select="param[attributes=$attribute]/type"/>)<parameter><xsl:value-of select="param[attributes=$attribute]/declname"/></parameter>
+ </xsl:when>
+ <xsl:otherwise>(<xsl:apply-templates select="param[1]/type"/>)<parameter><xsl:value-of select="param[1]/declname"/></parameter>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="prototypeWithArguments">
+ <xsl:with-param name="string" select="substring-after($string,':')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="type">
+ <!-- Remove the spaces from the protocol declarations on data types -->
+ <xsl:variable name="leftProtocolSpaceRemoved">
+ <xsl:call-template name="replace-string"> <!-- imported template -->
+ <xsl:with-param name="text" select="."/>
+ <xsl:with-param name="replace" select="'&lt; '"/>
+ <xsl:with-param name="with" select="'&lt;'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="replace-string"> <!-- imported template -->
+ <xsl:with-param name="text" select="$leftProtocolSpaceRemoved"/>
+ <xsl:with-param name="replace" select="' &gt;'"/>
+ <xsl:with-param name="with" select="'&gt;'"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- General String Replacement -->
+ <xsl:template name="replace-string">
+ <xsl:param name="text"/>
+ <xsl:param name="replace"/>
+ <xsl:param name="with"/>
+ <xsl:choose>
+ <xsl:when test="contains($text,$replace)">
+ <xsl:value-of select="substring-before($text,$replace)"/>
+ <xsl:value-of select="$with"/>
+ <xsl:call-template name="replace-string">
+ <xsl:with-param name="text"
+ select="substring-after($text,$replace)"/>
+ <xsl:with-param name="replace" select="$replace"/>
+ <xsl:with-param name="with" select="$with"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+ <!-- Basic Tags -->
+ <xsl:template match="ref">
+ <ref>
+ <xsl:apply-templates/>
+ </ref>
+ </xsl:template>
+
+ <xsl:template match="para">
+ <para><xsl:apply-templates/></para>
+ </xsl:template>
+
+ <xsl:template match="computeroutput">
+ <code><xsl:apply-templates/></code>
+ </xsl:template>
+
+ <xsl:template match="itemizedlist">
+ <list>
+ <xsl:apply-templates/>
+ </list>
+ </xsl:template>
+ <xsl:template match="listitem">
+ <item>
+ <xsl:apply-templates/>
+ </item>
+ </xsl:template>
+
+ <!-- Formatting -->
+
+ <xsl:template match="compounddef">
+ <object>
+ <xsl:attribute name="kind"><xsl:value-of select="@kind"/></xsl:attribute>
+ <name>
+ <xsl:apply-templates select="compoundname"/>
+ </name>
+ <file>
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="location/@file"/>
+ </xsl:call-template>
+ </file>
+
+ <xsl:apply-templates select="inheritancegraph/node[label=/doxygen/compounddef/compoundname]"/>
+
+ <xsl:apply-templates select="detaileddescription/para/simplesect[@kind='author']/para"/>
+
+ <xsl:if test="briefdescription[para] or detaileddescription[para]">
+ <description>
+ <xsl:apply-templates select="briefdescription"/>
+ <xsl:apply-templates select="detaileddescription"/>
+ </description>
+ <xsl:apply-templates select="detaileddescription/para" mode="seeAlso"/>
+ </xsl:if>
+ <sections>
+ <xsl:apply-templates select="sectiondef"/>
+ </sections>
+ </object>
+ </xsl:template>
+
+ <xsl:template match="compoundname">
+ <!-- Fix protocol names: They have a dangling -p at the end of the name -->
+ <xsl:choose>
+ <xsl:when test="../@kind='protocol'">
+ <xsl:value-of select="substring(.,0,string-length(.)-1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="briefdescription">
+ <brief><xsl:apply-templates/></brief>
+ </xsl:template>
+
+ <xsl:template match="detaileddescription">
+ <details><xsl:apply-templates/></details>
+ </xsl:template>
+ <xsl:template match="detaileddescription/para/simplesect">
+ </xsl:template>
+ <xsl:template match="detaileddescription/para/parameterlist">
+ </xsl:template>
+ <xsl:template match="detaileddescription/para/xrefsect">
+ </xsl:template>
+
+ <xsl:template match="simplesect[@kind='author']/para">
+ <author><xsl:apply-templates/></author>
+ </xsl:template>
+
+ <xsl:template match="sectiondef">
+ <xsl:apply-templates select="@kind='user-defined'"/>
+ <xsl:apply-templates select="@kind!='user-defined'"/>
+ </xsl:template>
+
+ <xsl:template match="sectiondef[@kind='user-defined']">
+ <section>
+ <name><xsl:apply-templates select="header"/></name>
+ <xsl:apply-templates select="memberdef[briefdescription/para or detaileddescription/para]"/>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="sectiondef[@kind!='user-defined']">
+ <xsl:if test="count(memberdef[@kind!='variable' and (briefdescription/para or detaileddescription/para)]) > 0">
+ <section>
+ <name>Other</name>
+ <xsl:apply-templates select="memberdef[@kind!='variable' and (briefdescription/para or detaileddescription/para)]"/>
+ </section>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="memberdef">
+ <member>
+ <xsl:choose>
+ <xsl:when test="@kind='function' and @static='yes' and @const='no'">
+ <xsl:attribute name="kind">class-method</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@kind='function' and @static='no' and @const='no'">
+ <xsl:attribute name="kind">instance-method</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@kind='property'">
+ <xsl:attribute name="kind">property</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="../../@kind='protocol'">
+ <xsl:choose>
+ <xsl:when test="@optional='yes'">
+ <xsl:attribute name="optional">yes</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="optional">no</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <name><xsl:apply-templates select="name"/></name>
+ <type><xsl:apply-templates select="type"/></type>
+ <prototype><xsl:call-template name="prototype"/></prototype>
+ <file>
+ <xsl:call-template name="filename">
+ <xsl:with-param name="path" select="location/@file"/>
+ </xsl:call-template>
+ </file>
+ <description>
+ <xsl:apply-templates select="briefdescription"/>
+ <xsl:apply-templates select="detaileddescription"/>
+ </description>
+ <xsl:apply-templates select="detaileddescription/para/simplesect[@kind='warning']" mode="warning"/>
+ <xsl:apply-templates select="detaileddescription/para/xrefsect" mode="bug"/>
+ <xsl:apply-templates select="detaileddescription/para/parameterlist" mode="parameters"/>
+ <xsl:apply-templates select="detaileddescription/para" mode="return"/>
+ <xsl:apply-templates select="detaileddescription/para" mode="seeAlso"/>
+ </member>
+ </xsl:template>
+
+ <xsl:template match="detaileddescription/para/parameterlist" mode="parameters">
+ <parameters>
+ <xsl:apply-templates/>
+ </parameters>
+ </xsl:template>
+ <xsl:template match="parameteritem">
+ <param>
+ <name>
+ <xsl:apply-templates select="parameternamelist"/>
+ </name>
+ <description>
+ <xsl:apply-templates select="parameterdescription"/>
+ </description>
+ </param>
+ </xsl:template>
+
+ <xsl:template match="detaileddescription/para" mode="seeAlso">
+ <xsl:if test="simplesect[@kind='see']">
+ <seeAlso>
+ <xsl:apply-templates select="simplesect[@kind='see']/para"/>
+ </seeAlso>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="simplesect[@kind='see']/para">
+ <item><xsl:apply-templates/></item>
+ </xsl:template>
+
+ <xsl:template match="detaileddescription/para" mode="return">
+ <xsl:if test="simplesect[@kind='return']">
+ <return>
+ <xsl:apply-templates select="simplesect[@kind='return']/para"/>
+ </return>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="detaileddescription/para/simplesect[@kind='warning']" mode="warning">
+ <warning>
+ <xsl:apply-templates/>
+ </warning>
+ </xsl:template>
+
+ <xsl:template match="detaileddescription/para/xrefsect" mode="bug">
+ <bug>
+ <xsl:apply-templates select="xrefdescription"/>
+ </bug>
+ </xsl:template>
+ <xsl:template match="xrefdescription">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="inheritancegraph/node" mode="superclass">
+ <name><xsl:apply-templates select="label"/></name>
+
+ <superclass>
+ <xsl:apply-templates select="childnode" mode="superclass"/>
+ </superclass>
+
+ <conformsTo>
+ <xsl:apply-templates select="childnode" mode="protocols"/>
+ </conformsTo>
+ </xsl:template>
+
+ <xsl:template match="inheritancegraph/node" mode="protocol">
+ <name>
+ <xsl:variable name="nameWithLeftBracketRemoved">
+ <xsl:call-template name="replace-string"> <!-- imported template -->
+ <xsl:with-param name="text" select="label"/>
+ <xsl:with-param name="replace" select="'&lt;'"/>
+ <xsl:with-param name="with" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="replace-string"> <!-- imported template -->
+ <xsl:with-param name="text" select="$nameWithLeftBracketRemoved"/>
+ <xsl:with-param name="replace" select="'&gt;'"/>
+ <xsl:with-param name="with" select="''"/>
+ </xsl:call-template>
+ </name>
+
+ <conformsTo>
+ <xsl:apply-templates select="childnode" mode="protocols"/>
+ </conformsTo>
+ </xsl:template>
+
+ <xsl:template match="inheritancegraph/node[label=/doxygen/compounddef/compoundname]">
+ <superclass>
+ <xsl:apply-templates select="childnode" mode="superclass"/>
+ </superclass>
+
+ <conformsTo>
+ <xsl:apply-templates select="childnode" mode="protocols"/>
+ </conformsTo>
+ </xsl:template>
+
+ <xsl:template match="inheritancegraph/node/childnode" mode="superclass">
+ <xsl:variable name="nodeID">
+ <xsl:value-of select="@refid"/>
+ </xsl:variable>
+
+ <xsl:if test="not(starts-with(../../node[@id=$nodeID]/label, '&lt;'))">
+ <xsl:apply-templates select="../../node[@id=$nodeID]" mode="superclass"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="inheritancegraph/node/childnode" mode="protocols">
+ <xsl:variable name="nodeID">
+ <xsl:value-of select="@refid"/>
+ </xsl:variable>
+
+ <xsl:if test="starts-with(../../node[@id=$nodeID]/label, '&lt;')">
+ <protocol>
+ <xsl:apply-templates select="../../node[@id=$nodeID]" mode="protocol"/>
+ </protocol>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Copy most of programlisting through -->
+ <xsl:template match="programlisting">
+ <codeblock>
+ <xsl:apply-templates />
+ </codeblock>
+ </xsl:template>
+
+ <xsl:template match="programlisting/codeline">
+ <xsl:apply-templates /><xsl:text>
+</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="programlisting//sp">
+ <xsl:text> </xsl:text>
+ </xsl:template>
+
+ <!-- Copy through other children of programlisting -->
+ <xsl:template match="programlisting//*">
+ <xsl:apply-templates />
+ </xsl:template>
+
+</xsl:stylesheet>
View
579 Documentation/Doxygen/object2html.xslt
@@ -0,0 +1,579 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" version="1.0" extension-element-prefixes="date">
+ <xsl:output method="html" omit-xml-declaration="yes" indent="yes" />
+
+ <xsl:template match="/">
+ <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
+ <html>
+ <head>
+ <meta charset="UTF-8" />
+ <title><xsl:apply-templates select="object" mode="title"/></title>
+ <meta id="Generator" name="Generator" content="Doxyclean"/>
+ <meta id="GeneratorVersion" name="GeneratorVersion" content="2.2"/>
+
+ <link rel="stylesheet" type="text/css" href="../css/common.css"/>
+ <link rel="stylesheet" type="text/css" media="screen" href="../css/screen.css"/>
+ <link rel="stylesheet" type="text/css" media="print" href="../css/print.css"/>
+
+ <script type="text/javascript">
+ function toggleTOC() {
+ var toc = document.getElementById('tableOfContents');
+ var tocButton = document.getElementById('toc_button');
+ var contents = document.getElementById('contents');
+ if (toc.style.display == 'block') {
+ toc.style.display = 'none';
+ contents.className = '';
+ tocButton.className = '';
+ } else {
+ toc.style.display = 'block';
+ contents.className = 'tableOfContentsOpen';
+ tocButton.className = 'open';
+ }
+ }
+
+ function toggleTOCItem() {
+ var listItem = event.srcElement;
+ var sublist = listItem.getElementsByTagName('ul')[0];
+ if (sublist.style.display == 'block') {
+ sublist.style.display = 'none';
+ listItem.className = 'expandable';
+ } else {
+ sublist.style.display = 'block';
+ listItem.className = 'expandable expanded';
+ }
+ }
+
+ function jumpTo() {
+ selectedItem = event.srcElement.options[event.srcElement.selectedIndex].value;
+ window.location = "#" + selectedItem;
+ }
+ </script>
+ </head>
+ <body>
+ <header id="projectHeader">
+ <h1><a href="../index.html">##PROJECT## Reference Library</a></h1>
+ </header>
+ <header id="fileHeader">
+ <h1><a href="#classTitle"><xsl:apply-templates select="object" mode="title"/></a></h1>
+ </header>
+ <nav id="buttons">
+ <ul>
+ <li id="toc_button"><button id="table_of_contents" onclick="toggleTOC()">Table of Contents</button></li>
+ <li id="jumpto_button">
+ <select id="jumpto" onchange="jumpTo()">
+ <option value="classTitle">Jump To...</option>
+ <xsl:apply-templates select="object/description" mode="jumpList"/>
+ <xsl:apply-templates select="object/sections" mode="jumpList"/>
+ <xsl:call-template name="jumpProperties"/>
+ <xsl:call-template name="jumpClassMethods"/>
+ <xsl:call-template name="jumpInstanceMethods"/>
+ </select>
+ </li>
+ </ul>
+ </nav>
+
+ <nav id="tableOfContents" style="display: none;">
+ <ul>
+ <xsl:apply-templates select="object/description" mode="toc"/>
+ <xsl:apply-templates select="object/sections" mode="toc"/>
+ <xsl:call-template name="TOCproperties"/>
+ <xsl:call-template name="TOCclassMethods"/>
+ <xsl:call-template name="TOCinstanceMethods"/>
+ </ul>
+ </nav>
+
+ <div id="contents">
+ <h1 id="classTitle"><xsl:apply-templates select="object" mode="title"/></h1>
+
+ <!-- Info Table -->
+ <table id="metadata">
+
+ <xsl:variable name="hasInheritance">
+ <xsl:choose>
+ <xsl:when test="object/superclass[child::text()[normalize-space(.)] | child::*]">
+ <xsl:value-of select="true()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="false()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="hasProtocolConformance">
+ <xsl:choose>
+ <xsl:when test="object/conformsTo/protocol or object/superclass/conformsTo/protocol">
+ <xsl:value-of select="true()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="false()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:if test="$hasInheritance='true'">
+ <tr class="alt">
+ <th>Inherits from</th>
+ <td>
+ <ul class="inheritance">
+ <xsl:apply-templates select="object/superclass[child::text()[normalize-space(.)] | child::*]"/>
+ </ul>
+ </td>
+ </tr>
+ </xsl:if>
+
+ <xsl:if test="$hasProtocolConformance='true'">
+ <tr>
+ <xsl:if test="not($hasInheritance='true')">
+ <xsl:attribute name="class">alt</xsl:attribute>
+ </xsl:if>
+ <th>Conforms to</th>
+ <td>
+ <ul>
+ <xsl:apply-templates select="object/conformsTo/protocol"/>
+ <xsl:apply-templates select="object/superclass[child::text()[normalize-space(.)] | child::*]" mode="protocols"/>
+ </ul>
+ </td>
+ </tr>
+ </xsl:if>
+
+ <tr>
+ <xsl:if test="($hasInheritance='true' and $hasProtocolConformance='true') or ($hasInheritance='false' and $hasProtocolConformance='false')">
+ <xsl:attribute name="class">alt</xsl:attribute>
+ </xsl:if>
+ <th>Declared in</th>
+ <td><xsl:apply-templates select="object/file"/></td>
+ </tr>
+ </table>
+ <!-- End Info Table -->
+
+ <xsl:apply-templates select="object/description"/>
+
+ <xsl:apply-templates select="object/sections"/>
+
+ <xsl:call-template name="properties"/>
+ <xsl:call-template name="classMethods"/>
+ <xsl:call-template name="instanceMethods"/>
+
+ <hr/>
+ <p id="lastUpdated">Last updated: <xsl:value-of select="date:year()"/>-<xsl:value-of select="date:month-in-year()"/>-<xsl:value-of select="date:day-in-month()"/></p>
+ </div>
+
+ <footer id="breadcrumbs">
+ <ul>
+ <li><a href="../index.html">##PROJECT##</a></li>
+ <li><a href="#classTitle"><xsl:apply-templates select="object" mode="title"/></a></li>
+ </ul>
+ </footer>
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <!-- Jump To... List -->
+ <xsl:template match="object/description" mode="jumpList">
+ <xsl:if test="brief or details">
+ <option value="overview">Overview</option>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="object/sections" mode="jumpList">
+ <xsl:if test="count(section) > 0">
+ <option value="tasks">Tasks</option>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="jumpProperties">
+ <xsl:if test="count(object/sections/section/member[@kind='property']) > 0">
+ <option value="properties">Properties</option>
+ <xsl:apply-templates select="object/sections/section/member[@kind='property']" mode="jumpList"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="jumpClassMethods">
+ <xsl:if test="count(object/sections/section/member[@kind='class-method']) > 0">
+ <option value="classMethods">Class Methods</option>
+ <xsl:apply-templates select="object/sections/section/member[@kind='class-method']" mode="jumpList"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="jumpInstanceMethods">
+ <xsl:if test="count(object/sections/section/member[@kind='instance-method']) > 0">
+ <option value="instanceMethods">Instance Methods</option>
+ <xsl:apply-templates select="object/sections/section/member[@kind='instance-method']" mode="jumpList"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="member" mode="jumpList">
+ <option>
+ <xsl:attribute name="value"><xsl:value-of select="name"/></xsl:attribute>
+ <xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@kind='class-method'">+ </xsl:when>
+ <xsl:when test="@kind='instance-method'">- </xsl:when>
+ </xsl:choose>
+ <xsl:value-of select="name"/>
+ </option>
+ </xsl:template>
+
+ <!-- Table of Contents -->
+ <xsl:template match="object/description" mode="toc">
+ <xsl:if test="brief or details">
+ <li><a href="#overview">Overview</a></li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="object/sections" mode="toc">
+ <xsl:if test="count(section) > 0">
+ <li class="expandable" id="tocTasks" onclick="toggleTOCItem()">
+ <a href="#tasks">Tasks</a>
+ <ul style="display: none;">
+ <xsl:apply-templates select="section" mode="toc"/>
+ </ul>
+ </li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="object/sections/section" mode="toc">
+ <li>
+ <a>
+ <xsl:attribute name="href">#<xsl:value-of select="translate(normalize-space(name), ' ', '_')"/></xsl:attribute>
+ <xsl:apply-templates select="name"/>
+ </a>
+ </li>
+ </xsl:template>
+
+ <xsl:template name="TOCproperties">
+ <xsl:if test="count(object/sections/section/member[@kind='property']) > 0">
+ <li class="expandable" id="tocProperties" onclick="toggleTOCItem()">
+ <a href="#properties">Properties</a>
+ <ul style="display: none;">
+ <xsl:apply-templates select="object/sections/section/member[@kind='property']" mode="toc"/>
+ </ul>
+ </li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="TOCclassMethods">
+ <xsl:if test="count(object/sections/section/member[@kind='class-method']) > 0">
+ <li class="expandable" id="tocClassMethods" onclick="toggleTOCItem()">
+ <a href="#classMethods">Class Methods</a>
+ <ul style="display: none;">
+ <xsl:apply-templates select="object/sections/section/member[@kind='class-method']" mode="toc"/>
+ </ul>
+ </li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="TOCinstanceMethods">
+ <xsl:if test="count(object/sections/section/member[@kind='instance-method']) > 0">
+ <li class="expandable" id="tocInstanceMethods" onclick="toggleTOCItem()">
+ <a href="#instanceMethods">Instance Methods</a>
+ <ul style="display: none;">
+ <xsl:apply-templates select="object/sections/section/member[@kind='instance-method']" mode="toc"/>
+ </ul>
+ </li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="member" mode="toc">
+ <li>
+ <a>
+ <xsl:attribute name="href">#<xsl:value-of select="name"/></xsl:attribute>
+ <xsl:apply-templates select="name"/>
+ </a>
+ </li>
+ </xsl:template>
+
+ <!-- Object Attributes -->
+
+ <xsl:template match="object" mode="title">
+ <xsl:apply-templates select="name"/>
+ <xsl:choose>
+ <xsl:when test="@kind='class'"><xsl:text> Class</xsl:text></xsl:when>
+ <xsl:when test="@kind='category'"><xsl:text> Category</xsl:text></xsl:when>
+ <xsl:when test="@kind='protocol'"><xsl:text> Protocol</xsl:text></xsl:when>
+ </xsl:choose>
+ <xsl:text> Reference</xsl:text>
+ </xsl:template>
+
+ <!-- Inheritance Tree -->
+ <xsl:template match="superclass">
+ <li><xsl:apply-templates select="name"/></li>
+ </xsl:template>
+
+ <!-- Protocol Conformance -->
+ <xsl:template match="conformsTo/protocol">
+ <xsl:param name="class"/>
+ <li>
+ <xsl:apply-templates select="name"/>
+ <xsl:if test="$class">
+ <xsl:text> (</xsl:text><xsl:value-of select="$class"/><xsl:text>)</xsl:text>
+ </xsl:if>
+ </li>
+ </xsl:template>
+
+ <xsl:template match="superclass" mode="protocols">
+ <xsl:apply-templates select="conformsTo/protocol">
+ <xsl:with-param name="class" select="name"/>
+ </xsl:apply-templates>
+
+ <xsl:apply-templates select="superclass" mode="protocols"/>
+ </xsl:template>
+
+ <!-- Overview -->
+ <xsl:template match="object/description">
+ <xsl:if test="brief or details">
+ <h2 id="overview">Overview</h2>
+ <xsl:apply-templates select="brief"/>
+ <xsl:apply-templates select="details"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Sections -->
+ <xsl:template match="sections">
+ <xsl:if test="count(section) > 0">
+ <h2 id="tasks">Tasks</h2>
+ <ul id="tasksList">
+ <xsl:apply-templates selection="section"/>
+ </ul>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="section">
+ <xsl:if test="count(member) > 0">
+ <li>
+ <xsl:attribute name="id">
+ <xsl:value-of select="translate(normalize-space(name), ' ', '_')"/>
+ </xsl:attribute>
+ <h3><xsl:apply-templates select="name"/></h3>
+ <ul class="methods">
+ <xsl:apply-templates select="member" mode="index"/>
+ </ul>
+ </li>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="member" mode="index">
+ <li>
+ <span class="tooltipRegion">
+ <code>
+ <a>
+ <xsl:attribute name="href">#<xsl:value-of select="name"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@kind='class-method'">+ </xsl:when>
+ <xsl:when test="@kind='instance-method'">- </xsl:when>
+ </xsl:choose>
+ <xsl:apply-templates select="name"/>
+ </a>
+ </code>
+
+ <xsl:choose>
+ <xsl:when test="@kind='property'">
+ <xsl:text> </xsl:text><span class="specialType">property</span>
+ </xsl:when>
+ <xsl:when test="@optional='no'">
+ <xsl:text> </xsl:text><span class="specialType">required</span>
+ </xsl:when>
+ </xsl:choose>
+ </span>
+ <span class="tooltip"><xsl:value-of select="description/brief"/></span>
+ </li>
+ </xsl:template>
+
+ <!-- Definition Sections -->
+ <xsl:template name="properties">
+ <xsl:if test="count(object/sections/section/member[@kind='property']) > 0">
+ <section id="properties">
+ <h2>Properties</h2>
+ <xsl:apply-templates select="object/sections/section/member[@kind='property']" mode="details"/>
+ </section>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="classMethods">
+ <xsl:if test="count(object/sections/section/member[@kind='class-method']) > 0">
+ <section id="classMethods">
+ <h2>Class Methods</h2>
+ <xsl:apply-templates select="object/sections/section/member[@kind='class-method']" mode="details"/>
+ </section>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="instanceMethods">
+ <xsl:if test="count(object/sections/section/member[@kind='instance-method']) > 0">
+ <section id="instanceMethods">
+ <h2>Instance Methods</h2>
+ <xsl:apply-templates select="object/sections/section/member[@kind='instance-method']" mode="details"/>
+ </section>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Method/Property Documentation -->
+ <xsl:template match="member" mode="details">
+ <section class="definition">
+ <xsl:attribute name="id"><xsl:value-of select="name"/></xsl:attribute>
+ <h3><xsl:value-of select="name"/></h3>
+
+ <xsl:apply-templates select="description/brief"/>
+
+ <code class="methodDeclaration">
+ <xsl:apply-templates select="prototype"/>
+ </code>
+
+ <xsl:apply-templates select="parameters"/>
+ <xsl:apply-templates select="return"/>
+ <xsl:apply-templates select="description/details"/>
+ <xsl:apply-templates select="warning"/>
+ <xsl:apply-templates select="bug"/>
+ <xsl:apply-templates select="seeAlso"/>
+ <xsl:apply-templates select="file"/>
+
+ </section>
+ </xsl:template>
+
+ <xsl:template match="prototype">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="prototype/parameter">
+ <span class="parameter">
+ <xsl:apply-templates/>
+ </span>
+ </xsl:template>
+
+ <!-- Don't put the <code> tag for links inside a prototype -->
+ <xsl:template match="prototype//ref">
+ <xsl:choose>
+ <xsl:when test="/object/name != child::node()[1]">
+ <a>
+ <xsl:attribute name="href"><xsl:value-of select="@id"/>.html</xsl:attribute>
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="parameters">
+ <h5>Parameters</h5>
+ <dl class="parameterList">
+ <xsl:apply-templates/>
+ </dl>
+ </xsl:template>
+
+ <xsl:template match="param">
+ <dt>
+ <xsl:apply-templates select="name"/>
+ </dt>
+ <dd>
+ <xsl:apply-templates select="description"/>
+ </dd>
+ </xsl:template>
+
+ <xsl:template match="return">
+ <h5>Return Value</h5>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="member/description/details">
+ <xsl:if test="para[1]/. != ''">
+ <h5>Discussion</h5>
+ <xsl:apply-templates/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="member/warning">
+ <h5>Warning</h5>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="member/bug">
+ <h5>Bug</h5>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="seeAlso">
+ <h5>See Also</h5>
+ <ul class="seeAlso">
+ <xsl:apply-templates select="item"/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="seeAlso/item">
+ <li>
+ <code>
+ <a>
+ <xsl:attribute name="href">#<xsl:value-of select="normalize-space(translate(.,'-+',''))"/></xsl:attribute>
+ <xsl:apply-templates/>
+ </a>
+ </code>
+ </li>
+ </xsl:template>
+
+ <xsl:template match="member/file">
+ <h5>Declared In</h5>
+ <code><xsl:apply-templates/></code>
+ </xsl:template>
+
+ <!-- General Tags -->
+
+ <xsl:template match="para">
+ <p><xsl:apply-templates/></p>
+ </xsl:template>
+
+ <xsl:template match="code">
+ <code><xsl:apply-templates/></code>
+ </xsl:template>
+
+ <xsl:template match="list">
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+ <xsl:template match="list/item">
+ <li><xsl:apply-templates/></li>
+ </xsl:template>
+
+ <xsl:template match="ref">
+ <code>
+ <xsl:choose>
+ <xsl:when test="/object/name != child::node()[1]">
+ <a>
+ <xsl:attribute name="href"><xsl:value-of select="@id"/>.html</xsl:attribute>
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </code>
+ </xsl:template>
+
+ <!-- Block for a codeblock -->
+ <xsl:template match="codeblock">
+ <code>
+ <pre>
+ <xsl:apply-templates />
+ </pre>
+ </code>
+ </xsl:template>
+
+ <!-- Don't put the <code> tag for links inside a codeblock -->
+ <xsl:template match="codeblock//ref">
+ <xsl:choose>
+ <xsl:when test="/object/name != child::node()[1]">
+ <a>
+ <xsl:attribute name="href"><xsl:value-of select="@id"/>.html</xsl:attribute>
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+</xsl:stylesheet>
View
3  Documentation/Gemfile
@@ -0,0 +1,3 @@
+source 'http://rubygems.org'
+
+gem 'compass', '0.10.6'
View
12 Documentation/Gemfile.lock
@@ -0,0 +1,12 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ compass (0.10.6)
+ haml (>= 3.0.4)