A collection of techniques, patterns, and examples for creating rich, interactive content in Databricks notebooks using Diagrams as Code principles.
This repository showcases various "magic" techniques for enhancing Databricks notebooks with:
- Styled code blocks with syntax highlighting
- Informative admonitions and callout boxes
- Vendor icons from popular platforms
- Mermaid diagrams for flowcharts, sequences, and more
- PlantUML diagrams for UML and architecture
- C4 architecture diagrams
| Notebook | Description |
|---|---|
| 01 - Intro.ipynb | Overview of the repository and Diagrams as Code concepts |
| 02 - Icons.ipynb | Vendor icons (AWS, Azure, Databricks, Snowflake, etc.) |
| 03 - Admonitions.ipynb | Info boxes, warnings, notes, and other callouts |
| 04 - Codeblocks.ipynb | Styled code blocks with syntax highlighting (light/dark mode) |
| 05 - Mermaid.ipynb | Mermaid diagrams - flowcharts, sequences, ER diagrams, and more |
| 06 - Plantuml.ipynb | PlantUML diagrams for UML and architecture |
| 07 - C4 Plantuml.ipynb | C4 architecture diagrams using PlantUML |
- Simple Icons - Free SVG icons for popular brands
- Prism.js - Syntax highlighting for code blocks
- Mermaid - JavaScript-based diagramming
- PlantUML - UML diagrams from text
- C4-PlantUML - C4 model diagrams
Diagrams as Code is an approach where diagrams and visualizations are defined using text-based markup languages. Benefits include:
- Version Control - Track diagram changes alongside code
- Consistency - Standardized styling across documentation
- Maintainability - Easy updates without specialized tools
- Collaboration - Review diagrams using standard code review processes
- Reproducibility - Diagrams are always generated from source
Import these notebooks into your Databricks workspace and explore the examples. Each notebook contains:
- Working examples you can copy and customize
- Template code for creating your own diagrams
- Links to official documentation
MIT License - feel free to use these patterns in your own projects.