From a6c9d9eb2deb0760578ee17f49f2ffafc373843b Mon Sep 17 00:00:00 2001 From: Matthew Lancellotti Date: Sun, 30 Jul 2017 15:28:00 -0400 Subject: [PATCH] now displays number small in printable_html (issue #48) --- server/lib/attr.py | 12 +++++++++--- server/lib/node.py | 2 +- www/printable-content.html | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/server/lib/attr.py b/server/lib/attr.py index 09de1d9..6a5d11b 100644 --- a/server/lib/attr.py +++ b/server/lib/attr.py @@ -144,7 +144,7 @@ def as_dict(self): def __str__(self): return 'Attr{}'.format(self.as_dict()) - def as_printable_html(self, display_large_name=True): + def as_printable_html(self, display_large_name=True, display_number_small=True): string = '' # check for stupid blank stuff @@ -156,11 +156,17 @@ def as_printable_html(self, display_large_name=True): # make the name a big title if display_large_name: if self.name == 'name': - string = string + '

' + self.value + '

' + string = string + '

{}

'.format(self.value) + return string + + # make the number small + if display_number_small: + if self.name == 'number': + string = string + '# {}'.format(self.value) return string # move onto real stuff - string = string + '

' + self.name + '

' + string = string + '

{}

'.format(self.name) if self.cclass == str: string = string + self.value elif self.cclass == int: diff --git a/server/lib/node.py b/server/lib/node.py index 88d00b4..eef0c20 100644 --- a/server/lib/node.py +++ b/server/lib/node.py @@ -158,7 +158,7 @@ def __ne__(self, other): def as_printable_html(self, display_node_type_in_description=True): # keys to display # 'type', 'number', 'name', 'description', 'synonyms', 'plurals', 'notes', 'intuitions', 'examples', 'counterexamples', 'negation', 'proofs', 'importance' - keys = ['type', 'name', 'description', 'notes', 'intuitions', 'examples', 'counterexamples', 'proofs'] + keys = ['type', 'name', 'number', 'description', 'notes', 'intuitions', 'examples', 'counterexamples', 'proofs'] string = '' string += '$\\begingroup$' # start scope for key in keys: diff --git a/www/printable-content.html b/www/printable-content.html index 596edd9..3c7c6fe 100644 --- a/www/printable-content.html +++ b/www/printable-content.html @@ -22,6 +22,9 @@ body { font: 300 normal 17px Helvetica, Tahoma, Arial, sans-serif; } + .number { + font-size: 14px; + }