Returns the html code for a jump to a label 'labelName'. This label can be on any page. If referring backwards 'fileName' can be detected automatically. When referring forward 'fileName' must be the name of the file that will be created later. Run a project 2 times without closi
(label, fileName='')
| 1006 | ### HTML links and labels |
| 1007 | |
| 1008 | def href(label, fileName=''): |
| 1009 | """ |
| 1010 | Returns the html code for a jump to a label 'labelName'. |
| 1011 | This label can be on any page. If referring backwards 'fileName' can be |
| 1012 | detected automatically. When referring forward 'fileName' must be the |
| 1013 | name of the file that will be created later. Run a project 2 times without |
| 1014 | closing it after the first run, automaitcally detects all labels. |
| 1015 | |
| 1016 | :param label: ID of the label. |
| 1017 | :type label: str |
| 1018 | |
| 1019 | :param fileName: Name of the HTML page for inserting the link. |
| 1020 | :type fileName: str |
| 1021 | |
| 1022 | :return: HTML code that will be inserted |
| 1023 | :rtype: str |
| 1024 | """ |
| 1025 | html = '' |
| 1026 | if fileName == '': |
| 1027 | fileName = ini.html_labels[label][1] |
| 1028 | if fileName == ini.html_page: |
| 1029 | html = '<a href="#' + label + '">' + ini.html_labels[label][2] + '</a>' |
| 1030 | else: |
| 1031 | html = '<a href="' + fileName + '#' + label + '">' + ini.html_labels[label][2] + '</a>' |
| 1032 | return html |
| 1033 | |
| 1034 | def links2html(): |
| 1035 | """ |