diff --git a/update.py b/update.py
index 2194ab0..7b7df17 100755
--- a/update.py
+++ b/update.py
@@ -6,6 +6,9 @@ import ox
api = ox.API('https://indiancine.ma/api/')
doc = api.getDocument(id='DWA')['data']['text']
+indent = ' '
+indent_s = ' '
+
section_html = []
menu_html = []
for section in doc.split('
')[1:]:
@@ -13,11 +16,13 @@ for section in doc.split('')[1:]:
name = title.lower()
html = section[section.index('
')+5:]
menu_html.append('{}'.format(name, title))
- section_html.append('
{}\n
'.format(name, html))
+ html = html.replace('
', '').replace('', '')
+ html = '\n'.join([indent + r for r in html.strip().split('\n')])
+ section_html.append(indent_s + '\n{}\n{}
'.format(name, html, indent_s))
section_html = '\n'.join(section_html)
-menu_html = '\n'
-menu_html += ' \n'
+menu_html = '\n'
+menu_html += indent_s + '\n'
with open('index.html') as fd:
index = fd.read()