Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 621 lines (433 sloc) 34.761 kb
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
1 //
2 // GBApplicationSettingsProvider.h
3 // appledoc
4 //
5 // Created by Tomaz Kragelj on 3.10.10.
6 // Copyright (C) 2010, Gentle Bytes. All rights reserved.
7 //
8
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
9 #import "GBCommentComponentsProvider.h"
10 #import "GBApplicationStringsProvider.h"
11
12 @class GBModelBase;
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
13
7d18569 @tomaz Implemented possibility of injecting descriptions to main index file. Cl...
authored
14 extern id kGBCustomDocumentIndexDescKey;
15
16 #pragma mark -
17
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
18 /** Main application settings provider.
19
20 This object implements `GBApplicationStringsProviding` interface and is used by `GBAppledocApplication` to prepare application-wide settings including factory defaults, global and session values. The main purpose of the class is to simplify `GBAppledocApplication` class by decoupling it from the actual settings providing implementation.
1ab0711 @tomaz Added developers check list for creating new command line switches.
authored
21
22 To create a new setting use the following check list to update `GBApplicationSettingsProvider`:
23
24 1. Create the property here (don't forget about `@synthetize`!).
25 2. Set default value in initializer.
26
27 If the setting should be mapped to command line switch also do the following in `GBAppledocApplication`:
28
29 1. Create a new global string as `static NSString` containing the command line switch name.
30 2. Register the switch to `DDCli` (add negated switch if it's a boolean).
ee93385 @tomaz Refined exit codes handling. Closes #102.
authored
31 3. Add unit test in `GBApplicationTesting.m` that validates the switch is properly mapped to setting property (note that boolean switches require testing normal and negated variants!).
1ab0711 @tomaz Added developers check list for creating new command line switches.
authored
32 4. Add KVC setter and map to corresponding property to make the test pass (again booleans require two setters).
33 5. If the switch value uses template placeholders, add unit test in `GBApplicationSettingsProviderTesting.m` that validates the switch is handled.
34 6. If previous point was used, add the code to `replaceAllOccurencesOfPlaceholderStringsInSettingsValues` to make the test pass.
35 7. Add the switch value printout to `printSettingsAndArguments:`.
36 8. Add the switch help printout to `printHelp`.
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
37 */
a422865 @tomaz Removed GBApplicationSettingsProvider NSCopying.
authored
38 @interface GBApplicationSettingsProvider : NSObject
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
39
40 ///---------------------------------------------------------------------------------------
41 /// @name Initialization & disposal
42 ///---------------------------------------------------------------------------------------
43
44 /** Returns autoreleased instance of the class.
45 */
46 + (id)provider;
47
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
48 ///---------------------------------------------------------------------------------------
49 /// @name Project values handling
50 ///---------------------------------------------------------------------------------------
51
52 /** Human readable name of the project. */
53 @property (copy) NSString *projectName;
54
55 /** Human readable name of the project company. */
56 @property (copy) NSString *projectCompany;
57
58 /** Human readable version of the project. */
59 @property (copy) NSString *projectVersion;
60
61 /** Company unique identifier, ussualy in the form of reverse domain like _com.company_. */
62 @property (copy) NSString *companyIdentifier;
63
afef3b2 @tomaz Implemented proper docset packaging handling. Relates to #45.
authored
64 /** Project identifier which is derived by normalizing `projectName`. */
65 @property (readonly) NSString *projectIdentifier;
66
67 /** Version identifier which is derived by normalizing `projectVersion`. */
68 @property (readonly) NSString *versionIdentifier;
69
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
70 ///---------------------------------------------------------------------------------------
71 /// @name Documentation set handling
72 ///---------------------------------------------------------------------------------------
73
74 /** Documentation set bundle identifier. */
75 @property (copy) NSString *docsetBundleIdentifier;
76
77 /** Documentation set bundle name. */
78 @property (copy) NSString *docsetBundleName;
79
80 /** Documentation set certificate issuer. */
81 @property (copy) NSString *docsetCertificateIssuer;
82
83 /** Documentation set certificate signer. */
84 @property (copy) NSString *docsetCertificateSigner;
85
86 /** Documentation set description. */
87 @property (copy) NSString *docsetDescription;
88
89 /** Documentation set fallback URL. */
90 @property (copy) NSString *docsetFallbackURL;
91
92 /** Documentation set feed name. */
93 @property (copy) NSString *docsetFeedName;
94
95 /** Documentation set feed URL. */
96 @property (copy) NSString *docsetFeedURL;
97
895b881 @tomaz Fixed published atom file handling. Closes #45.
authored
98 /** Documentation set package URL. */
99 @property (copy) NSString *docsetPackageURL;
100
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
101 /** Documentation set minimum Xcode version. */
102 @property (copy) NSString *docsetMinimumXcodeVersion;
103
104 /** Documentation set platform family. */
105 @property (copy) NSString *docsetPlatformFamily;
106
107 /** Documentation set publisher identifier. */
108 @property (copy) NSString *docsetPublisherIdentifier;
109
110 /** Documentation set publisher name. */
111 @property (copy) NSString *docsetPublisherName;
112
113 /** Documentation set human readble copyright message. */
114 @property (copy) NSString *docsetCopyrightMessage;
115
afef3b2 @tomaz Implemented proper docset packaging handling. Relates to #45.
authored
116 /** The name of the documentation set installed bundle. The folder is generated in `docsetInstallPath`. */
117 @property (copy) NSString *docsetBundleFilename;
118
119 /** The name of the documentation set atom file when generating publishing files. The file is generated in `outputPath`. */
120 @property (copy) NSString *docsetAtomFilename;
121
122 /** The name of the documentation set compressed package file when generating publishing files. The file is generated in `outputPath`. */
123 @property (copy) NSString *docsetPackageFilename;
124
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
125 ///---------------------------------------------------------------------------------------
126 /// @name Paths handling
127 ///---------------------------------------------------------------------------------------
128
129 /** The base path to template files used for generating various output files. */
130 @property (copy) NSString *templatesPath;
131
132 /** The base path of the generated files. */
133 @property (copy) NSString *outputPath;
134
135 /** The path to which documentation set is to be installed. */
136 @property (copy) NSString *docsetInstallPath;
137
138 /** The path to `docsetutil` tool, including tool filename. */
139 @property (copy) NSString *docsetUtilPath;
140
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
141 /** The list of all include paths containing static documentation.
142
143 The array contains full paths to either directories or files. In the first case, directories are recursively parsed for all template files (i.e. files with names ending with `-template` and arbitrary extension). Each file is processed the same as any other comment! All non-template files are simply copied over to destination without processing, preserving original directory structure. If the path represents a file, the same logic is applied: if it's a template file it's processed, otherwise it's simply copied over to destination unmodified.
144
145 @warning *Note:* All include paths are copied over to destination defined with `outputPath`, inside `docs` directory. If a path represents a directory, it's copied into a subdirectory of `docs` using the last path component name as the subdirectory name. For example: contents of `some/path/to/dir` would be copied to `docs/dir` within `outputPath` and `another/path` would be copied to `docs/path`. In case the path represents a file, it's simply copied inside `docs` directory at `outputPath`.
146
147 @warning *Important:* Make sure no duplicate directories or files are added to the list - appledoc will fail in such case! Also make sure to not add subpaths of an already added path - this will also fail while copying files!
7d18569 @tomaz Implemented possibility of injecting descriptions to main index file. Cl...
authored
148
149 @see indexDescriptionPath
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
150 */
151 @property (retain) NSMutableSet *includePaths;
152
7d18569 @tomaz Implemented possibility of injecting descriptions to main index file. Cl...
authored
153 /** The path to the source file used for injection into autogenerated main index html.
154
155 If this is valid value, pointing to an existing file, it's used to inject the contents of the file into autogenerated main index html. The source file is preprocessed using the same rules as all other static documents.
156
157 @see includePaths
158 */
159 @property (copy) NSString *indexDescriptionPath;
160
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
161 /** The list of all full or partial paths to be ignored.
162
163 It's recommended to check if a path string ends with any of the given paths before processing it. This should catch directory and file names properly as directories are processed first.
164 */
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
165 @property (retain) NSMutableSet *ignoredPaths;
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
166
167 ///---------------------------------------------------------------------------------------
168 /// @name Behavior handling
169 ///---------------------------------------------------------------------------------------
170
83fb2ff @tomaz Fixed manual property getters and setters handling. Closes #75.
authored
171 /** Indicates whether HTML files should be generated or not.
a28b2ff @tomaz Implemented preparing for docset publishing. Closes #45.
authored
172
173 If `YES`, HTML files are generated in `outputPath` from parsed and processed data. If `NO`, input files are parsed and processed, but nothing is generated.
174
175 @see createDocSet
176 */
177 @property (assign) BOOL createHTML;
178
179 /** Specifies whether documentation set should be created from the HTML files.
180
181 If `YES`, HTML files from html subdirectory in `outputPath` are moved to proper subdirectory within docset output files, then helper files are generated from parsed data. Documentation set files are also indexed. If `NO`, HTML files are left in the output path.
182
d6b842b @tomaz Fixed comment warnings for various objects.
authored
183 @see createHTML
a28b2ff @tomaz Implemented preparing for docset publishing. Closes #45.
authored
184 @see installDocSet
185 @see publishDocSet
186 */
187 @property (assign) BOOL createDocSet;
188
189 /** Specifies whether the documentation set should be installed or not.
190
191 If `YES`, temporary files used for indexing and removed, then documentation set bundle is created from the files from docset output path and is moved to `docsetInstallPath`. If `NO`, all documentation set files are left in output path.
192
193 @see createDocSet
194 @see publishDocSet
195 */
196 @property (assign) BOOL installDocSet;
197
198 /** Specifies whether the documentation set should be prepared for publishing or not.
199
200 If `YES`, installed documentation set is packaged for publishing - an atom feed is created and documentation set is archived. If the atom feed file is alreay found, it is updated with new information. Both, the feed and archived docset files are located within `outputPath`. If `NO`, documentation set is not prepared for publishing.
201
202 @see createDocSet
203 @see installDocSet
204 */
205 @property (assign) BOOL publishDocSet;
206
207 /** Specifies whether intermediate files should be kept in `outputPath` or not.
208
209 If `YES`, all intermediate files (i.e. HTML files and documentation set files) are kept in output path. If `NO`, only final results are kept. This setting not only affects how the files are being handled, it also affects performance. If intermediate files are not kept, appledoc moves files between various generation phases, otherwise it copies them. So it's prefferable to leave this option to `NO`. This option only affects output files, input source files are always left intact!
1edaeab @tomaz Implemented message file generation when installing documentation set. C...
authored
210
211 @see cleanupOutputPathBeforeRunning
a28b2ff @tomaz Implemented preparing for docset publishing. Closes #45.
authored
212 */
213 @property (assign) BOOL keepIntermediateFiles;
214
1edaeab @tomaz Implemented message file generation when installing documentation set. C...
authored
215 /** Specifies whether contents of output path should be deleted befor running the tool.
216
217 This is useful to have output path only contain files generated by latest run instead of keeping previous files. Although appledoc removes existing files when needed, it leaves any file or directory that's not touched by this run. So if we created docset in previous run, and only html in current one, the output would contain both subdirs - the fresh HTML files and documentation set from the previous run. Using this option cleans up output path before running so we can start fresh and prevent confusion.
218
219 @see keepIntermediateFiles
220 */
221 @property (assign) BOOL cleanupOutputPathBeforeRunning;
222
efce669 @tomaz Implemented optional disabling of first paragraph repeat for members. Cl...
authored
223 /** Indicates whether the first paragraph needs to be repeated within method and property description or not.
224
225 If `YES`, first paragraph is repeated in members description, otherwise not.
226 */
227 @property (assign) BOOL repeatFirstParagraphForMemberDescription;
228
e2c8832 @tomaz Fixed warnings due to invalid cross references in various comments.
authored
229 /** Indicates whether undocumented classes, categories or protocols should be kept or ignored when generating output.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
230
231 If `YES` undocumented objects are kept and are used for output generation. If `NO`, these objects are ignored, but only if all their members are also not documented - as soon as a single member is documented, the object is included in output together with all of it's documented members.
232
233 @warning *Note:* Several properties define how undocumented objects are handled: `keepUndocumentedObjects`, `keepUndocumentedMembers` and `findUndocumentedMembersDocumentation`. To better understand how these work together, this is the workflow used when processing parsed objects, prior than passing them to output generators:
234
235 1. If `findUndocumentedMembersDocumentation` is `YES`, all undocumented methods and properties documentation is searched for in known super class hierarchy. If documentation is found in any of the super classes, it is copied to inherited member as well. If `findUndocumentedMembersDocumentation` is `NO`, members are left undocumented and are handled that way in next steps.
236 2. If `keepUndocumentedMembers` is `NO`, all parsed objects' members are iterated over. Any undocumented method or property is removed from class (of course any documentation copied over from super classes in previous step is considered valid too). If `keepUndocumentedMembers` is `NO`, all members are left and if `warnOnUndocumentedMembers` is `YES`, warnings are logged for all undocumented members.
237 3. If `keepUndocumentedObjects` is `NO`, all undocumented classes, categories and protocols that have no documented method or property are also removed. If `keepUndocumentedObjects` is `NO`, all objects are left in the store and are used for output generation and if `warnOnUndocumentedObject` is `YES`, warnings are logged for all undocumented objects.
238
239 @see keepUndocumentedMembers
240 @see findUndocumentedMembersDocumentation;
241 @see warnOnUndocumentedObject
242 */
243 @property (assign) BOOL keepUndocumentedObjects;
244
e2c8832 @tomaz Fixed warnings due to invalid cross references in various comments.
authored
245 /** Indicates whether undocumented methods or properties should be processed or not.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
246
247 If `YES`, undocumented members are still used for output generation. If `NO`, these members are ignored, as if they are not part of the object. Note that this only affects documented objects: if an object is not documented and none of it's members is documented, the object is not processed for output, even if this value is `YES`!
248
249 @warning *Note:* This property works together with `keepUndocumentedObjects` and `findUndocumentedMembersDocumentation`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
250
251 @see keepUndocumentedObjects
252 @see findUndocumentedMembersDocumentation
253 @see warnOnUndocumentedMember
254 */
255 @property (assign) BOOL keepUndocumentedMembers;
256
257 /** Specifies whether undocumented inherited methods or properties should be searched for in known places.
258
259 If `YES`, any undocumented overriden method or property is searched for in known super classes and adopted protocols and if documentation is found there, it is copied over. This works great for objects which would otherwise only show class documentation and no member. It's also how Apple documentation uses. Defaults to `YES`.
260
261 @warning *Note:* This property works together with `keepUndocumentedObjects` and `keepUndocumentedMembers`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
262
263 @see keepUndocumentedObjects
264 @see keepUndocumentedMembers
265 */
266 @property (assign) BOOL findUndocumentedMembersDocumentation;
267
268 /** Indicates whether categories should be merges to classes they extend or not.
269
270 If `YES`, all methods from categories and extensions are merged to their classes. If `NO`, categories are left as independent objects in generated output. This is the main categories merging on/off switch, it merely enables or disables merging, other category merging settings define how exactly the methods from categories and extensions are merged into their classes.
271
272 Default value is `YES` and should be left so as this seems to be the way Apple has it's documentation generated.
273
274 @warning *Important:* Only categories for known project classes are merged. Categories to other framework classes, such as Foundation, AppKit or UIKit are not merged. In other words: only if the class source code is available on any of the given input paths, and is properly documented, it gets it's categories and extension methods merged! Also note that this option affects your documentation links - if any link is pointing to category that's going to be merged, it will be considered invalid link, so it's best to decide whther to merge categories of nor in advance and then consistently use properly formatted links.
275
276 @see keepMergedCategoriesSections
277 @see prefixMergedCategoriesSectionsWithCategoryName
278 */
279 @property (assign) BOOL mergeCategoriesToClasses;
280
281 /** Indicates whether category or extension sections should be preserved when merging into extended class.
282
283 If `YES`, all the sections from category or extension documentation are preserved. In such case, `prefixMergedCategoriesSectionsWithCategoryName` may optionally be used to prefix section name with category name or not. If `NO`, category or extension sections are ignored and a single section with category name is created in the class.
284
285 Default value is `NO`. If you use many sections within the categories, you should probably leave this option unchanged as preserving all category sections might yield fragmented class documentation. Experiment a bit to see what works best for you.
286
287 @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` is used.
288
289 @see prefixMergedCategoriesSectionsWithCategoryName
290 @see mergeCategoriesToClasses
291 */
292 @property (assign) BOOL keepMergedCategoriesSections;
293
294 /** Indicates whether merged section names from categories should be prefixed with category name.
295
296 If `YES`, all merged section names from categories are prefixed with category name to make them more easily identifiable. If `NO`, section names are not changed. The first option is useful in case end users of your code are aware of different categories (if you're writting a framework for example). On the other hand, if you're using categories mostly as a way to split class definition to multiple files, you might want to keep this option off.
297
298 @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` and `keepMergedCategoriesSections` is used. The option is also ignored for extensions; only section names are used for extensions!
299
300 @see keepMergedCategoriesSections
301 @see mergeCategoriesToClasses
302 */
303 @property (assign) BOOL prefixMergedCategoriesSectionsWithCategoryName;
304
e6c5e51 @tomaz Refactored GBMethodData to include prefixed selector builtin and added s...
authored
305 /** Indicates whteher local methods and properties cross references texts should be prefixed when used in related items list.
306
307 If `YES`, instance methods are prefixed with `-`, class methods with `+` and properties with `@property` when used as cross reference in related items list (i.e. see also section for methods). If `NO`, no prefix is used.
308 */
309 @property (assign) BOOL prefixLocalMembersInRelatedItemsList;
310
32ff996 @tomaz Addressing `&` and `&token;` issues when indexing documentation set, par...
authored
311 /** Specifies whether we should treat docsetutil indexing errors as fatals or not.
312
313 Turning this to `YES` will cause docsetutil indexing error failing build, otherwise it will continue with remaining files. The main reason for implementing this is to allow handling uncompatible descriptions as graceful as possible.
314 */
315 @property (assign) BOOL treatDocSetIndexingErrorsAsFatals;
316
317 /** Species the threshold below which exit codes are truncated to zero.
318
319 This affects the reported exit code when ending a run session. It allows users preventing reporting certain types of exit codes, based on the given threshold. If the reported exit code is lower than the given threshold, zero is returned instead. If the reported exit code is equal or greater than the threshold, it is returned as the result of the tool.
320
321 This is useful to prevent higher level tools invoking appledoc (Xcode for example) treating reported warnings as invalid run for example. By default, this value is zero, so no exit code is suppressed.
322
323 @warning *Note:* Generally appledoc uses higher exit codes for more severe issues, so the greater the threshold, the more "permissive" the exit code will be, regardless of what happens inside the tool. However, crashes are always reported with proper exit codes, regardless of threshold value! Also note that the threshold value relies on the implementation of the exit codes #define values!
324 */
325 @property (assign) int exitCodeThreshold;
326
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
327 ///---------------------------------------------------------------------------------------
328 /// @name Warnings handling
329 ///---------------------------------------------------------------------------------------
330
b427cd7 @tomaz Implemented settings for enabling or disabling validation warnings.
authored
331 /** Indicates whether appledoc will warn if `--output` argument is not given.
332
333 Although appledoc still generates output in current directory, it's better to warn the user as in most cases this is not what she wants (for example if appledoc is invoked from Xcode build script, current working directory might point to some unpredicted location). appledoc also writes the exact path that will be used for generating output.
334
335 Note that in case documentation set is installed to Xcode, setting output path is irrelevant as all files from output are moved to locations Xcode uses for finding documentation sets.
336 */
337 @property (assign) BOOL warnOnMissingOutputPathArgument;
338
339 /** Indicates whether appledoc will warn if `--company-id` argument is not given.
340
341 Although appledoc deducts this information from other values, it's better to warn the user as deducted information doesn't necessarily produce correct results.
342
343 Note that the warning is only issued if documentation set creation is requested.
344 */
345 @property (assign) BOOL warnOnMissingCompanyIdentifier;
346
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
347 /** Indicates whether appledoc will warn if it encounters an undocumented class, category or protocol.
348
349 @see warnOnUndocumentedMember
350 */
351 @property (assign) BOOL warnOnUndocumentedObject;
352
4f44437 @tomaz Added settings for enabling or disabling various processing warnings.
authored
353 /** Indicates whether appledoc will warn if it encounters an undocumented method or property.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
354
355 @see warnOnUndocumentedObject
356 */
357 @property (assign) BOOL warnOnUndocumentedMember;
358
4f44437 @tomaz Added settings for enabling or disabling various processing warnings.
authored
359 /** Indicates whether appledoc will warn if it encounters an empty description (@bug, @warning, example section etc.).
360 */
361 @property (assign) BOOL warnOnEmptyDescription;
362
363 /** Indicates whether appledoc will warn if it encounters unknown directive or styling element.
364 */
365 @property (assign) BOOL warnOnUnknownDirective;
366
7aa04af @tomaz Implemented optional disabling of invalid cross reference warnings.
authored
367 /** Indicates whether invalid cross reference should result in warning or not. */
368 @property (assign) BOOL warnOnInvalidCrossReference;
369
3a8da42 @tomaz Implemented optional disabling for missing method arguments warnings.
authored
370 /** Indicates whether missing method argument descriptions in comments should result in warnings or not. */
371 @property (assign) BOOL warnOnMissingMethodArgument;
372
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
373 ///---------------------------------------------------------------------------------------
374 /// @name Application-wide HTML helpers
375 ///---------------------------------------------------------------------------------------
376
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
377 /** Specifies whether cross references should be embedded to special strings when processing Markdown.
378
379 This should be left to default value, however it's useful to prevent embedding for unit testing.
380
381 @see stringByEmbeddingCrossReference:
a85a42b @tomaz Fixed conversion of single to double star within example blocks and span...
authored
382 @see embedAppledocBoldMarkersWhenProcessingMarkdown
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
383 */
384 @property (assign) BOOL embedCrossReferencesWhenProcessingMarkdown;
385
a85a42b @tomaz Fixed conversion of single to double star within example blocks and span...
authored
386 /** Specifies whether cross references should be embedded to special strings when processing Markdown.
387
388 This should be left to default value, however it's useful to prevent embedding for unit testing.
389
390 @see stringByEmbeddingCrossReference:
391 @see embedCrossReferencesWhenProcessingMarkdown
392 */
393 @property (assign) BOOL embedAppledocBoldMarkersWhenProcessingMarkdown;
394
395 /** Returns a new string with the given Markdown reference embedded in special cross reference markers used for post processing.
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
396
397 This should be used for all generated cross references, so that we can later detect them when converting HTML with `stringByConvertingMarkdownToHTML:`.
398
399 @warning *Important:* Behavior of this method depends on `embedCrossReferencesWhenProcessingMarkdown` value. If it's `YES`, strings are embedded, otherwise the given value is returned without enmbedding.
400
401 @param value The string to embedd.
402 @return Returns embedded string.
403 @see stringByConvertingMarkdownToHTML:
404 @see embedCrossReferencesWhenProcessingMarkdown
405 */
406 - (NSString *)stringByEmbeddingCrossReference:(NSString *)value;
407
a85a42b @tomaz Fixed conversion of single to double star within example blocks and span...
authored
408 /** Returns a new string with the given value embedded in special bold markers used for post processing.
409
410 This should be used for all appledoc style bold markers (single star), so that we can later detect them when converting HTML with `stringByConvertingMarkdownToHTML:`.
411
412 @warning *Important:* Behavior of this method depends on `embedAppledocBoldMarkersWhenProcessingMarkdown` value. If it's `YES`, strings are embedded, otherwise value is returned without embedding.
413
414 @param value The string to embedd.
415 @return Returns embedded string.
416 @see stringByConvertingMarkdownToHTML:
417 @see embedAppledocBoldMarkersWhenProcessingMarkdown
418 */
419 - (NSString *)stringByEmbeddingAppledocBoldMarkers:(NSString *)value;
420
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
421 /** Returns a new string containing HTML representation of the given Markdown string.
422
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
423 This is the main method for converting Markdown to HTML. It works in two phases: first the Markdown engine is asked to convert the given string to HTML, then the string is cleaned up so that it contains proper HTML code. Cleaning up phase consists of:
424
425 - Cleaning any appledoc generated cross reference inside `<pre>` blocks. Markdown doesn't process links here, so in case appledoc detects known object and converts it to Markdown style link, the Markdown syntaxt is left untouched. This phase makes sure all such occurences are cleaned up to original text. This is only invoked if `embedCrossReferencesWhenProcessingMarkdown` value is `YES`!
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
426
427 @param markdown Markdown source string to convert.
428 @return Returns converted string.
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
429 @see stringByEmbeddingCrossReference:
ac26896 @tomaz Fixed docsetutil `Entity '' not defined` error.
authored
430 @see stringByConvertingMarkdownToText:
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
431 @see stringByEscapingHTML:
432 */
ac26896 @tomaz Fixed docsetutil `Entity '' not defined` error.
authored
433 - (NSString *)stringByConvertingMarkdownToHTML:(NSString *)markdown;
434
435 /** Returns a new string containing text representation of the given Markdown string.
436
437 The main responsibility of this method is to strip Markdown links to names only to give text more readability when used in Xcode quick help. Although the name suggests this can handle Markdown strings, it's intended to be given appledoc comment string, prior to passing it to `GBCommentsProcessor`.
438
439 @param markdown Markdown source string to convert.
440 @return Returns converted string.
441 @see stringByConvertingMarkdownToHTML:
442 @see stringByEscapingHTML:
443 */
444 - (NSString *)stringByConvertingMarkdownToText:(NSString *)markdown;
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
445
d7ece46 @tomaz Fixed HTML and XML handling within example blocks. Closes #54.
authored
446 /** Returns a new string by escaping the given HTML.
447
448 @param string HTML string to escape.
449 @return Returns escaped HTML string.
ac26896 @tomaz Fixed docsetutil `Entity '' not defined` error.
authored
450 @see stringByConvertingMarkdownToHTML:
451 @see stringByConvertingMarkdownToText:
d7ece46 @tomaz Fixed HTML and XML handling within example blocks. Closes #54.
authored
452 */
453 - (NSString *)stringByEscapingHTML:(NSString *)string;
454
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
455 /** Returns HTML reference name for the given object.
456
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
457 This should only be used for creating anchors that need to be referenced from other parts of the same HTML file. The method works for static documents, top-level objects as well as their members.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
458
459 @param object The object for which to return reference name.
460 @return Returns the reference name of the object.
461 @exception NSException Thrown if the given object is `nil`.
462 @see htmlReferenceForObject:fromSource:
463 @see htmlReferenceForObjectFromIndex:
464 */
465 - (NSString *)htmlReferenceNameForObject:(GBModelBase *)object;
466
467 /** Returns relative HTML reference to the given object from the context of the given source object.
468
469 This is useful for generating hrefs from one object HTML file to another. This is the swiss army knife king of a method for all hrefs generation. It works for any kind of links:
470
471 - Index to top-level object (if source is `nil`).
472 - Index to a member of a top-level object (if source is `nil`).
473 - Top-level object to same top-level object.
474 - Top-level object to a different top-level object.
475 - Top-level object to one of it's members.
476 - Member object to it's top-level object.
477 - Member object to another top-level object.
478 - Member object to another member of the same top-level object.
479 - Member object to a member of another top-level object.
480
481 @param object The object for which to generate the reference to.
482 @param source The source object from which to generate the reference from or `nil` for index to object reference.
483 @return Returns the reference string.
484 @exception NSException Thrown if object is `nil`.
485 @see htmlReferenceForObjectFromIndex:
486 @see htmlReferenceNameForObject:
487 */
488 - (NSString *)htmlReferenceForObject:(GBModelBase *)object fromSource:(GBModelBase *)source;
489
490 /** Returns relative HTML reference to the given object from the context of index file.
491
492 This is simply a helper method for `htmlReferenceForObject:fromSource:`, passing the given object as object parameter and `nil` as source.
493
d6b842b @tomaz Fixed comment warnings for various objects.
authored
494 @param object The object for which to generate the reference to.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
495 @return Returns the reference string.
496 @exception NSException Thrown if object is `nil`.
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
497 @see htmlRelativePathToIndexFromObject:
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
498 @see htmlReferenceForObject:fromSource:
499 @see htmlReferenceNameForObject:
500 */
501 - (NSString *)htmlReferenceForObjectFromIndex:(GBModelBase *)object;
502
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
503 /** Returns relative HTML path from the given object to the index file location.
504
505 This is kind of reverse to `htmlReferenceForObjectFromIndex:`, except that it only returns the relative path, without index.html.
506
507 @param object The object from which to generate the path.
508 @return Returns relative path.
509 @exception NSException Thrown if object is `nil`.
510 @see htmlReferenceForObjectFromIndex:
511 @see htmlReferenceForObject:fromSource:
512 @see htmlReferenceNameForObject:
513 */
514 - (NSString *)htmlRelativePathToIndexFromObject:(id)object;
515
516 /** The subpath within `outputPath` where static documents are stored.
517 */
518 @property (readonly) NSString *htmlStaticDocumentsSubpath;
519
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
520 /** The file extension for html files.
521 */
522 @property (readonly) NSString *htmlExtension;
523
524 ///---------------------------------------------------------------------------------------
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
525 /// @name Application-wide template files helpers
526 ///---------------------------------------------------------------------------------------
527
528 /** Determines if the given path represents a template file or not.
529
530 The method simply checks the if the name of the last path component ends with `-template` string.
531
532 @param path The path to check.
533 @return Returns `YES` if the given path represents a template file, `NO` otherwise.
534 @see outputFilenameForTemplatePath:
535 */
536 - (BOOL)isPathRepresentingTemplateFile:(NSString *)path;
537
538 /** Returns the actual filename of the output file from the given template path.
539
540 The method simply removes `-template` string from the file name and returns the resulting string. The result is the filename without path but with the same extension as the original path. If the given path doesn't represent a template file, the result is equivalent to sending `lastPathComponent` to the input path.
541
542 @param path The path to convert.
543 @return Returns filename that can be used for output.
e2c8832 @tomaz Fixed warnings due to invalid cross references in various comments.
authored
544 @see isPathRepresentingTemplateFile:
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
545 @see templateFilenameForOutputPath:
546 */
547 - (NSString *)outputFilenameForTemplatePath:(NSString *)path;
548
549 /** Returns the template name for the given filename.
550
551 This is reverse method for `outputFilenameForTemplatePath`. It adds `-template` string to the end of the given path filename, before the optional extension.
552
553 @param path The path to convert.
554 @return Returns template filename.
e2c8832 @tomaz Fixed warnings due to invalid cross references in various comments.
authored
555 @see isPathRepresentingTemplateFile:
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
556 @see outputFilenameForTemplatePath:
557 */
558 - (NSString *)templateFilenameForOutputPath:(NSString *)path;
559
560 ///---------------------------------------------------------------------------------------
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
561 /// @name Helper methods
562 ///---------------------------------------------------------------------------------------
563
564 /** Replaces all occurences of placeholder strings in all related values of the receiver.
565
566 This message should be sent once all the values have been set. It is a convenience method that prepares all values that can use placeholder strings. From this point on, the rest of the application can simply use properties to get final values instead of sending `stringByReplacingOccurencesOfPlaceholdersInString:` all the time.
567
568 Note that `stringByReplacingOccurencesOfPlaceholdersInString:` is still available for cases where placeholder strings may be used elsewhere (template files for example).
569
570 @see stringByReplacingOccurencesOfPlaceholdersInString:
571 */
572 - (void)replaceAllOccurencesOfPlaceholderStringsInSettingsValues;
573
574 /** Replaces all placeholders occurences in the given string.
575
576 This method provides application-wide string placeholders replacement functionality. It replaces all known placeholders with actual values from the receiver. Placeholders are identified by a dollar mark, followed by placeholder name. The following placeholders are supported (note that case is important!):
577
f18465e @tomaz Fixed HTML footer year and last update strings. Closes #49.
authored
578 - `%PROJECT`: Replaced by `projectName` value.
579 - `%PROJECTID`: Replaced by `projectIdentifier` value.
580 - `%COMPANY`: Replaced by `projectCompany` value.
581 - `%COMPANYID`: Replaced by `companyIdentifier` value.
582 - `%VERSION`: Replaced by `projectVersion` value.
583 - `%VERSIONID`: Replaced by `versionIdentifier` value.
584 - `%DOCSETBUNDLEFILENAME`: Replaced by `docsetBundleFilename` value.
585 - `%DOCSETATOMFILENAME`: Replaced by `docsetAtomFilename` value.
586 - `%DOCSETPACKAGEFILENAME`: Replaced by `docsetPackageFilename` value.
587 - `%YEAR`: Replaced by current year as four digit string.
588 - `%UPDATEDATE`: Replaced by current date in the form of year, month and day with format `YYYY-MM-DD`. For example `2010-11-30`.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
589
590 @param string The string to replace placeholder occurences in.
591 @return Returns new string with all placeholder occurences replaced.
592 @see replaceAllOccurencesOfPlaceholderStringsInSettingsValues
593 */
594 - (NSString *)stringByReplacingOccurencesOfPlaceholdersInString:(NSString *)string;
595
596 ///---------------------------------------------------------------------------------------
597 /// @name Helper classes
598 ///---------------------------------------------------------------------------------------
599
600 /** Returns the `GBCommentComponentsProvider` object that identifies comment components. */
601 @property (retain) GBCommentComponentsProvider *commentComponents;
602
603 /** Returns the `GBApplicationStringsProvider` object that specifies all string templates used for output generation. */
604 @property (retain) GBApplicationStringsProvider *stringTemplates;
605
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
606 @end
1f23b3e @tomaz Refactored template placeholder strings by moving them to global constan...
authored
607
608 #pragma -
609
610 extern NSString *kGBTemplatePlaceholderCompanyID;
611 extern NSString *kGBTemplatePlaceholderProjectID;
612 extern NSString *kGBTemplatePlaceholderVersionID;
613 extern NSString *kGBTemplatePlaceholderProject;
614 extern NSString *kGBTemplatePlaceholderCompany;
615 extern NSString *kGBTemplatePlaceholderVersion;
616 extern NSString *kGBTemplatePlaceholderDocSetBundleFilename;
617 extern NSString *kGBTemplatePlaceholderDocSetAtomFilename;
618 extern NSString *kGBTemplatePlaceholderDocSetPackageFilename;
619 extern NSString *kGBTemplatePlaceholderYear;
620 extern NSString *kGBTemplatePlaceholderUpdateDate;
Something went wrong with that request. Please try again.