docs: document server-side rendering pipeline, response timing middleware, and Telegram pairing API
- Add comprehensive documentation for backend content rendering in AGENTS.md, detailing the new `render_content` and `render_title` Jinja globals built on mistune with media processing, emoji shortcodes, and XSS protection
- Document the `X-Response-Time` header and bottom-left render time indicator in README.md
- Update bot token pricing documentation to clarify fallback vs gateway cost headers
- Add `email_accounts` to soft-delete tables and `idx_users_role` composite index in database schema
- Implement `telegram_pairings` and `telegram_links` table creation with column migration and indexes
- Add `/profile/{username}/telegram` endpoint to docs API with request/unpair actions
- Register `TelegramService` in main.py lifespan and add `response_timing` middleware emitting `X-Response-Time` header
- Introduce `TelegramPairForm` model and `guard_public_host_sync` synchronous host validation function
This commit is contained in:
@@ -40,7 +40,7 @@ Every component **renders into the light DOM (no shadow root)** so the global CS
|
||||
|---------|---------|
|
||||
| `dp-avatar` | Renders a user avatar. |
|
||||
| `dp-code` | Renders a syntax-highlighted code block. |
|
||||
| `dp-content` | Wraps the content renderer behind `data-render`. |
|
||||
| `dp-content` | Client-side content renderer for live content; server content uses the backend `render_content` Jinja global. |
|
||||
| `dp-upload` | The single file-upload button used everywhere. |
|
||||
| `dp-toast` | Transient notifications (`app.toast`). |
|
||||
| `dp-dialog` | Confirm / prompt / alert modals (`app.dialog`). |
|
||||
@@ -48,6 +48,8 @@ Every component **renders into the light DOM (no shadow root)** so the global CS
|
||||
|
||||
**The component-vs-module rule.** Self-contained presentational widgets become components. Partial-bound controllers that enhance server-rendered markup (votes, reactions, comments) and pure utilities stay plain modules, because they augment existing HTML rather than render standalone UI.
|
||||
|
||||
**Content and titles render on the backend.** For SEO, all content and titles that exist at request time are rendered server-side by the `render_content` and `render_title` Jinja globals (`devplacepy/rendering.py`, built on mistune with full feature parity to the client renderer: emoji shortcodes, markdown, sanitisation, and YouTube/video/audio/image embeds, mentions, and autolinks). The `dp-content`/`dp-title` client components and the `data-render` attribute are now reserved for genuinely live content that is generated in the browser after load (chat answers, newly posted comments, live direct messages, the planning report). Server-rendered code blocks are still syntax-highlighted client-side, and content images are wired to the lightbox via a delegated listener.
|
||||
|
||||
## Shared utilities
|
||||
|
||||
A few plain modules own the cross-cutting patterns. Reach for these instead of hand-rolling a fetch, an interval, or a click handler:
|
||||
|
||||
Reference in New Issue
Block a user