utopia-project 0.37.1 → 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6467795f4ec1c68ecc0606fbd6ca86367532a9f4ba85ecd7a45d9246037c289
4
- data.tar.gz: 143589e65aa521ef0ccab3886a02ccd86cd6e83519b91935ad3a1bf14086e1cf
3
+ metadata.gz: ff8f37c4088abefc8d202fff07c8cb1f4e93db97b2404c76f72c4be6119d26b2
4
+ data.tar.gz: 49a84a3901624ab103390ccb86682fa1b7d0173bb2a538e7af11e298e3e9a0a6
5
5
  SHA512:
6
- metadata.gz: 67297da20eb02586984c38b3586cf844600b67179b50d00a13f15e264399cd83fe79420d64348139eabf368fc0d56fd73fe730b7f42c19c4247032e3423cf261
7
- data.tar.gz: c384960157c37c7a3934a40c2b557fbdf9b054a889104be3599beba0d8d9ec9143c0523c72ebd14f1d853c9394f82b318078f57c9394de4ae039eb148169e782
6
+ metadata.gz: ba907fede639f4d98bf395737a66cbedc0a2c494a2795d69d6750b96a86cc0472cc030981f2e7c074a7255612396ffddeda83baf0f26ee187d256adfe2d9a9ef
7
+ data.tar.gz: 746bb13682244238a91f27cdad40674713d63ee598528e6c1359d629029d4c6db8176fbe2263a5375e91d3bd320c5c84c62aa61a3851cd8f1f6fcd95a47022a5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -3,6 +3,12 @@
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
+ def initialize(context)
7
+ super
8
+
9
+ require "fileutils"
10
+ end
11
+
6
12
  # Create an empty project in the current directory.
7
13
  def create
8
14
  template_path = File.expand_path("../../template/*", __dir__)
@@ -63,6 +63,92 @@ documentation-guides:
63
63
 
64
64
  Every guide should start with a brief overview, explaining its purpose and what the user can expect to learn: "This guide explains how to use x to do y." – it should be short and to the point, as it's used as the description of the guide on other pages that link to it.
65
65
 
66
+ ## Guide Writing Principles
67
+
68
+ ### Context Before Implementation
69
+
70
+ Every feature or concept should be introduced with clear context about why users need it before explaining how to use it. This helps users understand when and why to apply the feature in their own projects.
71
+
72
+ **Structure each section as:**
73
+ 1. **Problem statement**: What challenge does this solve?
74
+ 2. **Use cases**: When would users encounter this need?
75
+ 3. **Solution overview**: How does this feature address the problem?
76
+ 4. **Implementation**: Code examples and detailed usage
77
+
78
+ **Example:**
79
+
80
+ ❌ **Poor context**:
81
+ ~~~markdown
82
+ ## Transactions
83
+
84
+ Use MULTI and EXEC to run commands atomically:
85
+
86
+ ```ruby
87
+ client.multi
88
+ client.set("key", "value")
89
+ client.exec
90
+ ```
91
+ ~~~
92
+
93
+ ✅ **Good context**:
94
+ ~~~markdown
95
+ ## Transactions
96
+
97
+ When multiple clients modify the same data simultaneously, you need to prevent race conditions and ensure data consistency. Redis transactions solve this by executing multiple commands atomically - either all succeed or none do.
98
+
99
+ Use transactions when you need:
100
+ - **Data consistency**: Keep related fields synchronized
101
+ - **Atomic updates**: Prevent partial updates that could corrupt data
102
+ - **Race condition prevention**: Ensure operations complete without interference
103
+
104
+ ```ruby
105
+ client.multi
106
+ client.set("user:balance", new_balance)
107
+ client.set("user:last_transaction", transaction_id)
108
+ client.exec
109
+ ```
110
+ ~~~
111
+
112
+ ### Advanced Feature Documentation
113
+
114
+ When documenting advanced features, follow this structure:
115
+
116
+ 1. **Motivation Section**: Start with 2-3 bullet points explaining:
117
+ - What problem this solves
118
+ - When users would need this
119
+ - What happens without this feature
120
+
121
+ 2. **Use Case Examples**: Provide concrete scenarios:
122
+ - Business logic examples (user accounts, inventory, etc.)
123
+ - Technical scenarios (performance, reliability, etc.)
124
+ - Anti-patterns to avoid
125
+
126
+ 3. **Implementation**: Show practical code examples
127
+ 4. **Best Practices**: When to use vs when not to use
128
+ 5. **Common Pitfalls**: What to watch out for
129
+
130
+ **Template:**
131
+ ```markdown
132
+ ## [Feature Name]
133
+
134
+ [Brief explanation of what problem this solves and why it matters]
135
+
136
+ Use [feature] when you need:
137
+ - **[Primary use case]**: [Brief explanation]
138
+ - **[Secondary use case]**: [Brief explanation]
139
+ - **[Third use case]**: [Brief explanation]
140
+
141
+ [Implementation examples with practical scenarios]
142
+
143
+ ### Best Practices
144
+
145
+ [When to use this feature vs alternatives]
146
+
147
+ ### Common Pitfalls
148
+
149
+ [What to avoid and why]
150
+ ```
151
+
66
152
  #### "Getting Started" Guide
