Seed a hinted and an unhinted code block

The dev server now shows both highlighting paths: a Rust block marked by
its source, and a Python block left to detection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 02:27:23 +00:00
co-authored by Claude Opus 5.5
parent 248038ec97
commit 13c81440ef
+19 -3
View File
@@ -131,9 +131,25 @@ fn body_html(title: &str, words: i64) -> String {
html.push_str("<blockquote><p>A pull quote that the author would rather you remembered than the rest.</p></blockquote>"); html.push_str("<blockquote><p>A pull quote that the author would rather you remembered than the rest.</p></blockquote>");
} }
if index == 7 { if index == 7 {
html.push_str( // One block the source marked as Rust, one it left for detection.
"<pre><code>fn main() {\n println!(\"hello, reader\");\n}</code></pre>", html.push_str(concat!(
); "<pre data-lang=\"rust\"><code>/// Greets whoever is reading.\n",
"fn main() {\n",
" let reader: &amp;str = \"reader\";\n",
" for n in 0..3 {\n",
" println!(\"hello, {reader} #{n}\"); // three times\n",
" }\n",
"}</code></pre>",
"<pre><code>import json\n\n",
"def load(path: str) -&gt; dict:\n",
" \"\"\"Read a JSON config, or an empty one.\"\"\"\n",
" try:\n",
" with open(path) as f:\n",
" return json.load(f)\n",
" except FileNotFoundError:\n",
" return {} # first run\n",
"</code></pre>",
));
} }
html.push_str("<p>Paragraph "); html.push_str("<p>Paragraph ");
html.push_str(&(index + 1).to_string()); html.push_str(&(index + 1).to_string());