Block renderer + Jinja2 sunset #8
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-docs-app#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-pal-e-docs→ Phase 4 (Block Renderer + Jinja2 Sunset)Repo
forgejo_admin/pal-e-app(primary),forgejo_admin/pal-e-docs(Jinja2 removal — separate PR)User Story
As a platform user
I want to browse all notes, projects, tags, and repos through the SvelteKit frontend
So that the Jinja2 frontend can be removed and all rendering uses the structured block system
Context
pal-e-docs has two content representations:
html_content— monolithic HTML blob on thenotestableblockstable — 5,197 typed JSON fragments (heading, paragraph, table, list, code, mermaid)Blocks are already the source of truth — both write paths (
update_noteandupdate_block) converge throughrecompile()which keepshtml_contentas a cache. But the Jinja2 frontend ignores blocks and readshtml_content, running a request-time pipeline (sanitize_html → autolink_slugs → wrap_tables).The Jinja2 frontend is ~320 lines of Python routing + ~460 lines of HTML/CSS templates. The block API already exists. SvelteKit already has layout, dark theme, nav, API client, and a working board kanban as proof of the pattern.
No reason to maintain two frontends in parallel. Build the block renderer and remove Jinja2 in one pass.
File Targets
Files to create in pal-e-app:
src/lib/components/blocks/HeadingBlock.svelte— renders heading JSONsrc/lib/components/blocks/ParagraphBlock.svelte— renders paragraph HTML with autolinked slugssrc/lib/components/blocks/TableBlock.svelte— renders structured table with scroll wrappersrc/lib/components/blocks/ListBlock.svelte— renders nested list itemssrc/lib/components/blocks/CodeBlock.svelte— renders code with optional syntax highlightingsrc/lib/components/blocks/MermaidBlock.svelte— renders mermaid diagramssrc/lib/components/blocks/BlockRenderer.svelte— dispatches block_type to componentsrc/lib/components/NoteLayout.svelte— metadata (breadcrumb, tags, project, updated date, child notes, linked notes)src/routes/notes/[slug]/+page.server.ts— fetches note + blocks from APIsrc/routes/notes/[slug]/+page.svelte— renders blocks via BlockRenderersrc/routes/projects/[slug]/+page.server.ts++page.svelte— project note listsrc/routes/tags/+page.server.ts++page.svelte— tag listsrc/routes/tags/[name]/+page.server.ts++page.svelte— notes by tagsrc/routes/repos/+page.server.ts++page.svelte— repo listsrc/lib/api.ts— addgetNote(),getNoteBlocks(),listProjects(),listTags(),listRepos(),listNotes()etc.Files to update:
src/routes/+page.svelte— replace stub landing with project/tag overviewsrc/routes/+layout.svelte— add nav links (Projects, Tags, Repos)Files the agent should NOT touch:
src/routes/boards/**— existing kanban, already workingsrc/routes/api/**— existing board proxy, already workingAcceptance Criteria
/notes/{slug}renders any note from blocks (all 6 block types)<code>slug-ref</code>patterns to/notes/{slug}<pre><code>with language class/projects/{slug}lists notes in that project/tagslists all tags,/tags/{name}lists notes with that tag/reposlists all reposTest Expectations
npm run check && npm run buildConstraints
GET /notes/{slug}/blocks), NOT fromhtml_contentsrc/lib/api.ts(server-side only,apiFetchhelper)$state,$derived,$props)#0a0a14bg,#0e0e18nav,#e94560accent)<code>elements inside paragraph/list HTML whose text matches a known note slug, wrap in<a href="/notes/{slug}">GET /slugs(or similar) lightweight endpoint to the pal-e-docs API that returns all known slugs, OR accept a list in the notes responseChecklist
npm run check && npm run build)Related
pal-e-docs— projectphase-pal-e-docs-note-renderer— phase notephase-pal-e-docs-jinja-sunset— absorbed phase