diff --git a/timesearch/offline_reading.py b/timesearch/offline_reading.py index 95a9064..544cde7 100644 --- a/timesearch/offline_reading.py +++ b/timesearch/offline_reading.py @@ -9,31 +9,33 @@ from . import tsdb HTML_HEADER = ''' +{title} '''.strip() + HTML_FOOTER = ''' @@ -55,7 +57,7 @@ function toggle_collapse(comment_div) } -''' +'''.strip() HTML_COMMENT = '''
@@ -243,9 +245,14 @@ def html_from_database(subreddit=None, username=None, specific_submission=None): html_basename = '%s.html' % submission_tree.identifier html_filepath = database.offline_reading_dir.with_child(html_basename) html_handle = open(html_filepath.absolute_path, 'w', encoding='utf-8') - html_handle.write(HTML_HEADER) + + header = HTML_HEADER.format(title=submission_tree.data.title) + html_handle.write(header) + html_handle.write(page) + html_handle.write(HTML_FOOTER) + html_handle.close() print('Wrote', html_filepath.relative_path)