···1-//! Atproto renderer
2-//!
3-//! This mode of the renderer renders either an entire notebook or entries in it to files suitable for inclusion
4-//! in a single-page app and uploads them to your Atproto PDS
5-//! It can be accessed via the appview at {your-handle}.weaver.sh/{notebook-name}.
6-//!
7-//! It can also be edited there.
8-//!
9-//! Link altering logic:
10-//! - Option 1: leave (non-embed) links the same as in the markdown, have the CSM deal with them via some means
11-//! such as adding "data-did" and "data-cid" attributes to the `<a/>` tag containing the DID and CID
12-//! Pushes toward having the SPA/Appview do a bit more, but makes this step MUCH simpler
13-//! - In this scenario, the rendering step can happen upon access (and then be cached) in the appview
14-//! - More flexible in some ways, less in others
15-//! - Option 2: alter links to point to other rendered blobs. Requires a certain amount of work to handle
16-//! scenarios with a complex mesh of internal links, as the CID is altered by the editing of the link.
17-//! Such cycles are handled in the simplest way, by rendering an absolute url which will make a call to the appview.
18//!
000000000000000000
···1+//! AT Protocol renderer for weaver notebooks
00000000000000002//!
3+//! Two-stage pipeline: markdown→markdown preprocessing (CLI),
4+//! then client-side markdown→HTML rendering (WASM).
5+6+mod error;
7+mod types;
8+mod markdown_writer;
9+mod preprocess;
10+mod client;
11+mod embed_renderer;
12+mod writer;
13+14+pub use error::{AtProtoPreprocessError, ClientRenderError};
15+pub use types::{BlobName, BlobInfo};
16+pub use preprocess::AtProtoPreprocessContext;
17+pub use client::{ClientContext, EmbedResolver, DefaultEmbedResolver};
18+pub use markdown_writer::MarkdownWriter;
19+pub use embed_renderer::{fetch_and_render_profile, fetch_and_render_post, fetch_and_render_generic};
20+pub use writer::{ClientWriter, EmbedContentProvider};
···1+// Integration tests for AT Protocol rendering pipeline
2+//
3+// These tests verify the full markdown→markdown transformation pipeline:
4+// 1. Parse input markdown
5+// 2. Process through AtProtoPreprocessContext
6+// 3. Upload images to PDS
7+// 4. Canonicalize wikilinks and profile links
8+// 5. Write transformed markdown
9+10+// NOTE: Full implementation pending processor streaming support
11+// For now, these are placeholders that will be completed when:
12+// - NotebookProcessor can stream events through contexts
13+// - MarkdownWriter can consume event streams
14+15+#[cfg(test)]
16+mod tests {
17+ #[test]
18+ #[ignore]
19+ fn test_markdown_to_markdown_pipeline() {
20+ // TODO: Implement once processor streaming is available
21+ // This test should:
22+ // 1. Create mock vault with test markdown files
23+ // 2. Set up AtProtoPreprocessContext with test agent
24+ // 3. Process markdown through the pipeline
25+ // 4. Verify output contains canonical links
26+ // 5. Verify blob tracking captured image metadata
27+ }
28+29+ #[test]
30+ #[ignore]
31+ fn test_wikilink_canonicalization() {
32+ // TODO: Test that [[Entry Name]] becomes /{handle}/{notebook}/Entry_Name
33+ }
34+35+ #[test]
36+ #[ignore]
37+ fn test_image_upload_and_rewrite() {
38+ // TODO: Test that  uploads blob and rewrites to /{notebook}/image/{name}
39+ }
40+41+ #[test]
42+ #[ignore]
43+ fn test_profile_link_resolution() {
44+ // TODO: Test that [[@handle]] resolves to /{handle}
45+ }
46+}