Skip to content
Newer
Older
100644 605 lines (423 sloc) 32.5 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 GBApplicationSettingsProvidi…
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.…
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).
d4a942e @tomaz Added command line switches for warnings on empty descriptions and un…
authored
31 3. Add unit test in `GBAppledocApplicationTesting.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 GBApplicationSettingsProvidi…
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 GBApplicationSettingsProvidi…
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 GBApplicationSettingsProvidi…
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 GBApplicationSettingsProvidi…
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.…
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.…
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 GBApplicationSettingsProvidi…
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 GBApplicationSettingsProvidi…
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…
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…
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.…
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 GBApplicationSettingsProvidi…
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 GBApplicationSettingsProvidi…
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 adde…
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
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
311 ///---------------------------------------------------------------------------------------
312 /// @name Warnings handling
313 ///---------------------------------------------------------------------------------------
314
b427cd7 @tomaz Implemented settings for enabling or disabling validation warnings.
authored
315 /** Indicates whether appledoc will warn if `--output` argument is not given.
316
317 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.
318
319 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.
320 */
321 @property (assign) BOOL warnOnMissingOutputPathArgument;
322
323 /** Indicates whether appledoc will warn if `--company-id` argument is not given.
324
325 Although appledoc deducts this information from other values, it's better to warn the user as deducted information doesn't necessarily produce correct results.
326
327 Note that the warning is only issued if documentation set creation is requested.
328 */
329 @property (assign) BOOL warnOnMissingCompanyIdentifier;
330
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
331 /** Indicates whether appledoc will warn if it encounters an undocumented class, category or protocol.
332
333 @see warnOnUndocumentedMember
334 */
335 @property (assign) BOOL warnOnUndocumentedObject;
336
4f44437 @tomaz Added settings for enabling or disabling various processing warnings.
authored
337 /** Indicates whether appledoc will warn if it encounters an undocumented method or property.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
338
339 @see warnOnUndocumentedObject
340 */
341 @property (assign) BOOL warnOnUndocumentedMember;
342
4f44437 @tomaz Added settings for enabling or disabling various processing warnings.
authored
343 /** Indicates whether appledoc will warn if it encounters an empty description (@bug, @warning, example section etc.).
344 */
345 @property (assign) BOOL warnOnEmptyDescription;
346
347 /** Indicates whether appledoc will warn if it encounters unknown directive or styling element.
348 */
349 @property (assign) BOOL warnOnUnknownDirective;
350
7aa04af @tomaz Implemented optional disabling of invalid cross reference warnings.
authored
351 /** Indicates whether invalid cross reference should result in warning or not. */
352 @property (assign) BOOL warnOnInvalidCrossReference;
353
3a8da42 @tomaz Implemented optional disabling for missing method arguments warnings.
authored
354 /** Indicates whether missing method argument descriptions in comments should result in warnings or not. */
355 @property (assign) BOOL warnOnMissingMethodArgument;
356
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
357 ///---------------------------------------------------------------------------------------
358 /// @name Application-wide HTML helpers
359 ///---------------------------------------------------------------------------------------
360
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
361 /** Specifies whether cross references should be embedded to special strings when processing Markdown.
362
363 This should be left to default value, however it's useful to prevent embedding for unit testing.
364
365 @see stringByEmbeddingCrossReference:
a85a42b @tomaz Fixed conversion of single to double star within example blocks and s…
authored
366 @see embedAppledocBoldMarkersWhenProcessingMarkdown
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
367 */
368 @property (assign) BOOL embedCrossReferencesWhenProcessingMarkdown;
369
a85a42b @tomaz Fixed conversion of single to double star within example blocks and s…
authored
370 /** Specifies whether cross references should be embedded to special strings when processing Markdown.
371
372 This should be left to default value, however it's useful to prevent embedding for unit testing.
373
374 @see stringByEmbeddingCrossReference:
375 @see embedCrossReferencesWhenProcessingMarkdown
376 */
377 @property (assign) BOOL embedAppledocBoldMarkersWhenProcessingMarkdown;
378
379 /** 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
380
381 This should be used for all generated cross references, so that we can later detect them when converting HTML with `stringByConvertingMarkdownToHTML:`.
382
383 @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.
384
385 @param value The string to embedd.
386 @return Returns embedded string.
387 @see stringByConvertingMarkdownToHTML:
388 @see embedCrossReferencesWhenProcessingMarkdown
389 */
390 - (NSString *)stringByEmbeddingCrossReference:(NSString *)value;
391
a85a42b @tomaz Fixed conversion of single to double star within example blocks and s…
authored
392 /** Returns a new string with the given value embedded in special bold markers used for post processing.
393
394 This should be used for all appledoc style bold markers (single star), so that we can later detect them when converting HTML with `stringByConvertingMarkdownToHTML:`.
395
396 @warning *Important:* Behavior of this method depends on `embedAppledocBoldMarkersWhenProcessingMarkdown` value. If it's `YES`, strings are embedded, otherwise value is returned without embedding.
397
398 @param value The string to embedd.
399 @return Returns embedded string.
400 @see stringByConvertingMarkdownToHTML:
401 @see embedAppledocBoldMarkersWhenProcessingMarkdown
402 */
403 - (NSString *)stringByEmbeddingAppledocBoldMarkers:(NSString *)value;
404
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
405 /** Returns a new string containing HTML representation of the given Markdown string.
406
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
407 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:
408
409 - 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
410
411 @param markdown Markdown source string to convert.
412 @return Returns converted string.
604dffb @tomaz Fixed code blocks auto generated links handling.
authored
413 @see stringByEmbeddingCrossReference:
ac26896 @tomaz Fixed docsetutil `Entity '' not defined` error.
authored
414 @see stringByConvertingMarkdownToText:
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
415 @see stringByEscapingHTML:
416 */
ac26896 @tomaz Fixed docsetutil `Entity '' not defined` error.
authored
417 - (NSString *)stringByConvertingMarkdownToHTML:(NSString *)markdown;
418
419 /** Returns a new string containing text representation of the given Markdown string.
420
421 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`.
422
423 @param markdown Markdown source string to convert.
424 @return Returns converted string.
425 @see stringByConvertingMarkdownToHTML:
426 @see stringByEscapingHTML:
427 */
428 - (NSString *)stringByConvertingMarkdownToText:(NSString *)markdown;
593ea57 @tomaz Refactored HTML templates to use new layout.
authored
429
d7ece46 @tomaz Fixed HTML and XML handling within example blocks. Closes #54.
authored
430 /** Returns a new string by escaping the given HTML.
431
432 @param string HTML string to escape.
433 @return Returns escaped HTML string.
ac26896 @tomaz Fixed docsetutil `Entity '' not defined` error.
authored
434 @see stringByConvertingMarkdownToHTML:
435 @see stringByConvertingMarkdownToText:
d7ece46 @tomaz Fixed HTML and XML handling within example blocks. Closes #54.
authored
436 */
437 - (NSString *)stringByEscapingHTML:(NSString *)string;
438
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
439 /** Returns HTML reference name for the given object.
440
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
441 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 GBApplicationSettingsProvidi…
authored
442
443 @param object The object for which to return reference name.
444 @return Returns the reference name of the object.
445 @exception NSException Thrown if the given object is `nil`.
446 @see htmlReferenceForObject:fromSource:
447 @see htmlReferenceForObjectFromIndex:
448 */
449 - (NSString *)htmlReferenceNameForObject:(GBModelBase *)object;
450
451 /** Returns relative HTML reference to the given object from the context of the given source object.
452
453 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:
454
455 - Index to top-level object (if source is `nil`).
456 - Index to a member of a top-level object (if source is `nil`).
457 - Top-level object to same top-level object.
458 - Top-level object to a different top-level object.
459 - Top-level object to one of it's members.
460 - Member object to it's top-level object.
461 - Member object to another top-level object.
462 - Member object to another member of the same top-level object.
463 - Member object to a member of another top-level object.
464
465 @param object The object for which to generate the reference to.
466 @param source The source object from which to generate the reference from or `nil` for index to object reference.
467 @return Returns the reference string.
468 @exception NSException Thrown if object is `nil`.
469 @see htmlReferenceForObjectFromIndex:
470 @see htmlReferenceNameForObject:
471 */
472 - (NSString *)htmlReferenceForObject:(GBModelBase *)object fromSource:(GBModelBase *)source;
473
474 /** Returns relative HTML reference to the given object from the context of index file.
475
476 This is simply a helper method for `htmlReferenceForObject:fromSource:`, passing the given object as object parameter and `nil` as source.
477
d6b842b @tomaz Fixed comment warnings for various objects.
authored
478 @param object The object for which to generate the reference to.
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
479 @return Returns the reference string.
480 @exception NSException Thrown if object is `nil`.
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
481 @see htmlRelativePathToIndexFromObject:
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
482 @see htmlReferenceForObject:fromSource:
483 @see htmlReferenceNameForObject:
484 */
485 - (NSString *)htmlReferenceForObjectFromIndex:(GBModelBase *)object;
486
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
487 /** Returns relative HTML path from the given object to the index file location.
488
489 This is kind of reverse to `htmlReferenceForObjectFromIndex:`, except that it only returns the relative path, without index.html.
490
491 @param object The object from which to generate the path.
492 @return Returns relative path.
493 @exception NSException Thrown if object is `nil`.
494 @see htmlReferenceForObjectFromIndex:
495 @see htmlReferenceForObject:fromSource:
496 @see htmlReferenceNameForObject:
497 */
498 - (NSString *)htmlRelativePathToIndexFromObject:(id)object;
499
500 /** The subpath within `outputPath` where static documents are stored.
501 */
502 @property (readonly) NSString *htmlStaticDocumentsSubpath;
503
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
504 /** The file extension for html files.
505 */
506 @property (readonly) NSString *htmlExtension;
507
508 ///---------------------------------------------------------------------------------------
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
509 /// @name Application-wide template files helpers
510 ///---------------------------------------------------------------------------------------
511
512 /** Determines if the given path represents a template file or not.
513
514 The method simply checks the if the name of the last path component ends with `-template` string.
515
516 @param path The path to check.
517 @return Returns `YES` if the given path represents a template file, `NO` otherwise.
518 @see outputFilenameForTemplatePath:
519 */
520 - (BOOL)isPathRepresentingTemplateFile:(NSString *)path;
521
522 /** Returns the actual filename of the output file from the given template path.
523
524 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.
525
526 @param path The path to convert.
527 @return Returns filename that can be used for output.
e2c8832 @tomaz Fixed warnings due to invalid cross references in various comments.
authored
528 @see isPathRepresentingTemplateFile:
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
529 @see templateFilenameForOutputPath:
530 */
531 - (NSString *)outputFilenameForTemplatePath:(NSString *)path;
532
533 /** Returns the template name for the given filename.
534
535 This is reverse method for `outputFilenameForTemplatePath`. It adds `-template` string to the end of the given path filename, before the optional extension.
536
537 @param path The path to convert.
538 @return Returns template filename.
e2c8832 @tomaz Fixed warnings due to invalid cross references in various comments.
authored
539 @see isPathRepresentingTemplateFile:
97db241 @tomaz Implemented possibility to add arbitrary documentation. Closes #7.
authored
540 @see outputFilenameForTemplatePath:
541 */
542 - (NSString *)templateFilenameForOutputPath:(NSString *)path;
543
544 ///---------------------------------------------------------------------------------------
1586e38 @tomaz Refactored settings handling by removing GBApplicationSettingsProvidi…
authored
545 /// @name Helper methods
546 ///---------------------------------------------------------------------------------------
547
548 /** Replaces all occurences of placeholder strings in all related values of the receiver.
549
550 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.
551
552 Note that `stringByReplacingOccurencesOfPlaceholdersInString:` is still available for cases where placeholder strings may be used elsewhere (template files for example).
553
554 @see stringByReplacingOccurencesOfPlaceholdersInString:
555 */
556 - (void)replaceAllOccurencesOfPlaceholderStringsInSettingsValues;
557
558 /** Replaces all placeholders occurences in the given string.
559
560 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!):
561
f18465e @tomaz Fixed HTML footer year and last update strings. Closes #49.
authored
562 - `%PROJECT`: Replaced by `projectName` value.
563 - `%PROJECTID`: Replaced by `projectIdentifier` value.
564 - `%COMPANY`: Replaced by `projectCompany` value.
565 - `%COMPANYID`: Replaced by `companyIdentifier` value.
566 - `%VERSION`: Replaced by `projectVersion` value.
567 - `%VERSIONID`: Replaced by `versionIdentifier` value.
568 - `%DOCSETBUNDLEFILENAME`: Replaced by `docsetBundleFilename` value.
569 - `%DOCSETATOMFILENAME`: Replaced by `docsetAtomFilename` value.
570 - `%DOCSETPACKAGEFILENAME`: Replaced by `docsetPackageFilename` value.
571 - `%YEAR`: Replaced by current year as four digit string.
572 - `%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 GBApplicationSettingsProvidi…
authored
573
574 @param string The string to replace placeholder occurences in.
575 @return Returns new string with all placeholder occurences replaced.
576 @see replaceAllOccurencesOfPlaceholderStringsInSettingsValues
577 */
578 - (NSString *)stringByReplacingOccurencesOfPlaceholdersInString:(NSString *)string;
579
580 ///---------------------------------------------------------------------------------------
581 /// @name Helper classes
582 ///---------------------------------------------------------------------------------------
583
584 /** Returns the `GBCommentComponentsProvider` object that identifies comment components. */
585 @property (retain) GBCommentComponentsProvider *commentComponents;
586
587 /** Returns the `GBApplicationStringsProvider` object that specifies all string templates used for output generation. */
588 @property (retain) GBApplicationStringsProvider *stringTemplates;
589
7d6a323 @tomaz Copied all the changes from the old generating branch.
authored
590 @end
1f23b3e @tomaz Refactored template placeholder strings by moving them to global cons…
authored
591
592 #pragma -
593
594 extern NSString *kGBTemplatePlaceholderCompanyID;
595 extern NSString *kGBTemplatePlaceholderProjectID;
596 extern NSString *kGBTemplatePlaceholderVersionID;
597 extern NSString *kGBTemplatePlaceholderProject;
598 extern NSString *kGBTemplatePlaceholderCompany;
599 extern NSString *kGBTemplatePlaceholderVersion;
600 extern NSString *kGBTemplatePlaceholderDocSetBundleFilename;
601 extern NSString *kGBTemplatePlaceholderDocSetAtomFilename;
602 extern NSString *kGBTemplatePlaceholderDocSetPackageFilename;
603 extern NSString *kGBTemplatePlaceholderYear;
604 extern NSString *kGBTemplatePlaceholderUpdateDate;
Something went wrong with that request. Please try again.