\n'
+
+ return content
+
+
#
# Create link sidebar given a position in the list.
#
def CreateLinkSidebar(fs, pos, childList):
# Build the list recursively from the top level nodes
+ #content = BuildList(FindTopLevelNodes(fs), fs, pos, childList)
content = BuildList(FindTopLevelNodes(fs), fs, pos, childList)
- # Shove the TOC link in the top...
- content = content[:7] + '
\n';
+
+
+
# Make the 'this thing contains...' stuff
if HaveChildren(fileStruct, pageNumber):
@@ -513,9 +611,6 @@ for header in fileStruct:
else:
content = '[something went wrong]'
- # Fix up any internal links
- content = FixInternalLinks(links, content, header['title'])
-
# Add header information to the page if in dev mode
if devmode:
devnote ='' + content
+ # ----- One page version -----
+
+ # Fix up any internal links
+ opcontent = FixInternalLinks(oplinks, content, header['title'])
+
+ # Create the link sidebar
+ opsidebar = BuildOnePageSidebar(fileStruct)
+
+ # Set up the actual page from the template
+ onepage = onepage.replace('{% tree %}', opsidebar)
+ onepage = onepage.replace('{{ content }}', oph + '\n' + opcontent + '{{ content }}')
+
+ # ----- Normal version -----
+
+ # Fix up any internal links
+ content = FixInternalLinks(links, content, header['title'])
+
# Set up the actual page from the template
if 'style' not in header:
page = re.sub("{% if page.style %}.*\n.*\n{% endif %}.*\n", "", template)
@@ -571,5 +683,12 @@ tocFile = open(siteDir + 'toc/index.html', 'w')
tocFile.write(page)
tocFile.close()
+# Create the one-page version of the documentation
+onepageFile = open(siteDir + 'ardourmanual.html', 'w')
+onepage = onepage.replace('{{ content }}', '') # cleans up the last spaceholder
+onepageFile.write(onepage)
+onepageFile.close()
+
+
if not quiet:
print('Processed ' + str(fileCount) + ' files.')