67
153
 
68
154
  Every project should have a "Getting Started" guide that provides an introduction to the project, including the following sections:
@@ -103,3 +189,107 @@ In the above example:
103
189
 
104
190
  - "Core Concepts" is optional and should be included if it helps to clarify the usage and structure of the project.
105
191
  - "Specific Scenario" only makes sense if there are more than one scenario that is typical.
192
+
193
+ ## Guide Organization
194
+
195
+ ### Learning Path Structure
196
+
197
+ Organize guides to follow a natural learning progression:
198
+
199
+ 1. **Core Guides**: Essential concepts all users need
200
+ - Getting Started (installation, basic usage, core concepts)
201
+ - [Primary feature guides in order of typical adoption]
202
+
203
+ 2. **Operational Guides**: Specific use cases and patterns
204
+ - [Advanced features organized by user journey]
205
+
206
+ 3. **Architecture Guides**: System design and scaling decisions
207
+ - [When to use different approaches/clients/patterns]
208
+
209
+ ### Content Depth Guidelines
210
+
211
+ - **Getting Started**: Cover 80% of what new users need to be productive
212
+ - **Feature Guides**: Deep dive into specific capabilities with real-world context
213
+ - **Architecture Guides**: Help users make informed decisions between alternatives
214
+
215
+ Each guide should be self-contained but may reference other guides for deeper context.
216
+
217
+ ### User Journey Considerations
218
+
219
+ Consider when in a user's journey they'll encounter each feature:
220
+
221
+ - **Immediate need**: Basic operations, connection management.
222
+ - **Growth stage**: Performance optimization, bulk operations.
223
+ - **Scale stage**: Clustering, high availability, advanced patterns.
224
+
225
+ Help users understand when to choose between alternatives:
226
+ - Compare approaches side-by-side.
227
+ - Explain trade-offs clearly.
228
+ - Provide decision criteria.
229
+ - Include performance implications.
230
+
231
+ ## Code Examples in Guides
232
+
233
+ ### Contextual Examples
234
+
235
+ Every code example should demonstrate a realistic scenario, not abstract operations:
236
+
237
+ ❌ **Abstract**:
238
+ ```ruby
239
+ client.set("key", "value")
240
+ client.get("key")
241
+ ```
242
+
243
+ ✅ **Contextual**:
244
+ ```ruby
245
+ # Store user session data:
246
+ client.set("session:#{session_id}", user_data.to_json)
247
+ client.expire("session:#{session_id}", 3600)
248
+
249
+ # Retrieve session for authentication:
250
+ session_data = client.get("session:#{session_id}")
251
+ ```
252
+
253
+ ### Comment Style
254
+
255
+ - **Colon (`:`)**: When comment refers to the next line(s).
256
+ - **Period (`.`)**: When comment describes what just happened.
257
+ - **No trailing comments**: Avoid end-of-line comments.
258
+
259
+ ### Error Handling
260
+
261
+ Include proper error handling and resource management in examples:
262
+ - Always use `ensure` blocks for cleanup.
263
+ - Show common error scenarios.
264
+ - Demonstrate graceful degradation patterns.
265
+
266
+ ### Progressive Disclosure
267
+
268
+ Start with simple examples, then show advanced usage:
269
+ 1. Basic usage that works immediately.
270
+ 2. Common configuration options.
271
+ 3. Advanced patterns and edge cases.
272
+ 4. Production considerations.
273
+
274
+ ## Enhanced Guide Quality Standards
275
+
276
+ Following `utopia-project` guidelines, each guide should:
277
+
278
+ 1. **Start with clear purpose**: "This guide explains how to use X to solve Y problem"
279
+ 2. **Provide user context**: Explain why users would need this feature
280
+ 3. **Include practical examples**: Working code samples that demonstrate real scenarios
281
+ 4. **Follow consistent structure**: Problem → Use Cases → Implementation → Best Practices
282
+ 5. **Cross-reference appropriately**: Use `{ruby ClassName}` for internal references
283
+ 6. **Include error handling**: Show how to handle common failure scenarios
284
+ 7. **Provide troubleshooting**: Common issues and solutions
285
+ 8. **Maintain currency**: Keep examples updated with latest best practices
286
+
287
+ ### Section Checklist
288
+
289
+ Before publishing a guide section, verify:
290
+ - [ ] Explains WHY users need this feature.
291
+ - [ ] Provides concrete use cases.
292
+ - [ ] Shows realistic code examples.
293
+ - [ ] Includes proper error handling.
294
+ - [ ] Mentions when NOT to use the feature.
295
+ - [ ] References related concepts appropriately.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2025, by Samuel Williams.
4
+ # Copyright, 2025, by Samuel Williams.
5
5
 
