Skip to content

Commit c578743

Browse files
committed
feat: docs
1 parent 7a75338 commit c578743

File tree

22 files changed

+2774
-1
lines changed

22 files changed

+2774
-1
lines changed

.github/workflows/docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- '.github/workflows/docs.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # Needed for git-revision-date-localized plugin
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.11'
35+
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v3
38+
39+
- name: Install documentation dependencies
40+
run: uv sync --group docs
41+
42+
- name: Build documentation
43+
run: uv run --group docs mkdocs build --clean
44+
45+
- name: Upload Pages artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: ./site
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ __pycache__/
2727
*.egg
2828

2929
.pypirc
30+
31+
# MkDocs generated site
32+
site/

docs/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Dashkit Documentation
2+
3+
Welcome to the Dashkit documentation! This directory contains comprehensive guides and API references for using and maintaining dash-dashkit.
4+
5+
## 📚 Documentation Structure
6+
7+
### For Users
8+
- **[API Reference](api/README.md)** - Complete component API documentation
9+
- **[Quick Start Guide](guides/quickstart.md)** - Get up and running quickly
10+
11+
### For Maintainers
12+
- **[Development Setup](internals/development.md)** - Local development environment
13+
- **[Architecture Overview](internals/architecture.md)** - Understanding the codebase
14+
15+
## 🚀 Getting Started
16+
17+
If you're new to Dashkit, start with the [Quick Start Guide](guides/quickstart.md).
18+
19+
## 📖 Building Documentation
20+
21+
This documentation is built with MkDocs and Material for MkDocs theme.
22+
23+
### Local Development
24+
25+
```bash
26+
# Install documentation dependencies
27+
uv run task docs-install
28+
29+
# Serve documentation locally with hot reload
30+
uv run task docs-serve
31+
32+
# Build static documentation
33+
uv run task docs-build
34+
```
35+
36+
### Deployment
37+
38+
Documentation is automatically deployed to GitHub Pages when changes are pushed to the main branch.
39+
40+
```bash
41+
# Manual deployment to GitHub Pages
42+
uv run task docs-deploy
43+
```
44+
45+
## 📖 Additional Resources
46+
47+
- [Main README](../README.md) - Project overview and basic setup
48+
- [CHANGELOG](../CHANGELOG.md) - Version history and changes
49+
- [PyPI Package](https://pypi.org/project/dash-dashkit/) - Official package
50+
- [GitHub Repository](https://github.com/iamgp/dash_dashkit) - Source code and issues

docs/api/README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# API Reference
2+
3+
Complete reference for all Dashkit components and functions.
4+
5+
## Core Components
6+
7+
### Layout Components
8+
- **[create_layout](components/layout.md)** - Main application layout with sidebar and header
9+
- **[create_sidebar](components/sidebar.md)** - Configurable sidebar navigation
10+
- **[create_header](components/header.md)** - Two-tier header with actions and search
11+
12+
### UI Components
13+
- **[Table](components/table.md)** - Modern data tables with Handsontable integration
14+
- **[Buttons](components/buttons.md)** - Primary and secondary button components
15+
- **[Cards](components/cards.md)** - Card containers for content organization
16+
- **[MarkdownReport](components/markdown.md)** - Markdown content rendering
17+
18+
### Chart Components (Optional)
19+
- **[AreaChart](components/charts.md#areachart)** - Area chart visualization
20+
- **[BarChart](components/charts.md#barchart)** - Bar chart visualization
21+
- **[ChartContainer](components/charts.md#chartcontainer)** - Chart wrapper component
22+
23+
## Setup & Configuration
24+
25+
### Application Setup
26+
- **[setup_app](setup.md#setup_app)** - Configure Dash app with Dashkit styling
27+
28+
### Theme Management
29+
- **[ThemeManager](theming.md)** - Theme switching and persistence
30+
31+
## Installation Options
32+
33+
```bash
34+
# Core components only
35+
pip install dash-dashkit
36+
37+
# With table support
38+
pip install dash-dashkit[table]
39+
40+
# With chart support
41+
pip install dash-dashkit[charts]
42+
43+
# With contribution graphs
44+
pip install dash-dashkit[kiboui]
45+
46+
# Everything included
47+
pip install dash-dashkit[all]
48+
```
49+
50+
## Import Structure
51+
52+
```python
53+
# Core imports
54+
from dashkit import create_layout, setup_app
55+
from dashkit import Table, PrimaryButton, SecondaryButton
56+
from dashkit import Card, MetricCard, ChartCard, MarkdownReport
57+
58+
# Optional chart imports (requires dashkit_shadcn)
59+
from dashkit import AreaChart, BarChart, ChartContainer
60+
61+
# Direct component imports
62+
from dashkit_table import DashkitTable
63+
from dashkit_kiboui import ContributionGraph
64+
from dashkit_shadcn import AreaChart as ShadcnAreaChart
65+
```
66+
67+
## Quick Example
68+
69+
```python
70+
from dash import Dash, html
71+
import dashkit
72+
73+
app = Dash(__name__)
74+
dashkit.setup_app(app)
75+
76+
data = [{"name": "Alice", "score": 10}, {"name": "Bob", "score": 20}]
77+
columns = [{"data": "name", "title": "Name"}, {"data": "score", "title": "Score"}]
78+
79+
app.layout = dashkit.create_layout(
80+
content=html.Div([
81+
html.H3("Dashboard"),
82+
dashkit.Table(id="table", data=data, columns=columns, height=300),
83+
dashkit.PrimaryButton("Add Row", icon="plus")
84+
]),
85+
sidebar_config={"brand_name": "My App"},
86+
header_config={"page_title": "Dashboard"}
87+
)
88+
89+
if __name__ == "__main__":
90+
app.run(debug=True)
91+
```

docs/api/components/buttons.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Buttons
2+
3+
::: dashkit.buttons

docs/api/components/cards.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Cards
2+
3+
::: dashkit.card

docs/api/components/charts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Charts
2+
3+
::: dashkit.charts

docs/api/components/header.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Header
2+
3+
::: dashkit.header

docs/api/components/layout.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Layout
2+
3+
::: dashkit.layout

docs/api/components/markdown.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Markdown Report
2+
3+
::: dashkit.markdown_report

0 commit comments

Comments
 (0)