73 createCollection, |
73 createCollection, |
74 ): |
74 ): |
75 """ |
75 """ |
76 Constructor |
76 Constructor |
77 |
77 |
78 @param htmlDir directory containing the HTML files (string) |
78 @param htmlDir directory containing the HTML files |
79 @param outputDir output directory for the files (string) |
79 @type str |
80 @param namespace namespace to be used (string) |
80 @param outputDir output directory for the files |
81 @param virtualFolder virtual folder to be used (string) |
81 @type str |
82 @param filterName name of the custom filter (string) |
82 @param namespace namespace to be used |
|
83 @type str |
|
84 @param virtualFolder virtual folder to be used |
|
85 @type str |
|
86 @param filterName name of the custom filter |
|
87 @type str |
83 @param filterAttributes ':' separated list of filter attributes |
88 @param filterAttributes ':' separated list of filter attributes |
84 (string) |
89 |
85 @param title title to be used for the generated help (string) |
90 @type str |
|
91 @param title title to be used for the generated help |
|
92 @type str |
86 @param createCollection flag indicating the generation of the |
93 @param createCollection flag indicating the generation of the |
87 collection files (boolean) |
94 collection files |
|
95 @type bool |
88 """ |
96 """ |
89 self.htmlDir = htmlDir |
97 self.htmlDir = htmlDir |
90 self.outputDir = outputDir |
98 self.outputDir = outputDir |
91 self.namespace = namespace |
99 self.namespace = namespace |
92 self.virtualFolder = virtualFolder |
100 self.virtualFolder = virtualFolder |
102 |
110 |
103 def remember(self, file, moduleDocument, basename=""): |
111 def remember(self, file, moduleDocument, basename=""): |
104 """ |
112 """ |
105 Public method to remember a documentation file. |
113 Public method to remember a documentation file. |
106 |
114 |
107 @param file The filename to be remembered. (string) |
115 @param file The filename to be remembered. |
108 @param moduleDocument The ModuleDocument object containing the |
116 @type str |
|
117 @param moduleDocument module documentation object containing the |
109 information for the file. |
118 information for the file. |
110 @param basename The basename of the file hierarchy to be documented. |
119 @type ModuleDocument |
111 The basename is stripped off the filename if it starts with |
120 @param basename base name of the file hierarchy to be documented. |
112 the basename. |
121 The base name is stripped off the filename if it starts with |
|
122 the base name. |
|
123 @type str |
113 """ |
124 """ |
114 self.remembered = True |
125 self.remembered = True |
115 if basename: |
126 if basename: |
116 file = file.replace(basename, "") |
127 file = file.replace(basename, "") |
117 |
128 |
167 |
178 |
168 def __generateSections(self, package, level): |
179 def __generateSections(self, package, level): |
169 """ |
180 """ |
170 Private method to generate the sections part. |
181 Private method to generate the sections part. |
171 |
182 |
172 @param package name of the package to process (string) |
183 @param package name of the package to process |
173 @param level indentation level (integer) |
184 @type str |
174 @return sections part (string) |
185 @param level indentation level |
|
186 @type int |
|
187 @return sections part |
|
188 @rtype str |
175 """ |
189 """ |
176 indent = level * " " |
190 indent = level * " " |
177 indent1 = indent + " " |
191 indent1 = indent + " " |
178 s = indent + '<section title="{0}" ref="{1}">\n'.format( |
192 s = indent + '<section title="{0}" ref="{1}">\n'.format( |
179 package == "00index" and self.title or package, |
193 package == "00index" and self.title or package, |
192 |
206 |
193 def __convertEol(self, txt, newline): |
207 def __convertEol(self, txt, newline): |
194 """ |
208 """ |
195 Private method to convert the newline characters. |
209 Private method to convert the newline characters. |
196 |
210 |
197 @param txt text to be converted (string) |
211 @param txt text to be converted |
198 @param newline newline character to be used (string) |
212 @type str |
199 @return converted text (string) |
213 @param newline newline character to be used |
|
214 @type str |
|
215 @return converted text |
|
216 @rtype str |
200 """ |
217 """ |
201 # step 1: normalize eol to '\n' |
218 # step 1: normalize eol to '\n' |
202 txt = txt.replace("\r\n", "\n").replace("\r", "\n") |
219 txt = txt.replace("\r\n", "\n").replace("\r", "\n") |
203 |
220 |
204 # step 2: convert to the target eol |
221 # step 2: convert to the target eol |
211 |
228 |
212 def generateFiles(self, basename="", newline=None): |
229 def generateFiles(self, basename="", newline=None): |
213 """ |
230 """ |
214 Public method to generate all index files. |
231 Public method to generate all index files. |
215 |
232 |
216 @param basename The basename of the file hierarchy to be documented. |
233 @param basename base name of the file hierarchy to be documented. |
217 The basename is stripped off the filename if it starts with |
234 The base name is stripped off the filename if it starts with |
218 the basename. |
235 the base name. |
219 @param newline newline character to be used (string) |
236 @type str |
|
237 @param newline newline character to be used |
|
238 @type str |
220 """ |
239 """ |
221 if not self.remembered: |
240 if not self.remembered: |
222 sys.stderr.write("No QtHelp to generate.\n") |
241 sys.stderr.write("No QtHelp to generate.\n") |
223 return |
242 return |
224 |
243 |