Commit Graph

4 Commits

Author SHA1 Message Date
ruohki c8d4754340 feat(quick-3): wire remote link navigation with history, error screens, and LightMagenta styling
- Detect HTTP/HTTPS links in follow_selected_link and dispatch to navigate_to_remote()
- Add navigate_to_remote() method with whitelist check, fetch, render, history push, and error screens
- Handle DomainNotAllowed/FetchError/NotMarkdown with BBS-themed error screens (no history push)
- Update navigate_back/forward to re-fetch remote URLs from history (consistent with disk-reload pattern)
- Update handle_resize() to pass None vault_path for remote pages
- Skip live-reload for remote pages in reload_current_document()
- Clear current_url when navigating to local pages in navigate_to()
- Style HTTP/HTTPS links in LightMagenta to visually distinguish from local LightCyan links
2026-03-01 13:15:23 +01:00
ruohki a63f4115f9 feat(03-01): extend renderer with LinkRecord extraction and link styling
- Add LinkRecord struct (line_index, col_offset, span_len, dest, is_wiki)
- Add PendingLink and PendingLinkRecord helpers in RenderState
- Enable ENABLE_WIKILINKS option in pulldown-cmark parser
- Handle Tag::Link Start: compute col_offset, determine broken wiki-link style
- Handle TagEnd::Link: compute span_len, enqueue PendingLinkRecord
- Update flush_line() to finalize pending link records with line_index
- Update render_markdown() signature to return (Vec<Line>, Vec<LinkRecord>)
- Add vault_path: Option<&Path> parameter for render-time broken link detection
- Update app.rs handle_resize and main.rs call sites to destructure tuple
- Wiki-links render as [Text] in LightCyan; broken wiki-links in Red+CROSSED_OUT
2026-02-28 23:04:20 +01:00
ruohki 8690d2a857 feat(02-02): add code block borders with syntax highlighting and GFM table grid
- emit_code_block: ╭─ {lang} ─╮ / │ content │ / ╰──╯ rounded borders; lang label in Yellow; content via highlight_code()
- emit_table: ┌┬┐├┼┤└┴┘ full box-drawing grid; bold LightCyan header row; Left/Right/Center cell alignment
- Rename stub methods to emit_code_block_now / emit_table_now (clean naming; delegates to full emitters)
- Remove unused push_fg / push_fg_mod helper methods
- cargo check passes; 19 expected dead_code warnings (modules wired in Plan 03)
2026-02-28 22:18:31 +01:00
ruohki 9e6f79c233 feat(02-02): build core markdown renderer with inline and block elements
- Create src/renderer.rs with public render_markdown(input, width) -> Vec<Line<'static>>
- Implement RenderState with style stack, blockquote depth, list counters, table two-pass collection
- Handle all inline elements: headings H1-H6 (CGA colors + H1/H2 decorators), bold, italic, inline code
- Handle block elements: paragraphs, lists (ordered/unordered/nested with •/◦/▪), blockquotes with │ prefix, horizontal rules, images as [IMAGE: alt] placeholders
- Stub emit_code_block and emit_table delegate to full implementations (Task 2)
- Add mod highlighter, renderer, vault declarations to main.rs (wiring for Plan 03)
- cargo check passes clean (19 dead_code warnings expected — modules unwired until Plan 03)
2026-02-28 22:17:28 +01:00