feat(build): make generated page helper canonical
Move canonical examples and docs snippets from raw render/page calls to generated ui::page helpers, hide generated render behind doc(hidden), and let form resources participate in generated target inspection for tests. req: canonical_authoring/005 req: dx/006 req: codegen/002 req: public_api/002 req: test/001
This commit is contained in:
+10
-10
@@ -268,18 +268,18 @@ fn registry(state: Arc<ExampleState>) -> Registry {
|
||||
fn all_examples() -> Html {
|
||||
// req: html_safety/001 req: html_safety/002 req: component/003
|
||||
Html::join([
|
||||
counter::render(&Counter),
|
||||
hemx::page(&todos_view(&[])),
|
||||
wizard::render(&Wizard),
|
||||
auth::render(&Auth),
|
||||
counter::page(&Counter),
|
||||
ui::page(&todos_view(&[])),
|
||||
wizard::page(&Wizard),
|
||||
auth::page(&Auth),
|
||||
render_page_swap("Welcome", "Welcome"),
|
||||
notifications::render(&Notifications),
|
||||
notifications::page(&Notifications),
|
||||
])
|
||||
}
|
||||
|
||||
fn shell(body: Html) -> Html {
|
||||
// req: html_safety/001 req: html_safety/002 req: axum_integration/001 req: component/003
|
||||
hemx::page(&AppShell {
|
||||
ui::page(&AppShell {
|
||||
runtime_src: runtime_js_path(),
|
||||
body,
|
||||
})
|
||||
@@ -447,7 +447,7 @@ fn todo_summary(todos: &[TodoRecord]) -> String {
|
||||
|
||||
fn render_page_swap(title: &'static str, message: &'static str) -> Html {
|
||||
// req: html_safety/002 req: view/001 req: component/003
|
||||
page_swap::render(&PageSwap {
|
||||
page_swap::page(&PageSwap {
|
||||
content: render_docs_content(message),
|
||||
title,
|
||||
})
|
||||
@@ -455,7 +455,7 @@ fn render_page_swap(title: &'static str, message: &'static str) -> Html {
|
||||
|
||||
fn render_docs_content(message: &'static str) -> Html {
|
||||
// req: html_safety/002 req: view/001 req: component/003
|
||||
hemx::page(&DocsContent { message })
|
||||
ui::page(&DocsContent { message })
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -570,7 +570,7 @@ mod tests {
|
||||
title: "<b>Ship v0</b>".to_owned(),
|
||||
}];
|
||||
|
||||
let html = hemx::page(&todos_view(&todos));
|
||||
let html = ui::page(&todos_view(&todos));
|
||||
let document = Html::parse_fragment(html.as_str());
|
||||
let rows = document
|
||||
.select(&selector(&keyed_items_selector("li")))
|
||||
@@ -590,7 +590,7 @@ mod tests {
|
||||
// req: html_safety/002 req: view/001 req: test/005
|
||||
#[test]
|
||||
fn empty_todos_payload_is_rendered_by_a_hemplate_view() {
|
||||
let html = hemx::page(&todos_view(&[]));
|
||||
let html = ui::page(&todos_view(&[]));
|
||||
let document = Html::parse_fragment(html.as_str());
|
||||
let rows = document
|
||||
.select(&selector(&list_item_selector("")))
|
||||
|
||||
Reference in New Issue
Block a user