diff --git a/decode.py b/decode.py index 4f0bd19..f4373ac 100755 --- a/decode.py +++ b/decode.py @@ -69,9 +69,9 @@ def main(fname, oname = None, verbose = True, encoding = 'std', namestr = '' if for_html: if code: - namestr = ('
' + truename - + 'image' + ': ' + str(dist) + '
') + namestr = ('
' + ': ' + str(dist) + '
') else: namestr = '
' + truename + ': ' + str(dist) + '
' elif for_forum: @@ -111,10 +111,14 @@ def main(fname, oname = None, verbose = True, encoding = 'std', if creativity: cstring = '~~ closest cards ~~\n' + if for_html: + cstring += "
\n" nearest = card.nearest_cards for dist, cardname in nearest: cstring += hoverimg(cardname, dist, namediff) cstring += '~~ closest names ~~\n' + if for_html: + cstring += "
\n" nearest = card.nearest_names for dist, cardname in nearest: cstring += hoverimg(cardname, dist, namediff) diff --git a/lib/cardlib.py b/lib/cardlib.py index c655c17..5dc5a0c 100644 --- a/lib/cardlib.py +++ b/lib/cardlib.py @@ -651,6 +651,12 @@ class Card: rarity = self.__dict__[field_rarity] outstr += ' (' + rarity + ')' + if for_html and for_forum: + #force for_html to false to create tootip with forum spoiler + outstr += ('
[F]

' + + self.format(gatherer=gatherer, for_forum=for_forum, for_html=False, vdump=vdump).replace('\n', '
') + + '

') + if vdump: if not self.parsed: outstr += ' _UNPARSED_' @@ -736,6 +742,12 @@ class Card: outstr += ' _UNPARSED_' if not self.valid: outstr += ' _INVALID_' + + if for_html and for_forum: + #force for_html to false to create tootip with forum spoiler + outstr += ('
[F]

' + + self.format(gatherer=gatherer, for_forum=for_forum, for_html=False, vdump=vdump).replace('\n', '
') + + '

') outstr += linebreak @@ -810,13 +822,14 @@ class Card: outstr += linebreak outstr += self.bside.format(gatherer=gatherer, for_forum=for_forum, for_html=for_html, vdump=vdump) + # if for_html: + # if for_forum: + # outstr += linebreak + # # force for_html to false to create a copyable forum spoiler div + # outstr += ('
' + # + self.format(gatherer=gatherer, for_forum=for_forum, for_html=False, vdump=vdump).replace('\n', '
') + # + '
') if for_html: - if for_forum: - outstr += linebreak - # force for_html to false to create a copyable forum spoiler div - outstr += ('
' - + self.format(gatherer=gatherer, for_forum=for_forum, for_html=False, vdump=vdump).replace('\n', '
') - + '
') outstr += "" return outstr diff --git a/lib/html_extra_data.py b/lib/html_extra_data.py index db62a9d..60a3673 100644 --- a/lib/html_extra_data.py +++ b/lib/html_extra_data.py @@ -1,371 +1,455 @@ box_width = 350 html_prepend = """ - -""" + + + +"""