Skip to main content

Callouts & Alerts Demo

Callouts draw attention to important information, warnings, tips, and other key details in your documentation.

📢 All Callout Types

Note - General Information

This is a Note callout. Use it for general information that supplements the main content. Notes provide additional context without being critical to understanding.

Info - Additional Context

This is an Info callout. It provides supplementary information that enhances understanding. Perfect for “did you know” content or additional details.

Tip - Best Practices

This is a Tip callout. Share best practices, recommendations, and helpful suggestions. Tips help users work more efficiently.

Warning - Important Cautions

This is a Warning callout. Alert users to potential issues, deprecated features, or important considerations. Warnings prevent problems before they occur.

Check - Success Confirmation

This is a Check callout. Confirm successful operations, completed steps, or validate that requirements are met. Great for verification checkpoints.

🔐 Security Callouts

Security Warning: Never commit sensitive information like API keys, passwords, or connection strings to source control.
Security Best Practice: Always use environment variables or secure configuration providers for sensitive data:
var apiKey = Environment.GetEnvironmentVariable("API_KEY");
Security Validation: All input is properly sanitized and validated before processing.

⚡ Performance Callouts

Performance Info: This operation uses lazy loading, meaning data is only fetched when accessed for the first time.
Performance Tip: For better performance with large collections, use IAsyncEnumerable instead of loading all items into memory:
await foreach (var item in GetItemsAsync())
{
    await ProcessItemAsync(item);
}
Performance Warning: This method performs database queries in a loop. Consider using batch operations or includes to reduce database round trips.

🔄 Version Compatibility

Compatibility Note: This API is available in .NET 6.0 and later versions.
Breaking Change: This method signature has changed in version 2.0. The old overload is marked as obsolete and will be removed in version 3.0.
Migration Path: To migrate from v1.x to v2.x:
  1. Update package references
  2. Replace deprecated methods
  3. Run migration tool
  4. Test thoroughly

🐛 Common Issues

Common Pitfall: Forgetting to dispose of IDisposable objects can lead to memory leaks. Always use using statements:
using var stream = new FileStream(path, FileMode.Open);
// Stream is automatically disposed
Debugging Tip: Enable detailed logging to troubleshoot issues:
builder.Logging.SetMinimumLevel(LogLevel.Debug);
Known Issue: On Linux systems, file paths are case-sensitive. Ensure your code handles path comparisons appropriately.

✅ Setup Verification

✓ Package installed successfully
✓ Configuration file created
✓ Database connection established
✓ All tests passing
✓ Ready for development!

🎨 Combining Callouts

You can combine different callout types to create comprehensive documentation:
The following example demonstrates async file processing.
public async Task ProcessFileAsync(string path)
{
    using var stream = File.OpenRead(path);
    await ProcessStreamAsync(stream);
}
This method does not check if the file exists before attempting to open it.
Add file existence validation for production use:
if (!File.Exists(path))
    throw new FileNotFoundException($"File not found: {path}");
Best Practice: Callouts should be used sparingly to maintain their effectiveness. Too many callouts can overwhelm readers.