6
6
  require_relative "renderer"
7
7
 
@@ -88,7 +88,7 @@ module Utopia
88
88
  end
89
89
 
90
90
  private
91
-
91
+
92
92
  def self.extract_headings_from_document(document)
93
93
  headings = []
94
94
  return headings unless document&.root
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Utopia
7
7
  module Project
8
- VERSION = "0.37.1"
8
+ VERSION = "0.37.2"
9
9
  end
10
10
  end
@@ -237,6 +237,7 @@ h1, h2, h3, h4, h5, h6, p, pre, ul, dl, ol {
237
237
  div.mermaid {
238
238
  margin: 1rem;
239
239
  text-align: center;
240
+ color: initial; /* Don't inherit page text color */
240
241
  }
241
242
 
242
243
  div.giscus {
data/readme.md CHANGED
@@ -31,6 +31,10 @@ Please see the [project documentation](https://socketry.github.io/utopia-project
31
31
 
32
32
  Please see the [project releases](https://socketry.github.io/utopia-project/releases/index) for all releases.
33
33
 
34
+ ### v0.37.2
35
+
36
+ - Fix mermaid diagram text color in dark mode.
37
+
34
38
  ### v0.36.0
35
39
 
36
40
  - Introduce `bake utopia:project:update` which invokes readme and agent context updates.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## v0.37.2
4
+
5
+ - Fix mermaid diagram text color in dark mode.
6
+
3
7
  ## v0.36.0
4
8
 
5
9
  - Introduce `bake utopia:project:update` which invokes readme and agent context updates.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.1
4
+ version: 0.37.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -285,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
285
  - !ruby/object:Gem::Version
286
286
  version: '0'
287
287
  requirements: []
288
- rubygems_version: 3.6.9
288
+ rubygems_version: 3.7.2
289
289
  specification_version: 4
290
290
  summary: A project documentation tool based on Utopia.
291
291
  test_files: []
metadata.gz.sig CHANGED
Binary file