Add bilingual public docs, keyword aliases, and frontmatter stdin for view.

English/Chinese user pages sit side by side; L0 builtins and lib/ text|表 dual APIs land with gold coverage. Capture/view input demos use stdin:/输入: so static export and first page load succeed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-05 09:14:26 +08:00
1 parent fd36b92224
commit a5d30c00b3
68 files changed
+1812 -241

No files matched your search

+12 -2
View File
@@ -624,14 +624,24 @@ pub fn page_file(files: &[PathBuf], rel: &str, vm: &FileViewModel, links: &LinkM
LinkMode::Live => format!(
r#"<form class="stdin-form" method="get" action="/file">
<input type="hidden" name="path" value="{path}"/>
<label for="stdin">Preset input <span class="hint">one line per input call</span></label>
<label for="stdin">Preset input <span class="hint">one line per <code>input</code>; overrides frontmatter <code>stdin:</code> / <code>输入:</code></span></label>
<textarea id="stdin" name="stdin" rows="3" placeholder="Alice">{stdin}</textarea>
<button type="submit">Run with input</button>
</form>"#,
path = escape(rel),
stdin = escape(&vm.preset_stdin),
),
LinkMode::Static { .. } => String::new(),
LinkMode::Static { .. } => {
if vm.preset_stdin.is_empty() {
String::new()
} else {
format!(
r#"<p class="hint">Demo stdin from frontmatter (static export cannot re-run interactively):</p>
<pre class="source" style="margin-bottom:0.75rem">{stdin}</pre>"#,
stdin = escape(&vm.preset_stdin),
)
}
}
};
let title = Path::new(rel)
.file_name()