diff --git a/src/PlumedToHTML/PlumedFormatter.py b/src/PlumedToHTML/PlumedFormatter.py index 2c2a8f2..7b3508a 100644 --- a/src/PlumedToHTML/PlumedFormatter.py +++ b/src/PlumedToHTML/PlumedFormatter.py @@ -32,7 +32,7 @@ def __init__(self, **options) : def format(self, tokensource, outfile): action, label, all_labels, keywords, shortcut_state, shortcut_depth, default_state, notooltips, expansion_label, hidden_state, hidenum, nfiles = "", "", set(), [], 0, 0, 0, False, "", 0, 0, 0 - outfile.write('
\n')
+ outfile.write('\n')
for ttype, value in tokensource :
# This checks if we are at the start of a new action. If we are we should be reading a value or an action and the label and action for the previous one should be set
if len(action)>0 and (ttype==String or ttype==Keyword or ttype==Comment.Preproc) :
diff --git a/src/PlumedToHTML/PlumedToHTML.py b/src/PlumedToHTML/PlumedToHTML.py
index 348e49d..6480bcc 100644
--- a/src/PlumedToHTML/PlumedToHTML.py
+++ b/src/PlumedToHTML/PlumedToHTML.py
@@ -358,21 +358,37 @@ def get_html( inpt, name, outloc, tested, broken, plumedexe, usejson=None, maxch
plumed_formatter = load_formatter_from_file(formatfile, "PlumedFormatter", keyword_dict=keyword_dict, input_name=name, hasload=found_load, broken=any(broken), auxinputs=inputfiles, auxinputlines=inputfilelines, valuedict=valuedict, actions=actions )
# Now generate html of input
- html = '\n'
- html += ' Click on the labels of the actions for more information on what each action computes \n'
- html += ''
+ html = '\n'
+ html += f' Click on the labels of the actions for more information on what each action computes \n'
+ html += '\n'
for i in range(len(tested)) :
+ html +=''
btype = 'passing-green.svg'
- if broken[i] : btype = 'failed-red.svg'
- html += ''
- if ghmarkdown : html += ''
- else : html += ''
- html += '![tested on' + tested[i] + '](\"https://img.shields.io/badge/')
'
+ if broken[i] :
+ btype = 'failed-red.svg'
+ #this if can be collapsed in a f''
+ #but like this it might be clearer, what do you think?
+ if ghmarkdown :
+ html += f''
+ else :
+ html += f''
+ html += f'
'
+ html += ''
+ html += '\n'
+
if found_load :
- html += '
\n'
+ html += ''
+ html += '
'
+ html += '\n'
+
if len(incomplete)>0 :
- html += "
\n"
- html += '
\n'
+ html += ''
+ html += f'
"
+ html += "\n"
+
+ html += '\n\n'
+
if len(incomplete)>0 :
# This creates the input with the __FILL__
html += "\n"
@@ -622,7 +638,10 @@ def compare_to_reference( output, reference ) :
soup_tooltips = soup.find_all(attrs={'class': 'plumedtooltip'})
print("CHECK TOOLTIP", soup_tooltips )
print("TOOLTIP NUMBER CORRECT", len(soup_tooltips), len(reference["tooltips"]))
- if len(soup_tooltips)!=len(reference["tooltips"]) : return False
+ if len(soup_tooltips)!=len(reference["tooltips"]) :
+ print ("REFERENCE tooltips: ",reference["tooltips"])
+ print ("FOUND tooltips: ",[x.contents[0] for x in soup_tooltips])
+ return False
for i in range(len(soup_tooltips)) :
print("COMPARISON", soup_tooltips[i].contents[0], reference["tooltips"][i] )
if soup_tooltips[i].contents[0]!=reference["tooltips"][i] : return False
diff --git a/src/PlumedToHTML/assets/header.html b/src/PlumedToHTML/assets/header.html
index ba7a743..bc099b9 100644
--- a/src/PlumedToHTML/assets/header.html
+++ b/src/PlumedToHTML/assets/header.html
@@ -1,4 +1,23 @@