diff --git a/modules/purchase_trade/process_documentation.py b/modules/purchase_trade/process_documentation.py
index cafde12..0f1a74b 100644
--- a/modules/purchase_trade/process_documentation.py
+++ b/modules/purchase_trade/process_documentation.py
@@ -2,7 +2,6 @@
# this repository contains the full copyright notices and license terms.
import base64
import html
-import json
import mimetypes
import os
import posixpath
@@ -24,26 +23,39 @@ class ProcessDocumentation(ModelSingleton, ModelSQL, ModelView):
content = fields.Function(fields.Text('Content'), 'get_content')
def get_content(self, name):
- pages = _documentation_pages()
return HTML_TEMPLATE % {
- 'initial': pages.get('README.md', ''),
- 'pages': json.dumps(pages).replace('', '<\\/'),
+ 'content': _documentation_content(),
}
-def _documentation_pages():
- pages = {}
+def _documentation_content():
+ sections = []
+ index = DOCUMENTATION_ROOT / 'README.md'
+ if index.exists():
+ sections.append(_render_page(index))
+
for path in sorted(DOCUMENTATION_ROOT.rglob('*.md')):
- relative_name = _relative_name(path)
- markdown = path.read_text(encoding='utf-8')
- pages[relative_name] = _markdown_to_html(markdown, relative_name)
- return pages
+ if path == index:
+ continue
+ sections.append(_render_page(path))
+ return '\n'.join(sections)
+
+
+def _render_page(path):
+ relative_name = _relative_name(path)
+ markdown = path.read_text(encoding='utf-8')
+ return '