Engineering Playbook

playbook
Author

Rick Montgomery

Published

March 7, 2025

Engineering Playbook

This playbook demonstrates various features available in Quarto Markdown (QMD) that are particularly useful for engineering documentation and technical blog posts.

Code Formatting

Python Code Example

import numpy as np
import matplotlib.pyplot as plt

# Generate sample data
x = np.linspace(0, 10, 100)
y = np.sin(x)

# Create plot
plt.figure(figsize=(8, 4))
plt.plot(x, y)
plt.title('Sine Wave Example')
plt.xlabel('x')
plt.ylabel('sin(x)')
plt.grid(True)
plt.show()

SQL Example with Code Highlighting

SELECT 
    user_id,
    COUNT(*) as transaction_count,
    SUM(amount) as total_amount
FROM transactions
WHERE created_at >= DATEADD(day, -30, CURRENT_DATE)
GROUP BY user_id
HAVING COUNT(*) > 5
ORDER BY total_amount DESC;

Mathematical Equations

Quarto supports both inline math using $…$ and display math using $$…$$

Inline example: The area of a circle is \(A = \pi r^2\)

Display example for a more complex equation:

\[ \begin{aligned} \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\ \nabla \times \mathbf{B} &= \mu_0\left(\mathbf{J} + \epsilon_0\frac{\partial \mathbf{E}}{\partial t}\right) \end{aligned} \tag{1}\]

Diagrams with Mermaid

graph TD
    A[User Request] -->|API Gateway| B(Load Balancer)
    B --> C{Health Check}
    C -->|Healthy| D[Service A]
    C -->|Healthy| E[Service B]
    D --> F[Database]
    E --> F
    C -->|Unhealthy| G[Fallback Service]

Interactive Elements

Tabsets

{
  "user": {
    "id": "string",
    "name": "string",
    "email": "string",
    "created_at": "datetime"
  }
}
@app.get("/users/{user_id}")
async def get_user(user_id: str):
    return await db.users.find_one({"id": user_id})
{
  "id": "123",
  "name": "John Doe",
  "email": "john@example.com",
  "created_at": "2024-03-07T10:00:00Z"
}

Callouts

NoteNote

This is a note callout - useful for additional information.

WarningWarning

This is a warning callout - perfect for highlighting potential issues.

TipBest Practice

This is a tip callout - great for sharing best practices and recommendations.

Tables

Feature Description Use Case
Code Execution Run code blocks inline Demonstrate live examples
Math Equations LaTeX support Document algorithms
Diagrams Mermaid integration System architecture
Callouts Highlighted boxes Important notes
Tabsets Grouped content API documentation

Cross-References

You can reference sections, figures, and equations throughout your document. For example, see Equation 1 above.

This playbook demonstrates just a subset of what’s possible with Quarto. You can also:

  • Create interactive dashboards
  • Generate PDF reports
  • Include citations and bibliographies
  • Create presentation slides
  • Embed interactive widgets
  • Use custom HTML/CSS/JavaScript
  • Generate automated reports

For more details, visit the Quarto documentation.