Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 386 lines (266 sloc) 21.262 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
14 /** Main application settings provider.
15
16 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.
17 */
a422865 @tomaz Removed GBApplicationSettingsProvider NSCopying.
authored
18 @interface GBApplicationSettingsProvider : NSObject
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
19
20 ///---------------------------------------------------------------------------------------
21 /// @name Initialization & disposal
22 ///---------------------------------------------------------------------------------------
23
24 /** Returns autoreleased instance of the class.
25 */
26 + (id)provider;
27
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
28 ///---------------------------------------------------------------------------------------
29 /// @name Project values handling
30 ///---------------------------------------------------------------------------------------
31
32 /** Human readable name of the project. */
33 @property (copy) NSString *projectName;
34
35 /** Human readable name of the project company. */
36 @property (copy) NSString *projectCompany;
37
38 /** Human readable version of the project. */
39 @property (copy) NSString *projectVersion;
40
41 /** Company unique identifier, ussualy in the form of reverse domain like _com.company_. */
42 @property (copy) NSString *companyIdentifier;
43
afef3b2 @tomaz Implemented proper docset packaging handling. Relates to #45.
authored
44 /** Project identifier which is derived by normalizing `projectName`. */
45 @property (readonly) NSString *projectIdentifier;
46
47 /** Version identifier which is derived by normalizing `projectVersion`. */
48 @property (readonly) NSString *versionIdentifier;
49
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
50 ///---------------------------------------------------------------------------------------
51 /// @name Documentation set handling
52 ///---------------------------------------------------------------------------------------
53
54 /** Documentation set bundle identifier. */
55 @property (copy) NSString *docsetBundleIdentifier;
56
57 /** Documentation set bundle name. */
58 @property (copy) NSString *docsetBundleName;
59
60 /** Documentation set certificate issuer. */
61 @property (copy) NSString *docsetCertificateIssuer;
62
63 /** Documentation set certificate signer. */
64 @property (copy) NSString *docsetCertificateSigner;
65
66 /** Documentation set description. */
67 @property (copy) NSString *docsetDescription;
68
69 /** Documentation set fallback URL. */
70 @property (copy) NSString *docsetFallbackURL;
71
72 /** Documentation set feed name. */
73 @property (copy) NSString *docsetFeedName;
74
75 /** Documentation set feed URL. */
76 @property (copy) NSString *docsetFeedURL;
77
78 /** Documentation set minimum Xcode version. */
79 @property (copy) NSString *docsetMinimumXcodeVersion;
80
81 /** Documentation set platform family. */
82 @property (copy) NSString *docsetPlatformFamily;
83
84 /** Documentation set publisher identifier. */
85 @property (copy) NSString *docsetPublisherIdentifier;
86
87 /** Documentation set publisher name. */
88 @property (copy) NSString *docsetPublisherName;
89
90 /** Documentation set human readble copyright message. */
91 @property (copy) NSString *docsetCopyrightMessage;
92
afef3b2 @tomaz Implemented proper docset packaging handling. Relates to #45.
authored
93 /** The name of the documentation set installed bundle. The folder is generated in `docsetInstallPath`. */
94 @property (copy) NSString *docsetBundleFilename;
95
96 /** The name of the documentation set atom file when generating publishing files. The file is generated in `outputPath`. */
97 @property (copy) NSString *docsetAtomFilename;
98
99 /** The name of the documentation set compressed package file when generating publishing files. The file is generated in `outputPath`. */
100 @property (copy) NSString *docsetPackageFilename;
101
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
102 ///---------------------------------------------------------------------------------------
103 /// @name Paths handling
104 ///---------------------------------------------------------------------------------------
105
106 /** The base path to template files used for generating various output files. */
107 @property (copy) NSString *templatesPath;
108
109 /** The base path of the generated files. */
110 @property (copy) NSString *outputPath;
111
112 /** The path to which documentation set is to be installed. */
113 @property (copy) NSString *docsetInstallPath;
114
115 /** The path to `docsetutil` tool, including tool filename. */
116 @property (copy) NSString *docsetUtilPath;
117
118 /** The list of all full or partial paths to be ignored.
119
120 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.
121 */
122 @property (retain) NSMutableArray *ignoredPaths;
123
124 ///---------------------------------------------------------------------------------------
125 /// @name Behavior handling
126 ///---------------------------------------------------------------------------------------
127
a28b2ff @tomaz Implemented preparing for docset publishing. Closes #45.
authored
128 /* Indicates whether HTML files should be generated or not.
129
130 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.
131
132 @see createDocSet
133 */
134 @property (assign) BOOL createHTML;
135
136 /** Specifies whether documentation set should be created from the HTML files.
137
138 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.
139
140 @see createHtml
141 @see installDocSet
142 @see publishDocSet
143 */
144 @property (assign) BOOL createDocSet;
145
146 /** Specifies whether the documentation set should be installed or not.
147
148 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.
149
150 @see createDocSet
151 @see publishDocSet
152 */
153 @property (assign) BOOL installDocSet;
154
155 /** Specifies whether the documentation set should be prepared for publishing or not.
156
157 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.
158
159 @see createDocSet
160 @see installDocSet
161 */
162 @property (assign) BOOL publishDocSet;
163
164 /** Specifies whether intermediate files should be kept in `outputPath` or not.
165
166 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!
167 */
168 @property (assign) BOOL keepIntermediateFiles;
169
efce669 @tomaz Implemented optional disabling of first paragraph repeat for members. Cl...
authored
170 /** Indicates whether the first paragraph needs to be repeated within method and property description or not.
171
172 If `YES`, first paragraph is repeated in members description, otherwise not.
173 */
174 @property (assign) BOOL repeatFirstParagraphForMemberDescription;
175
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
176 /* Indicates whether undocumented classes, categories or protocols should be kept or ignored when generating output.
177
178 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.
179
180 @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:
181
182 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.
183 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.
184 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.
185
186 @see keepUndocumentedMembers
187 @see findUndocumentedMembersDocumentation;
188 @see warnOnUndocumentedObject
189 */
190 @property (assign) BOOL keepUndocumentedObjects;
191
192 /* Indicates whether undocumented methods or properties should be processed or not.
193
194 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`!
195
196 @warning *Note:* This property works together with `keepUndocumentedObjects` and `findUndocumentedMembersDocumentation`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
197
198 @see keepUndocumentedObjects
199 @see findUndocumentedMembersDocumentation
200 @see warnOnUndocumentedMember
201 */
202 @property (assign) BOOL keepUndocumentedMembers;
203
204 /** Specifies whether undocumented inherited methods or properties should be searched for in known places.
205
206 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`.
207
208 @warning *Note:* This property works together with `keepUndocumentedObjects` and `keepUndocumentedMembers`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
209
210 @see keepUndocumentedObjects
211 @see keepUndocumentedMembers
212 */
213 @property (assign) BOOL findUndocumentedMembersDocumentation;
214
215 /** Indicates whether categories should be merges to classes they extend or not.
216
217 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.
218
219 Default value is `YES` and should be left so as this seems to be the way Apple has it's documentation generated.
220
221 @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.
222
223 @see keepMergedCategoriesSections
224 @see prefixMergedCategoriesSectionsWithCategoryName
225 */
226 @property (assign) BOOL mergeCategoriesToClasses;
227
228 /** Indicates whether category or extension sections should be preserved when merging into extended class.
229
230 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.
231
232 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.
233
234 @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` is used.
235
236 @see prefixMergedCategoriesSectionsWithCategoryName
237 @see mergeCategoriesToClasses
238 */
239 @property (assign) BOOL keepMergedCategoriesSections;
240
241 /** Indicates whether merged section names from categories should be prefixed with category name.
242
243 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.
244
245 @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!
246
247 @see keepMergedCategoriesSections
248 @see mergeCategoriesToClasses
249 */
250 @property (assign) BOOL prefixMergedCategoriesSectionsWithCategoryName;
251
252 ///---------------------------------------------------------------------------------------
253 /// @name Warnings handling
254 ///---------------------------------------------------------------------------------------
255
b427cd7 @tomaz Implemented settings for enabling or disabling validation warnings.
authored
256 /** Indicates whether appledoc will warn if `--output` argument is not given.
257
258 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.
259
260 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.
261 */
262 @property (assign) BOOL warnOnMissingOutputPathArgument;
263
264 /** Indicates whether appledoc will warn if `--company-id` argument is not given.
265
266 Although appledoc deducts this information from other values, it's better to warn the user as deducted information doesn't necessarily produce correct results.
267
268 Note that the warning is only issued if documentation set creation is requested.
269 */
270 @property (assign) BOOL warnOnMissingCompanyIdentifier;
271
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
272 /** Indicates whether appledoc will warn if it encounters an undocumented class, category or protocol.
273
274 @see warnOnUndocumentedMember
275 */
276 @property (assign) BOOL warnOnUndocumentedObject;
277
278 /** Indicates whether appldoc will warn if it encounters an undocumented method or property.
279
280 @see warnOnUndocumentedObject
281 */
282 @property (assign) BOOL warnOnUndocumentedMember;
283
7aa04af @tomaz Implemented optional disabling of invalid cross reference warnings.
authored
284 /** Indicates whether invalid cross reference should result in warning or not. */
285 @property (assign) BOOL warnOnInvalidCrossReference;
286
3a8da42 @tomaz Implemented optional disabling for missing method arguments warnings.
authored
287 /** Indicates whether missing method argument descriptions in comments should result in warnings or not. */
288 @property (assign) BOOL warnOnMissingMethodArgument;
289
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProviding ...
authored
290 ///---------------------------------------------------------------------------------------
291 /// @name Application-wide HTML helpers
292 ///---------------------------------------------------------------------------------------
293
294 /** Returns HTML reference name for the given object.
295
296 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 top-level objects as well as their members.
297
298 @param object The object for which to return reference name.
299 @return Returns the reference name of the object.
300 @exception NSException Thrown if the given object is `nil`.
301 @see htmlReferenceForObject:fromSource:
302 @see htmlReferenceForObjectFromIndex:
303 */
304 - (NSString *)htmlReferenceNameForObject:(GBModelBase *)object;
305
306 /** Returns relative HTML reference to the given object from the context of the given source object.
307
308 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:
309
310 - Index to top-level object (if source is `nil`).
311 - Index to a member of a top-level object (if source is `nil`).
312 - Top-level object to same top-level object.
313 - Top-level object to a different top-level object.
314 - Top-level object to one of it's members.
315 - Member object to it's top-level object.
316 - Member object to another top-level object.
317 - Member object to another member of the same top-level object.
318 - Member object to a member of another top-level object.
319
320 @param object The object for which to generate the reference to.
321 @param source The source object from which to generate the reference from or `nil` for index to object reference.
322 @return Returns the reference string.
323 @exception NSException Thrown if object is `nil`.
324 @see htmlReferenceForObjectFromIndex:
325 @see htmlReferenceNameForObject:
326 */
327 - (NSString *)htmlReferenceForObject:(GBModelBase *)object fromSource:(GBModelBase *)source;
328
329 /** Returns relative HTML reference to the given object from the context of index file.
330
331 This is simply a helper method for `htmlReferenceForObject:fromSource:`, passing the given object as object parameter and `nil` as source.
332
333 @pram object The object for which to generate the reference to.
334 @return Returns the reference string.
335 @exception NSException Thrown if object is `nil`.
336 @see htmlReferenceForObject:fromSource:
337 @see htmlReferenceNameForObject:
338 */
339 - (NSString *)htmlReferenceForObjectFromIndex:(GBModelBase *)object;
340
341 /** The file extension for html files.
342 */
343 @property (readonly) NSString *htmlExtension;
344
345 ///---------------------------------------------------------------------------------------
346 /// @name Helper methods
347 ///---------------------------------------------------------------------------------------
348
349 /** Replaces all occurences of placeholder strings in all related values of the receiver.
350
351 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.
352
353 Note that `stringByReplacingOccurencesOfPlaceholdersInString:` is still available for cases where placeholder strings may be used elsewhere (template files for example).
354
355 @see stringByReplacingOccurencesOfPlaceholdersInString:
356 */
357 - (void)replaceAllOccurencesOfPlaceholderStringsInSettingsValues;
358
359 /** Replaces all placeholders occurences in the given string.
360
361 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!):
362
363 - `$PROJECT`: Replaced by `projectName` value.
364 - `$COMPANY`: Replaced by `projectCompany` value.
365 - `$VERSION`: Replaced by `projectVersion` value.
366 - `$YEAR`: Replaced by current year as four digit string.
367 - `$UPDATEDATE`: Replaced by current date in the form of year, month and day with format `YYYY-MM-DD`. For example `2010-11-30`.
368
369 @param string The string to replace placeholder occurences in.
370 @return Returns new string with all placeholder occurences replaced.
371 @see replaceAllOccurencesOfPlaceholderStringsInSettingsValues
372 */
373 - (NSString *)stringByReplacingOccurencesOfPlaceholdersInString:(NSString *)string;
374
375 ///---------------------------------------------------------------------------------------
376 /// @name Helper classes
377 ///---------------------------------------------------------------------------------------
378
379 /** Returns the `GBCommentComponentsProvider` object that identifies comment components. */
380 @property (retain) GBCommentComponentsProvider *commentComponents;
381
382 /** Returns the `GBApplicationStringsProvider` object that specifies all string templates used for output generation. */
383 @property (retain) GBApplicationStringsProvider *stringTemplates;
384
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
385 @end
Something went wrong with that request. Please try again.