Creates an HTML page with the title in the title bar. If index==True the page will be used as new index page, else a link to this page will be placed on the current index page. :param pageTitle:Title of the page. :type param: str :param index: True or False :type
(pageTitle, index = False, label = '')
| 179 | ### User Functions ########################################################### |
| 180 | |
| 181 | def htmlPage(pageTitle, index = False, label = ''): |
| 182 | """ |
| 183 | Creates an HTML page with the title in the title bar. |
| 184 | |
| 185 | If index==True the page will be used as new index page, else a link to this |
| 186 | page will be placed on the current index page. |
| 187 | |
| 188 | :param pageTitle:Title of the page. |
| 189 | :type param: str |
| 190 | |
| 191 | :param index: True or False |
| 192 | :type index: Bool |
| 193 | |
| 194 | :param label: ID of a label to be assigned to this page. |
| 195 | :type label: str |
| 196 | |
| 197 | :return: None |
| 198 | :rtype: NoneType |
| 199 | |
| 200 | """ |
| 201 | if not ini.notebook: |
| 202 | if index == True: |
| 203 | # The page is a new index page |
| 204 | fileName = ini.html_prefix + 'index.html' |
| 205 | # Place link on old index page |
| 206 | href = '<li><a href="' + fileName +'">' + pageTitle + '</a></li>' |
| 207 | _insertHTML(ini.html_path + ini.html_index, href) |
| 208 | # Create the new HTML file |
| 209 | toc = '<h2>Table of contents</h2>' |
| 210 | html = _HTMLhead(pageTitle) + toc + '<ol>' + _HTMLINSERT + '</ol>' + _HTMLfoot(ini.html_index) |
| 211 | _writeFile(ini.html_path + fileName, html) |
| 212 | # Make this page the new index page |
| 213 | ini.html_index = fileName |
| 214 | else: |
| 215 | fileName = ini.html_prefix + '-'.join(pageTitle.split()) + '.html' |
| 216 | # Place link on the current index page |
| 217 | href = '<li><a href="' + fileName +'">' + pageTitle + '</a></li>' |
| 218 | _insertHTML(ini.html_path + ini.html_index, href) |
| 219 | # Create the new HTML page |
| 220 | if label != "": |
| 221 | ini.html_labels[label] = _Label(label, 'heading', fileName, pageTitle) |
| 222 | label = '<a id="' + label + '"></a>' |
| 223 | html = label + _HTMLhead(pageTitle) + _HTMLINSERT + _HTMLfoot(ini.html_index) |
| 224 | _writeFile(ini.html_path + fileName, html) |
| 225 | # Make this page the active HTML page |
| 226 | ini.html_page = fileName |
| 227 | ini.html_pages.append(fileName) |
| 228 | return |
| 229 | |
| 230 | def head2html(headText, label=''): |
| 231 | """ |
no test coverage detected