MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / href

Function href

SLiCAP/SLiCAPhtml.py:1008–1032  ·  view source on GitHub ↗

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='')

Source from the content-addressed store, hash-verified

1006### HTML links and labels
1007
1008def 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
1034def links2html():
1035 """

Callers 1

links2htmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected