MarkdownOutputGenerator class reference
XMLBasedOutputGenerator : OutputGenerator : NSObject | |
MarkdownOutputGenerator.h |
Overview
Defines a concrete XMLBasedOutputGenerator
that generates Markdown output.
Basically this produces text files which are fairly readable for humans and can be converted to simple HTML as a bonus (although XHTMLOutputGenerator
is probably a better HTML output generator solution if HTML is the desired output). See http://daringfireball.net/projects/markdown for details on Markdown syntax.
Tasks
Object member helpers
-
- appendObjectMemberTitleToData:fromItem:
Appends the given member title. -
- appendObjectMemberOverviewToData:fromItem:
Appends the given member overview description. -
- appendObjectMemberPrototypeToData:fromItem:
Appends the given member prototype description. -
- appendObjectMemberSectionToData:fromItem:type:title:
Appends the given member section type description. -
- appendObjectMemberReturnToData:fromItem:
Appends the given member return description. -
- appendObjectMemberDiscussionToData:fromItem:
Appends the given member discussion description. -
- appendObjectMemberWarningToData:fromItem:
Appends the given member warning description. -
- appendObjectMemberBugToData:fromItem:
Appends the given member bug description. -
- appendObjectMemberSeeAlsoToData:fromItem:
Appends the given member see also section description. -
- appendObjectMemberFileToData:fromItem:
Appends the given member declaration file description.
Description helpers
-
- appendBriefDescriptionToData:fromItem:
Appends the brief description to the given data. -
- appendDetailedDescriptionToData:fromItem:
Appends the detailed description to the given data. -
- appendDescriptionToData:fromDescriptionItems:
Converts the description data from the given paragraph to proper Markdown format and appends it to the given data. -
- appendParagraphToData:fromString:linePrefix:wrap:
Appends the given string containing a paragraph text to the given data. -
- resetDescriptionVarsToDefaults
Resets all description variables to default values.
Helper methods
-
- appendHeaderToData:forString:level:
Appends the header of the given level for the given string. -
- appendUnderlineToData:forString:underline:
Appends the underline data for the given string. -
- appendLinkToData:fromReference:andDescription:
Appends link to the given data. -
- appendLinkFootnotesToData:
Appends all link footnotes to the given data. -
- formatLinkFromReference:andDescription:
Formats a link from the given data.
Instance methods
appendObjectMemberTitleToData:fromItem:
Appends the given member title.
- (void)appendObjectMemberTitleToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberOverviewToData:fromItem:
Appends the given member overview description.
- (void)appendObjectMemberOverviewToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberPrototypeToData:fromItem:
Appends the given member prototype description.
- (void)appendObjectMemberPrototypeToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberSectionToData:fromItem:type:title:
Appends the given member section type description.
- (void)appendObjectMemberSectionToData:(NSMutableData *) data
fromItem:(id) item
type:(int) type
title:(NSString *) title
Parameters
- data
The data to append to.
- item
The member item to get information from.
- type
The member section type.
- title
The desired section title.
Exceptions
- NSException
Thrown if appending fails.
Discussion
The type should be one of the following:
kTKObjectMemberSectionParameters:
The array of all parameters will be returned.kTKObjectMemberSectionExceptions:
The array of all exceptions will be returned.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberReturnToData:fromItem:
Appends the given member return description.
- (void)appendObjectMemberReturnToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberDiscussionToData:fromItem:
Appends the given member discussion description.
- (void)appendObjectMemberDiscussionToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberWarningToData:fromItem:
Appends the given member warning description.
- (void)appendObjectMemberWarningToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberBugToData:fromItem:
Appends the given member bug description.
- (void)appendObjectMemberBugToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberSeeAlsoToData:fromItem:
Appends the given member see also section description.
- (void)appendObjectMemberSeeAlsoToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendObjectMemberFileToData:fromItem:
Appends the given member declaration file description.
- (void)appendObjectMemberFileToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The member item to get information from.
Exceptions
- NSException
Thrown if appending fails.
Declared in
MarkdownOutputGenerator.h
appendBriefDescriptionToData:fromItem:
Appends the brief description to the given data.
- (void)appendBriefDescriptionToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The description item which brief subcsection to append.
Exceptions
- NSException
Thrown if appending fails.
Discussion
First the brief description is retreived from the given node, then the data from the retreived nodes is converted to a proper Markdown format and is then appended to the end of the given data.
Note that the generated output is affected by object's description variables and flags. - resetDescriptionVarsToDefaults
can be used to reset these to defaults. See See resetDescriptionVarsToDefaults
for the list of the variables and their meanings.
See also
- appendDetailedDescriptionToData:fromItem:
- appendDescriptionToData:fromDescriptionItems:
- resetDescriptionVarsToDefaults
Declared in
MarkdownOutputGenerator.h
appendDetailedDescriptionToData:fromItem:
Appends the detailed description to the given data.
- (void)appendDetailedDescriptionToData:(NSMutableData *) data
fromItem:(id) item
Parameters
- data
The data to append to.
- item
The description item which detailed subcsection to append.
Exceptions
- NSException
Thrown if appending fails.
Discussion
First the detailed description is retreived from the given node, then the data from the retreived nodes is converted to a proper Markdown format and is then appended to the end of the given data.
Note that the generated output is affected by object's description variables and flags. - resetDescriptionVarsToDefaults
can be used to reset these to defaults. See See resetDescriptionVarsToDefaults
for the list of the variables and their meanings.
See also
- appendBriefDescriptionToData:fromItem:
- appendDescriptionToData:fromDescriptionItems:
- resetDescriptionVarsToDefaults
Declared in
MarkdownOutputGenerator.h
appendDescriptionToData:fromDescriptionItems:
Converts the description data from the given paragraph to proper Markdown format and appends it to the given data.
- (void)appendDescriptionToData:(NSMutableData *) data
fromDescriptionItems:(NSArray *) items
Parameters
- data
The data to append to.
- items
The array of description items which data to convert. If
nil
nothing happens.
Exceptions
- NSException
Thrown if convertion fails.
Discussion
Note that the generated output is affected by object's description variables and flags. - resetDescriptionVarsToDefaults
can be used to reset these to defaults. See See resetDescriptionVarsToDefaults
for the list of the variables and their meanings.
See also
- appendBriefDescriptionToData:fromItem:
- appendDetailedDescriptionToData:fromItem:
appendParagraphToData:fromString:
- resetDescriptionVarsToDefaults
Declared in
MarkdownOutputGenerator.h
appendParagraphToData:fromString:linePrefix:wrap:
Appends the given string containing a paragraph text to the given data.
- (void)appendParagraphToData:(NSMutableData *) data
fromString:(NSString *) string
linePrefix:(NSString *) prefix
wrap:(BOOL) wrap
Parameters
- data
The data to append to.
- string
The paragraph text.
- prefix
The prefix to append before each line.
- wrap
If
YES
, paragraph text should be wrapped according to wrapping options, otherwise not.
Exceptions
- NSException
Thrown if appending fails.
Discussion
This method cleans the output and takes care of formatting the text to fit to the desired line width. It is sent automatically from - appendDescriptionToData:fromDescriptionItems:
and is not meant to be used otherwise.
Note that this only appends the given paragraph text, it doesn't delimit the paragraph with an empty line and doesn't end the paragraph with a new line either.
See also
Declared in
MarkdownOutputGenerator.h
resetDescriptionVarsToDefaults
Resets all description variables to default values.
- (void)resetDescriptionVarsToDefaults
Discussion
The description variables and their default values are:
descriptionDelimitSingleParameters:
A boolean value indicating whether single parameters should be delimited by a new line or not. IfYES
, all parameters are delimited, ifNO
, parameters are delimited by a new line only if two or more are detected. Defaults toYES
.descriptionDelimitLastParameter:
A boolean value indicating whether last parameter should be delimited by a new line or not. Note that if this is set toNO
, thedescriptionDelimitSingleParameters
has no effect. Defaults toYES
.descriptionMarkEmphasis:
A boolean value indicating whether strong and emphasis markers should be used or not. Defaults toYES
.
See also
- appendBriefDescriptionToData:fromItem:
- appendDetailedDescriptionToData:fromItem:
- appendDescriptionToData:fromDescriptionItems:
Declared in
MarkdownOutputGenerator.h
appendHeaderToData:forString:level:
Appends the header of the given level for the given string.
- (void)appendHeaderToData:(NSMutableData *) data
forString:(NSString *) string
level:(int) level
Parameters
- data
The data to append to.
- string
The header string.
- level
The header level. Should be between
1
and10
.
Exceptions
- NSException
Thrown if the given level is not within expected range or appending fails.
Discussion
Depending of the settings, this creates properly formatted header for the given string. Afterwards it automatically adds one empty line.
Declared in
MarkdownOutputGenerator.h
appendUnderlineToData:forString:underline:
Appends the underline data for the given string.
- (void)appendUnderlineToData:(NSMutableData *) data
forString:(NSString *) string
underline:(NSString *) underline
Parameters
- data
The data to append to.
- string
The string which should be underlines.
- underline
The underline string. Should only contain 1 char!
Exceptions
- NSException
Thrown if appending fails.
Discussion
This is mostly used for generating underlines for the titles. Note that nothing will be output if the given string
or underline
are nil
or empty strings.
Declared in
MarkdownOutputGenerator.h
appendLinkToData:fromReference:andDescription:
Appends link to the given data.
- (void)appendLinkToData:(NSMutableData *) data
fromReference:(NSString *) reference
andDescription:(NSString *) description
Parameters
- data
The data to append to.
- reference
The link reference. May be
nil
to only use the description.- description
The link description. May be
nil
to use the reference.
Exceptions
- NSException
Thrown if the
reference
and thedescription
arenil
or appending fails.
Discussion
Depending on the style this either appends the link ID and the reference to the footnote or the actual link. If nil
is passed for the reference, the method appends only the given description. However description
may not be nil
in such case.
Declared in
MarkdownOutputGenerator.h
appendLinkFootnotesToData:
Appends all link footnotes to the given data.
- (void)appendLinkFootnotesToData:(NSMutableData *) data
Parameters
- data
The data to append to.
Exceptions
- NSException
Thrown if appending fails.
Discussion
This message should be sent after handling the file is complete and all references are in the temporary array. This method will output the actual links as footnote markdown style if necessary. If footnote links are disabled or there is no reference for the current object, nothing happens.
Declared in
MarkdownOutputGenerator.h
formatLinkFromReference:andDescription:
Formats a link from the given data.
- (NSString *)formatLinkFromReference:(NSString *) reference
andDescription:(NSString *) description
Parameters
- reference
The link reference. May be
nil
to only use the description.- description
The link description. May be
nil
to use the reference.
Exceptions
- NSException
Thrown if the
reference
and thedescription
arenil
or appending fails.
Return value
Returns the formatted link.
Discussion
Depending on the style this either formats the link as the reference to the footnote or the actual link. If nil
is passed for the reference, the method appends only the given description. However description
may not be nil
in such case.
Note that if the given reference points to the object's member, the link is not generated. Instead only the member name is emmited.
Note that in case footnote style is used, the receiver's footnote index is automatically incremented if necessary.
Declared in
MarkdownOutputGenerator.h
© 2008-2009 Tomaz Kragelj. All rights reserved. (Last updated: 2009-08-24)
Back to index / hierarchy.