-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument_header.tcl
More file actions
82 lines (71 loc) · 2.44 KB
/
document_header.tcl
File metadata and controls
82 lines (71 loc) · 2.44 KB
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
proc document_header {title path {search {}}} {
set ret [subst -nocommands {
<!DOCTYPE html>
<html><head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="${path}sqlite.css" rel="stylesheet">
<title>$title</title>
<!-- path=$path -->
<link rel="stylesheet" href="${path}xcode-dark.css"/>
<script src="${path}highlight.min.js"></script>
<script>
hljs.configure({ languages: ['c', 'sql', 'sqlite', 'json', 'ini', 'shell'] });
document.addEventListener('DOMContentLoaded', function(event) {
document.getElementsByClassName("nosearch")[0]?.nextElementSibling?.children[0]?.classList.add("language-c");
document.querySelectorAll('pre').forEach(function(el) {
hljs.highlightElement(el);
});
});
</script>
</head>
}]
if {[file exists DRAFT]} {
set tagline {<font size="6" color="red">*** DRAFT ***</font>}
} else {
set tagline {Small. Fast. Reliable.<br>Choose any three.}
}
append ret [subst -nocommands {<body>}]
append ret [subst -nocommands {
<script>
function toggle_div(nm) {
var w = document.getElementById(nm);
if( w.style.display=="block" ){
w.style.display = "none";
}else{
w.style.display = "block";
}
}
function toggle_search() {
var w = document.getElementById("searchmenu");
if( w.style.display=="block" ){
w.style.display = "none";
} else {
w.style.display = "block";
setTimeout(function(){
document.getElementById("searchbox").focus()
}, 30);
}
}
function div_off(nm){document.getElementById(nm).style.display="none";}
window.onbeforeunload = function(e){div_off("submenu");}
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */
/* display of those diagrams on and off */
function hideorshow(btn,obj){
var x = document.getElementById(obj);
var b = document.getElementById(btn);
if( x.style.display!='none' ){
x.style.display = 'none';
b.innerHTML='show';
}else{
x.style.display = '';
b.innerHTML='hide';
}
return false;
}
</script>
}]
regsub -all {\n+\s+} [string trim $ret] \n ret
regsub -all {\s*/\*[- a-z0-9A-Z"*\n]+\*/} $ret {} ret
return $ret
}