Update tech_docs/CUE_your_new_friend.md

This commit is contained in:
2025-08-06 09:07:50 -05:00
parent 89f03bd262
commit 8dd4983c5d

View File

@@ -224,35 +224,6 @@ You can eliminate configuration errors and enforce policies **declaratively**.
Heres a **Mermaid.js diagram** that visually explains the CUE lattice (Top, Bottom, Unification, and Disjunction) in a way thats both accurate and appealing for visual learners. You can embed this directly in your Gitea Markdown files (if Mermaid rendering is enabled):
```mermaid
%% CUE Lattice Diagram
graph TD
A[" (Top)"] --> B["Concrete Values"]
A --> C["Constraints"]
B --> D["Unification (&)"]
C --> D
D --> E["Valid Output"]
D --> F["⊥ (Bottom, Invalid)"]
B --> G["Disjunction (|)"]
C --> G
G --> H["Valid Alternative"]
style A fill:#4CAF50,stroke:#388E3C
style F fill:#F44336,stroke:#D32F2F
style E fill:#2196F3,stroke:#1976D2
style H fill:#FF9800,stroke:#F57C00
%% Examples
I["Example:\nname: string & =~'^[A-Z]'"] --> D
J["Example:\nrole: 'admin' | 'user'"] --> G
```
---
### **How to Use in Gitea**:
1. Ensure Mermaid is enabled in your Gitea instance (check with admins).
2. Paste the above code into a Markdown file (e.g., `README.md`).
3. It will render as an interactive diagram.
---
@@ -290,4 +261,25 @@ graph LR
T -->|Disjunction (|)| D["A | B | C"]
```
Let me know if you'd like to tweak the design (e.g., add more examples, change layouts)!
```mermaid
%% CUE Lattice Diagram
graph TD
A[" (Top)"] --> B["Concrete Values"]
A --> C["Constraints"]
B --> D["Unification (&)"]
C --> D
D --> E["Valid Output"]
D --> F["⊥ (Bottom, Invalid)"]
B --> G["Disjunction (|)"]
C --> G
G --> H["Valid Alternative"]
style A fill:#4CAF50,stroke:#388E3C
style F fill:#F44336,stroke:#D32F2F
style E fill:#2196F3,stroke:#1976D2
style H fill:#FF9800,stroke:#F57C00
%% Examples
I["Example:\nname: string & =~'^[A-Z]'"] --> D
J["Example:\nrole: 'admin' | 'user'"] --> G
```