47 @return dictionary containing the data to query the presence of |
47 @return dictionary containing the data to query the presence of |
48 the executable |
48 the executable |
49 """ |
49 """ |
50 dataList = [] |
50 dataList = [] |
51 |
51 |
52 # 1. eric5-doc |
52 # 1. eric5_doc |
53 exe = 'eric5-doc' |
53 exe = 'eric5_doc' |
54 if Utilities.isWindowsPlatform(): |
54 if Utilities.isWindowsPlatform(): |
55 exe = os.path.join(getConfig("bindir"), exe +'.bat') |
55 exe = os.path.join(getConfig("bindir"), exe +'.bat') |
56 dataList.append({ |
56 dataList.append({ |
57 "programEntry" : True, |
57 "programEntry" : True, |
58 "header" : QApplication.translate("EricdocPlugin", |
58 "header" : QApplication.translate("EricdocPlugin", |
59 "Eric5 Documentation Generator"), |
59 "Eric5 Documentation Generator"), |
60 "exe" : exe, |
60 "exe" : exe, |
61 "versionCommand" : '--version', |
61 "versionCommand" : '--version', |
62 "versionStartsWith" : 'eric5-', |
62 "versionStartsWith" : 'eric5_', |
63 "versionPosition" : -3, |
63 "versionPosition" : -3, |
64 "version" : "", |
64 "version" : "", |
65 "versionCleanup" : None, |
65 "versionCleanup" : None, |
66 }) |
66 }) |
67 |
67 |
126 @return tuple of None and activation status (boolean) |
126 @return tuple of None and activation status (boolean) |
127 """ |
127 """ |
128 menu = e5App().getObject("Project").getMenu("Apidoc") |
128 menu = e5App().getObject("Project").getMenu("Apidoc") |
129 if menu: |
129 if menu: |
130 self.__projectAct = \ |
130 self.__projectAct = \ |
131 E5Action(self.trUtf8('Generate documentation (eric5-doc)'), |
131 E5Action(self.trUtf8('Generate documentation (eric5_doc)'), |
132 self.trUtf8('Generate &documentation (eric5-doc)'), 0, 0, |
132 self.trUtf8('Generate &documentation (eric5_doc)'), 0, 0, |
133 self, 'doc_eric5_doc') |
133 self, 'doc_eric5_doc') |
134 self.__projectAct.setStatusTip( |
134 self.__projectAct.setStatusTip( |
135 self.trUtf8('Generate API documentation using eric5-doc')) |
135 self.trUtf8('Generate API documentation using eric5_doc')) |
136 self.__projectAct.setWhatsThis(self.trUtf8( |
136 self.__projectAct.setWhatsThis(self.trUtf8( |
137 """<b>Generate documentation</b>""" |
137 """<b>Generate documentation</b>""" |
138 """<p>Generate API documentation using eric5-doc.</p>""" |
138 """<p>Generate API documentation using eric5_doc.</p>""" |
139 )) |
139 )) |
140 self.__projectAct.triggered[()].connect(self.__doEricdoc) |
140 self.__projectAct.triggered[()].connect(self.__doEricdoc) |
141 e5App().getObject("Project").addE5Actions([self.__projectAct]) |
141 e5App().getObject("Project").addE5Actions([self.__projectAct]) |
142 menu.addAction(self.__projectAct) |
142 menu.addAction(self.__projectAct) |
143 |
143 |
171 e5App().getObject("Project").getProjectLanguage() in \ |
171 e5App().getObject("Project").getProjectLanguage() in \ |
172 ["Python", "Python2", "Python3", "Ruby"]) |
172 ["Python", "Python2", "Python3", "Ruby"]) |
173 |
173 |
174 def __doEricdoc(self): |
174 def __doEricdoc(self): |
175 """ |
175 """ |
176 Private slot to perform the eric5-doc api documentation generation. |
176 Private slot to perform the eric5_doc api documentation generation. |
177 """ |
177 """ |
178 eolTranslation = { |
178 eolTranslation = { |
179 '\r' : 'cr', |
179 '\r' : 'cr', |
180 '\n' : 'lf', |
180 '\n' : 'lf', |
181 '\r\n' : 'crlf', |
181 '\r\n' : 'crlf', |
197 if res: |
197 if res: |
198 dia.exec_() |
198 dia.exec_() |
199 |
199 |
200 outdir = Utilities.toNativeSeparators(parms['outputDirectory']) |
200 outdir = Utilities.toNativeSeparators(parms['outputDirectory']) |
201 if outdir == '': |
201 if outdir == '': |
202 outdir = 'doc' # that is eric5-docs default output dir |
202 outdir = 'doc' # that is eric5_docs default output dir |
203 |
203 |
204 # add it to the project data, if it isn't in already |
204 # add it to the project data, if it isn't in already |
205 outdir = project.getRelativePath(outdir) |
205 outdir = project.getRelativePath(outdir) |
206 if outdir not in project.pdata['OTHERS']: |
206 if outdir not in project.pdata['OTHERS']: |
207 project.pdata['OTHERS'].append(outdir) |
207 project.pdata['OTHERS'].append(outdir) |
209 project.othersAdded(outdir) |
209 project.othersAdded(outdir) |
210 |
210 |
211 if parms['qtHelpEnabled']: |
211 if parms['qtHelpEnabled']: |
212 outdir = Utilities.toNativeSeparators(parms['qtHelpOutputDirectory']) |
212 outdir = Utilities.toNativeSeparators(parms['qtHelpOutputDirectory']) |
213 if outdir == '': |
213 if outdir == '': |
214 outdir = 'help' # that is eric5-docs default QtHelp output dir |
214 outdir = 'help' # that is eric5_docs default QtHelp output dir |
215 |
215 |
216 # add it to the project data, if it isn't in already |
216 # add it to the project data, if it isn't in already |
217 outdir = project.getRelativePath(outdir) |
217 outdir = project.getRelativePath(outdir) |
218 if outdir not in project.pdata['OTHERS']: |
218 if outdir not in project.pdata['OTHERS']: |
219 project.pdata['OTHERS'].append(outdir) |
219 project.pdata['OTHERS'].append(outdir) |