Update tech_docs/CUE_your_new_friend.md
This commit is contained in:
@@ -224,35 +224,6 @@ You can eliminate configuration errors and enforce policies **declaratively**.
|
||||
|
||||
Here’s a **Mermaid.js diagram** that visually explains the CUE lattice (Top, Bottom, Unification, and Disjunction) in a way that’s 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
|
||||
```
|
||||
Reference in New Issue
Block a user