Skip to content

Commit

Permalink
now displays number small in printable_html (issue #48)
Browse files Browse the repository at this point in the history
  • Loading branch information
MareoRaft committed Jul 30, 2017
1 parent 52001f1 commit a6c9d9e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions server/lib/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 + '<h2>' + self.value + '</h2>'
string = string + '<h2>{}</h2>'.format(self.value)
return string

# make the number small
if display_number_small:
if self.name == 'number':
string = string + '<span class="number"># {}</span>'.format(self.value)
return string

# move onto real stuff
string = string + '<h4>' + self.name + '</h4>'
string = string + '<h4>{}</h4>'.format(self.name)
if self.cclass == str:
string = string + self.value
elif self.cclass == int:
Expand Down
2 changes: 1 addition & 1 deletion server/lib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions www/printable-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
body {
font: 300 normal 17px Helvetica, Tahoma, Arial, sans-serif;
}
.number {
font-size: 14px;
}
</style>
</head>
<body>
Expand Down

0 comments on commit a6c9d9e

Please sign in to comment.