-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.html
184 lines (157 loc) · 5.25 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!--
Original template from Brett Terpstra (2013)
modified to retrieve css and js script from another location
by Mario D'Amore alias kidpixo , 2003
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{%title%}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Import Stylesheet -->
<link rel="stylesheet" href="file://[CUSTOMIZE WITH YOUR DROPBOX PATH]/nvalt_dropbox_custom_template/styles/custom_BRETT.css">
<!-- available text styles css:
UpstandingCitizen.css
amblin.css
antique.css
custom.css
custom_BRETT.css
danielmiessler.css
github.css
gridless.css
group_wiki.css
modern.css
swiss.css
tocstyle.css
-->
<!-- Import Stylesheet for code highlight -->
<link rel="stylesheet" href="file://[CUSTOMIZE WITH YOUR DROPBOX PATH]/nvalt_dropbox_custom_template/code_highlight/sunburst.css">
<!-- available code_highlight css:
ir_black.css : black background, well contrasted text
solarized_dark.css : black background, well contrasted text (back : #002b36)
sunburst.css : black background, well contrasted text
arta.css : dark background, some contrasted text
dark.css : dark background, low contrast text
zenburn.css : dark background, low contrast text
xcode.css : white background, well contrasted text
magula.css : white background, well contrasted text
solarized_light.css : white background, contrasted text
vs.css : white background, contrasted text
default.css : white background, some contrasted text
github.css : white background, some contrasted text
idea.css : white background, some contrasted text
ascetic.css : white background, low contrasted text
see http://highlightjs.org/static/test.html for tests
-->
</head>
<body>
<div id="wrapper">
<header>
<h1 class="doctitle">{%title%}</h1>
</header>
<div id="contentdiv">
{%content%}
</div>
</div> <!-- end of #container -->
<script src="file://[CUSTOMIZE WITH YOUR DROPBOX PATH]/nvalt_dropbox_custom_template/jquery.min.js"></script>
<script>
(function($){
// widont
$('h1,h2,h3,h4').each(function(){
$(this).html($(this).text().replace(/([^\\s])\\s+([^\\s]{1,5})\\s*$/,"$1 $2"));
});
// smooth scroll to anchors and footnotes
$('a[href^=#]').click(function(){
if( location.pathname.replace(/^\\/,'') === this.pathname.replace(/^\\/,'') && location.hostname === this.hostname) {
var $target = $(this.hash);
$target = $target.length ? $target : $('[id='+this.hash.slice(1)+']');
if($target.length){
var targetOffset = $target.offset().top;
$('#contentdiv').animate({ scrollTop: targetOffset - 40 }, 1000);
return false;
}
}
});
// back-to-top link fade in/out
$(window).scroll(function(){
if( $(window).scrollTop() > 150) {
if(!$('#backtotop').length) {
$('h1.doctitle').append($('<a href="javascript:void()" id="backtotop" />').text('Back to top').css({'float':'right','display':'none'}).click(function(){
$('html,body').animate({scrollTop:0},500);
}));
$('#backtotop').fadeIn(400);
}
} else {
$('#backtotop').fadeOut(400,function(){
$(this).remove();
});
}
});
})(jQuery);
</script>
<script src="file://[CUSTOMIZE WITH YOUR DROPBOX PATH]/nvalt_dropbox_custom_template/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
////////////////////////////////////////////////////////////
// Create a Table of Contents based on the Header level,
// only if the id='toc' is found in the document.
//
// The first header element fix the base index,
// subsequent elemnts get a indentation equal to :
// (actual index-basis )*margin_pixels
//
// Some tweak:
//
// 1. Change the id to add the table to: the variable toc_id
// 2. Adjust margin_pixels here below to have less or more space.
// 3. Adjust the percent of font redutcion for each level down
//
////////////////////////////////////////////////////////////
var toc_id = 'toc'
if( $("#"+toc_id).length != 0) {
var margin_pixels = 10
var font_scaling_step = 15 // % of font reduction for each level down
var toc_container =
"<nav role='navigation' class='table-of-contents'>" +
"<ul>";
var basehIndex = "";
var newLine, el, title, link;
$("h2,h3,h4,h5").each(function() {
el = $(this);
title = el.text();
link = "#" + el.attr("id");
hIndex = parseInt(this.nodeName.substring(1))
if( basehIndex.length == 0 ) {
basehIndex = hIndex // first index fix the base of this document
}
var margin = ""
if( hIndex > basehIndex ) {
margin = ' style="font-size: '+(100.-font_scaling_step*(hIndex-basehIndex))+'% ; margin-left: '+margin_pixels*(hIndex-basehIndex)+'px;"'
}
newLine =
"<li"+margin+">" +
"<a href='" + link + "'>" +
title +
"</a>" +
"</li>";
toc_container += newLine;
});
toc_container +=
"</ul>" +
"</nav>";
$("#"+toc_id).after(toc_container);
}
</script>
<!--
<h1>Available Keywords:</h1>
support :<br>
{%support%}<br>
title :<br>
{%title%}<br>
style :<br>
{%style%}<br>
-->
</body>
</html>