You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,24 @@ print(captured)
72
72
# }
73
73
```
74
74
75
+
## Architecture
76
+
77
+
This project uses a multi-crate Rust workspace structure to maintain clean separation of concerns:
78
+
79
+
### Crate Structure
80
+
81
+
-**`djc-html-transformer`**: Pure Rust library for HTML transformation
82
+
-**`djc-template-parser`**: Pure Rust library for Django template parsing
83
+
-**`djc-core`**: Python bindings that combine all other libraries
84
+
85
+
### Design Philosophy
86
+
87
+
To make sense of the code and keep it clean, the Python API and Rust logic are defined separately:
88
+
89
+
1. Each crate (AKA Rust package) has `lib.rs` (which is like Python's `__init__.py`). These files do not define the main logic, but only the public API of the crate. So the API that's to be used by other crates.
90
+
2. The `djc-core` crate imports other crates
91
+
3. And it is only this `djc-core` where we define the Python API using PyO3.
0 commit comments