cutedogs 🐕
Programmatic Rust documentation - Write docs like code, not comments.
cutedogs transforms function documentation from scattered comment blocks into structured, attribute-driven declarations. Instead of writing traditional doc comments, you define documentation as structured data using Rust attributes - making it type-safe, IDE-friendly, and programmatically verifiable.
Why cutedogs?
Traditional rustdoc (comment-based)
/// Calculates the area of a rectangle
///
/// # Parameters
/// * `width` - The width of the rectangle
/// * `height` - The height of the rectangle
///
/// # Returns
/// The area as a f64
///
/// # Example
/// ```rust
/// let area = calculate_area(5.0, 3.0);
/// assert_eq!(area, 15.0);
/// ```
cutedogs (attribute-driven)
use document;
Key Benefits
✅ Structured & Type-Safe - Documentation fields are parsed at compile time
✅ IDE Support - Auto-completion, syntax highlighting, and refactoring tools work
✅ Programmatic - Generate docs from data, validate completeness, enforce standards
✅ Consistent - Uniform formatting and structure across your entire codebase
✅ Maintainable - Documentation is data, not prose scattered in comments
Installation
Add to your Cargo.toml:
[]
= "0.0.5"
Quick Start
use document;
This generates clean, formatted rustdoc output while keeping your documentation structured and maintainable.
Documentation Fields
Core Documentation
Examples & Testing
Unimplemented Functions
Mark functions as not yet implemented with clear messaging:
Advanced Documentation
Deprecation Management
Complete Field Reference
| Field | Type | Description | Example |
|---|---|---|---|
summary |
String | Brief function description | "Calculates rectangle area" |
params |
Object | Parameter descriptions | {"width": "Width in pixels", "height": "Height in pixels"} |
returns |
String | Return value description | "Area as f64 value" |
example |
String | Code example with newlines | "let x = func(1, 2);\nassert_eq!(x, 3);" |
panics |
String | Panic conditions | "Panics if divisor is zero" |
safety |
String | Safety information | "Safe for all valid inputs" |
since |
String | Version introduced | "1.0.0" |
see_also |
String | Related functions (comma-separated) | "related_func, helper_func" |
note |
String | Important notes | "Performance critical section" |
deprecated |
String | Deprecation message | "Use new_func() instead" |
deprecated_since |
String | Version deprecated in | "2.0.0" |
unimplemented |
Flag/String | Mark as unimplemented | unimplemented or "Feature pending" |
Generated Output
cutedogs generates clean, properly formatted rustdoc comments that integrate seamlessly with cargo doc. The structured approach ensures consistent formatting, proper markdown sections, and complete documentation coverage.
Your IDE treats the attribute syntax as first-class Rust code, providing:
- Syntax highlighting
- Auto-completion
- Refactoring support
- Compile-time validation
License
MIT OR Apache-2.0