-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.html
More file actions
341 lines (322 loc) · 15.2 KB
/
template.html
File metadata and controls
341 lines (322 loc) · 15.2 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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Self Thinking Data Manifest Specification v0.1</title>
<style>
/* Basic Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.6; color: #333; background-color: #f8f9fa; padding: 20px; }
.container { max-width: 900px; margin: 20px auto; background-color: #ffffff; padding: 30px 40px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
h1 { font-size: 2.2em; color: #0056b3; margin-bottom: 25px; border-bottom: 2px solid #dee2e6; padding-bottom: 10px; text-align: center; }
h2 { font-size: 1.8em; color: #17a2b8; margin-top: 40px; margin-bottom: 20px; border-bottom: 1px solid #e9ecef; padding-bottom: 8px; }
h3 { font-size: 1.4em; color: #6c757d; margin-top: 25px; margin-bottom: 15px; }
p { margin-bottom: 15px; text-align: justify; }
ul, ol { margin-left: 25px; margin-bottom: 15px; }
li { margin-bottom: 8px; }
ul ul, ol ol, ul ol, ol ul { margin-left: 20px; margin-top: 8px; }
b, strong { font-weight: bold; color: #333; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; background-color: #e9ecef; padding: 0.2em 0.4em; border-radius: 3px; font-size: 0.9em; color: #c7254e; }
pre { background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 4px; padding: 1em; overflow-x: auto; margin-bottom: 15px; white-space: pre-wrap; word-wrap: break-word; }
pre code { background-color: transparent; padding: 0; border-radius: 0; color: inherit; font-size: 0.9em; white-space: pre-wrap; word-wrap: break-word; border: none; }
hr { border: 0; height: 1px; background: #dee2e6; margin: 40px 0; }
.footer-note { text-align: center; font-style: italic; color: #6c757d; margin-top: 20px; font-size: 0.9em; }
/* Pygments CSS for Syntax Highlighting (Optional but recommended) */
.codehilite pre { background-color: #f8f9fa !important; padding: 1em !important; border: 1px solid #dee2e6 !important; }
.codehilite .hll { background-color: #ffc; } /* Highlighted line */
.codehilite .c { color: #999; } /* Comment */
.codehilite .k { color: #069; } /* Keyword */
.codehilite .o { color: #555; } /* Operator */
.codehilite .cm { color: #999; } /* Comment.Multiline */
.codehilite .cp { color: #099; } /* Comment.Preproc */
.codehilite .c1 { color: #999; } /* Comment.Single */
.codehilite .cs { color: #999; } /* Comment.Special */
.codehilite .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .gr { color: #f00 } /* Generic.Error */
.codehilite .gh { color: #030 } /* Generic.Heading */
.codehilite .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */
.codehilite .go { color: #aaa } /* Generic.Output */
.codehilite .gp { color: #009 } /* Generic.Prompt */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #030 } /* Generic.Subheading */
.codehilite .gt { color: #9c6 } /* Generic.Traceback */
.codehilite .kc { color: #069 } /* Keyword.Constant */
.codehilite .kd { color: #069 } /* Keyword.Declaration */
.codehilite .kn { color: #069 } /* Keyword.Namespace */
.codehilite .kp { color: #069 } /* Keyword.Pseudo */
.codehilite .kr { color: #069 } /* Keyword.Reserved */
.codehilite .kt { color: #078 } /* Keyword.Type */
.codehilite .m { color: #f60 } /* Literal.Number */
.codehilite .s { color: #d44950 } /* Literal.String */
.codehilite .na { color: #4f9fcf } /* Name.Attribute */
.codehilite .nb { color: #366 } /* Name.Builtin */
.codehilite .nc { color: #0a8 } /* Name.Class */
.codehilite .no { color: #360 } /* Name.Constant */
.codehilite .nd { color: #99f } /* Name.Decorator */
.codehilite .ni { color: #999 } /* Name.Entity */
.codehilite .ne { color: #c00 } /* Name.Exception */
.codehilite .nf { color: #06c } /* Name.Function */
.codehilite .nl { color: #99f } /* Name.Label */
.codehilite .nn { color: #0a8 } /* Name.Namespace */
.codehilite .nt { color: #2f6f9f; } /* Name.Tag */
.codehilite .nv { color: #033 } /* Name.Variable */
.codehilite .ow { color: #000 } /* Operator.Word */
.codehilite .w { color: #bbb } /* Text.Whitespace */
.codehilite .mf { color: #f60 } /* Literal.Number.Float */
.codehilite .mh { color: #f60 } /* Literal.Number.Hex */
.codehilite .mi { color: #f60 } /* Literal.Number.Integer */
.codehilite .mo { color: #f60 } /* Literal.Number.Oct */
.codehilite .sb { color: #d44950 } /* Literal.String.Backtick */
.codehilite .sc { color: #d44950 } /* Literal.String.Char */
.codehilite .sd { color: #d44950; font-style: italic } /* Literal.String.Doc */
.codehilite .s2 { color: #d44950 } /* Literal.String.Double */
.codehilite .se { color: #c678dd } /* Literal.String.Escape */
.codehilite .sh { color: #d44950 } /* Literal.String.Heredoc */
.codehilite .si { color: #f60 } /* Literal.String.Interpol */
.codehilite .sx { color: #d44950 } /* Literal.String.Other */
.codehilite .sr { color: #099 } /* Literal.String.Regex */
.codehilite .s1 { color: #d44950 } /* Literal.String.Single */
.codehilite .ss { color: #f60 } /* Literal.String.Symbol */
.codehilite .bp { color: #366 } /* Name.Builtin.Pseudo */
.codehilite .vc { color: #033 } /* Name.Variable.Class */
.codehilite .vg { color: #033 } /* Name.Variable.Global */
.codehilite .vi { color: #033 } /* Name.Variable.Instance */
.codehilite .il { color: #f60 } /* Literal.Number.Integer.Long */
@media (max-width: 768px) {
.container { padding: 20px; }
h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }
p { text-align: left; }
}
@keyframes shine {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
</style>
<script>
// Basic script to confirm JS is running.
document.addEventListener('DOMContentLoaded', () => {
console.log("STDM v0.1 Specification page loaded successfully.");
});
</script>
<!-- STDM START: This block contains the STDM instructions and metadata -->
<!--
{{stdm_instructions_block_content}}
-->
<!-- STDM END -->
</head>
<body>
<style>
@keyframes shine {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.tooltip {
visibility: hidden;
width: 300px;
background-color: #fff;
color: #333;
text-align: center;
border-radius: 20px;
padding: 15px;
position: fixed;
z-index: 900;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
transition: opacity 0.3s, visibility 0.3s;
font-size: 9px;
line-height: 1.5;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
border: 2px solid #ddd;
}
/* Thought bubble pointer */
.tooltip:after {
content: '';
position: absolute;
top: -15px;
right: 30px;
border-width: 0 15px 15px;
border-style: solid;
border-color: #fff transparent;
display: block;
width: 0;
}
#thinking-data-ribbon:hover .tooltip {
visibility: visible;
opacity: 1;
}
#thinking-data-ribbon .close-btn{
position: relative;
z-index: 1001;
}
</style>
<div id="thinking-data-ribbon"
style="position: fixed;
top: 0;
right: 0;
width: 350px;
z-index: 999;
padding: 15px 0;
text-align: center;
background: linear-gradient(135deg,
rgba(255,200,200,0.9), rgba(255,255,200,0.9),
rgba(200,255,200,0.9), rgba(200,255,255,0.9),
rgba(200,200,255,0.9), rgba(255,200,255,0.9));
background-size: 200% 200%;
animation: shine 6s ease-in-out infinite;
color: #333;
font-family: Arial, sans-serif;
font-size: 15px;
box-shadow: 0 2px 10px rgba(0,0,0,0.2), 0 0 30px rgba(255,255,255,0.4);
transform: rotate(45deg) translate(100px, -45px);
transform-origin: center;
border: 1px solid rgba(255,255,255,0.6);
border-left: 2px solid rgba(255,255,255,0.9);
border-bottom: 2px solid rgba(255,255,255,0.9);
clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);">
<a href=""
style="font-family: 'Arial Black', Arial, sans-serif;
font-weight: bold;
font-size: 14px;
background: linear-gradient(90deg,
#ff0000, #ff9900, #ffff00,
#00ff00, #00ffff, #0000ff,
#9900ff, #ff0099, #ff0000);
background-size: 200% 100%;
animation: shine 3s linear infinite;
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
text-decoration: none;
text-shadow: 0 0 2px rgba(255,255,255,0.7);
letter-spacing: 0px;
display: inline-block;
padding: 0 3px;">
Thinking Data
</a>
<span class="close-btn" style="cursor: pointer;
transform: translate(20px, 10px);
padding: 0 3px;
margin-left: 1px;
font-size: 14px;
font-weight: bold;
text-shadow: 0 0 2px #fff;
display: inline-block;
vertical-align: middle;"
title="Close"
onclick="document.getElementById('thinking-data-ribbon').style.display='none';">
×
</span>
<div class="tooltip">
Save page <br/> drag to LLM to activate embedded instructions <br/> view source to inspect instructions
</div>
</div>
<div class="container">
<h1>Self Thinking Data Manifest Specification v0.1</h1>
<div style="background: #f8f9fa; border-bottom: 1px solid #ccc; padding: 1em; text-align: center; font-family: sans-serif;">
<strong>This document is an STDM (Self-Thinking Data Manifest).</strong>
<div style="margin: 0.5em 0;">
<button onclick="downloadPage()" style="padding: 0.5em 1em; font-size: 1em; cursor: pointer;">⬇️ Download Full Spec</button>
<button onclick="downloadExample()" style="padding: 0.5em 1em; font-size: 1em; cursor: pointer; margin-left: 0.5em;">⬇️ Download Example</button>
</div>
<div style="margin: 0.5em 0;">
<span>To use: <em>Download</em> this file and drag it into an LLM with the prompt: <code>Follow the instructions in the document</code>.</span>
</div>
<div style="color: #b94a48; background: #fff3cd; border: 1px solid #f5c6cb; border-radius: 4px; padding: 0.5em; margin-top: 0.7em; font-size: 0.97em;">
<strong>Warning:</strong> This specification is in development. Uploading this page to an LLM with "Follow the instructions" will result in the LLM performing behaviours encoded in the embedded instructions.
</div>
</div>
<!-- DATA START: Contains the primary data (the spec itself) in MARKDOWN format -->
{{rendered_specification_html_content}}
<!-- DATA END: Contains the primary data (the spec itself) in MARKDOWN format -->
<hr>
<p class="footer-note">End of STDM v0.1 Specification Display</p>
</div><!-- /container -->
<script>
function downloadPage() {
try {
const blob = new Blob([document.documentElement.outerHTML], {type: 'text/html'});
const url = URL.createObjectURL(blob);
let pageTitle = document.title || 'Generated_STDM_Spec';
const a = document.createElement('a');
a.href = url;
a.download = pageTitle.replace(/[^a-z0-9]/gi, '_').toLowerCase() + '.html'; // Sanitize filename
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
} catch (e) {
console.error("Error downloading page:", e);
alert("Could not generate download.");
}
}
function downloadExample() {
try {
// Find the H2 or H3 heading containing "Example Implementation"
const allHeadings = document.querySelectorAll('h2, h3');
let sectionHeading = null;
allHeadings.forEach(heading => {
// Use a regex for more flexible matching (case-insensitive, ignores leading/trailing spaces/numbers)
if (/^\s*(?:9\.\s*)?Example Implementation\s*$/i.test(heading.textContent.trim())) {
sectionHeading = heading;
}
});
if (!sectionHeading) throw new Error("Heading containing 'Example Implementation' not found");
let sibling = sectionHeading.nextElementSibling;
let exampleCodeElement = null;
while(sibling) {
// Find the code block with the 'language-html' class added by markdown's codehilite
if (sibling.tagName === 'DIV' && sibling.classList.contains('codehilite')) {
const codeEl = sibling.querySelector('pre code');
// Check if it looks like the start of the HTML example
if (codeEl && /^\s*<!DOCTYPE html>/.test(codeEl.textContent.trim())) {
exampleCodeElement = codeEl;
break;
}
} else if (sibling.tagName === 'PRE') { // Fallback for non-highlighted code
const codeEl = sibling.querySelector('code');
if (codeEl && /^\s*<!DOCTYPE html>/.test(codeEl.textContent.trim())) {
exampleCodeElement = codeEl;
break;
}
}
// Stop searching if we hit the next major section heading
if (sibling.tagName === 'H2' && !/^\s*9\.\s*/.test(sibling.textContent)) {
break;
}
sibling = sibling.nextElementSibling;
}
if (!exampleCodeElement) {
throw new Error("Example HTML code block not found after the 'Example Implementation' heading. Searched for <div class='codehilite'> or <pre> containing <!DOCTYPE html>.");
}
// Unescape HTML entities to get the original source code
const tempDiv = document.createElement('div');
tempDiv.innerHTML = exampleCodeElement.innerHTML; // Use innerHTML which contains the escaped entities
const originalHtmlCode = tempDiv.textContent || tempDiv.innerText || ""; // Browser decodes entities here
if (!originalHtmlCode) {
throw new Error("Could not extract original HTML from code block.");
}
const blob = new Blob([originalHtmlCode], {type: 'text/html'});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'STDM_Example_Implementation.html';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
} catch(e) {
console.error("Error finding or downloading example:", e);
alert(`Could not find or generate example download. Error: ${e.message}`);
}
}
</script>
</body>
</html>