A bit of styling for the 1-page version

This commit is contained in:
Ed Ward 2019-01-14 12:31:58 +01:00
parent ecdab5aaa7
commit dfd7223eb7
3 changed files with 29 additions and 24 deletions

View File

@ -496,6 +496,7 @@ for header in fileStruct:
# Handle TOC scriblings and one-page titles... # Handle TOC scriblings and one-page titles...
opl = '' opl = ''
if 'link' in header: if 'link' in header:
opl = ' id="' + header['link'] + '"' opl = ' id="' + header['link'] + '"'
else: else:
@ -503,19 +504,19 @@ for header in fileStruct:
if level == 0: if level == 0:
toc = toc + '<h2>Part ' + num2roman(levelNums[level]) + ': ' + header['title'] + '</h2>\n'; toc = toc + '<h2>Part ' + num2roman(levelNums[level]) + ': ' + header['title'] + '</h2>\n';
oph = '<h1 class="clear"' + opl +'>Part ' + num2roman(levelNums[level]) + ': ' + header['title'] + '</h1>\n'; oph = '<h1 class="clear"' + opl +'>' + num2roman(levelNums[level]) + ' - ' + header['title'] + '</h1>\n';
elif level == 1: elif level == 1:
toc = toc + ' <p class="chapter">Ch. ' + str(levelNums[level]) + ':&nbsp;&nbsp;<a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n' toc = toc + '\t<p class="chapter">Ch. ' + str(levelNums[level]) + ':&nbsp;&nbsp;<a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n'
oph = '<h1 class="clear"' + opl +'>Chapter ' + str(levelNums[level]) + ': ' + header['title'] + '</h1>\n'; oph = '<h1 class="clear"' + opl +'>' + str(levelNums[level-1]) + '.' + str(levelNums[level]) + ' - ' + header['title'] + '</h1>\n';
elif level == 2: elif level == 2:
toc = toc + ' <p class="subchapter"><a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n' toc = toc + '\t\t<p class="subchapter"><a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n'
oph = '<h1 class="clear"' + opl +'>Subchapter ' + str(levelNums[level]) + ': ' + header['title'] + '</h1>\n'; oph = '<h1 class="clear"' + opl +'>' + str(levelNums[level-2]) + '.' + str(levelNums[level-1]) + '.' + str(levelNums[level]) + ' - ' + header['title'] + '</h1>\n';
elif level == 3: elif level == 3:
toc = toc + ' <p class="section"><a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n' toc = toc + '\t\t\t<p class="section"><a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n'
oph = '<h1 class="clear"' + opl +'>Section ' + str(levelNums[level]) + ': ' + header['title'] + '</h1>\n'; oph = '<h1 class="clear"' + opl +'>' + str(levelNums[level-3]) + '.' + str(levelNums[level-2]) + '.' + str(levelNums[level-1]) + '.' + str(levelNums[level]) + ' - ' + header['title'] + '</h1>\n';
elif level == 4: elif level == 4:
toc = toc + ' <p class="subsection"><a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n' toc = toc + '\t\t\t\t<p class="subsection"><a href="/' + header['filename'] + '/">' + header['title'] + '</a></p>\n'
oph = '<h1 class="clear"' + opl +'>Subsection ' + str(levelNums[level]) + ': ' + header['title'] + '</h1>\n'; oph = '<h1 class="clear"' + opl +'>' + str(levelNums[level-4]) + '.' + str(levelNums[level-3]) + '.' + str(levelNums[level-2]) + '.' + str(levelNums[level-1]) + '.' + str(levelNums[level]) + ' - ' + header['title'] + '</h1>\n';
@ -653,6 +654,7 @@ tocFile.close()
# Create the one-page version of the documentation # Create the one-page version of the documentation
onepageFile = open(siteDir + 'ardourmanual.html', 'w') onepageFile = open(siteDir + 'ardourmanual.html', 'w')
onepage = onepage.replace('{{ content }}', '') # cleans up the last spaceholder
onepageFile.write(onepage) onepageFile.write(onepage)
onepageFile.close() onepageFile.close()

View File

@ -9,30 +9,28 @@
<link href="{{page.bootstrap_path}}/css/bootstrap.min.css" rel="stylesheet"> <link href="{{page.bootstrap_path}}/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/app.css" rel="stylesheet"> <link href="/css/app.css" rel="stylesheet">
{% if page.style %}
<link href="/css/{{page.style}}.css" rel="stylesheet">
{% endif %}
</head> </head>
<body> <body>
<div class="container-fluid"><div class="row-fluid"> <div class="container-fluid">
<div id="tree"><div id="tree-inner"> <div class="row-fluid">
<div id="tree" class="navbar">
<h1 class="title"><a href="/"><img class="img-responsive" src="/images/logo.png" alt="The Ardour Manual" /></a></h1> <h1 class="title"><a href="/"><img class="img-responsive" src="/images/logo.png" alt="The Ardour Manual" /></a></h1>
<div class="menu-list">
{% tree %} {% tree %}
</div> </div>
</div></div>
<div class="span12" id="content"> <div class="span12" id="content">
<div id="content-main"> <div id="content-main">
{{ content }} {{ content }}
<div class="clearer"></div>
</div> </div>
</div> </div>
</div></div> </div>
</div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -49,6 +49,11 @@ ul.inside li, ol.inside li {
margin-left: 1em; margin-left: 1em;
} }
#tree ul {
padding-left: 1em;
list-style-type: none;
}
#tree h1.title a:hover { #tree h1.title a:hover {
border-bottom: none; border-bottom: none;
} }