-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_docs.sh
More file actions
238 lines (201 loc) Β· 5.6 KB
/
setup_docs.sh
File metadata and controls
238 lines (201 loc) Β· 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/bin/bash
# Setup modern Python documentation with MkDocs + Material theme
echo "π Setting up documentation for claude-parser..."
# Install documentation dependencies
pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-autorefs
# Create MkDocs configuration
cat > mkdocs.yml << 'EOF'
site_name: Claude Parser
site_description: Parse Claude Code JSONL files with ease
site_url: https://yourusername.github.io/claude-parser
repo_url: https://github.com/yourusername/claude-parser
repo_name: claude-parser
theme:
name: material
features:
- navigation.tabs
- navigation.sections
- navigation.expand
- navigation.top
- search.suggest
- search.highlight
- content.tabs.link
- content.code.annotation
- content.code.copy
- content.code.select
palette:
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
font:
text: Inter
code: JetBrains Mono
plugins:
- search
- mkdocstrings:
handlers:
python:
options:
show_source: true
show_root_heading: true
show_signature_annotations: true
show_symbol_type_heading: true
show_symbol_type_toc: true
signature_crossrefs: true
merge_init_into_class: true
docstring_style: google
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- admonition
- pymdownx.details
- pymdownx.tabbed:
alternate_style: true
- def_list
- pymdownx.tasklist:
custom_checkbox: true
- toc:
permalink: true
nav:
- Home: index.md
- Getting Started:
- Installation: getting-started/installation.md
- Quick Start: getting-started/quickstart.md
- User Guide:
- Basic Usage: guide/basic.md
- Navigation: guide/navigation.md
- Discovery: guide/discovery.md
- API Reference:
- Core API: api/core.md
- Models: api/models.md
- Domain: api/domain.md
- Examples:
- Real-world Usage: examples/real-world.md
- Hook Platform: examples/hooks.md
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/yourusername
- icon: fontawesome/brands/python
link: https://pypi.org/project/claude-parser/
EOF
# Create documentation structure
mkdir -p docs/getting-started docs/guide docs/api docs/examples
# Create main index
cat > docs/index.md << 'EOF'
# Claude Parser
Parse Claude Code JSONL files with ease.
## Features
- π **Fast** - Uses orjson for blazing fast JSON parsing
- π― **Simple** - 95/5 principle: one line for common tasks
- π **Navigation** - Search, filter, and navigate conversations
- π§ **Discovery** - Auto-find transcripts from working directory
- π **Type-safe** - Full Pydantic models with type hints
## Quick Start
```python
from claude_parser import load, find_current_transcript
# Load current conversation
transcript = find_current_transcript()
conv = load(transcript)
# Search for messages
results = conv.search("95/5 principle")
# Get context around a message
context = conv.get_surrounding(msg.uuid, before=2, after=2)
```
## Installation
```bash
pip install claude-parser
```
## Why Claude Parser?
Built following the 95/5 principle - simple things should be simple, complex things should be possible.
EOF
# Create API reference that auto-generates from code
cat > docs/api/core.md << 'EOF'
# Core API
::: claude_parser
options:
show_root_heading: true
show_source: true
EOF
cat > docs/api/models.md << 'EOF'
# Models
::: claude_parser.models
options:
show_root_heading: true
show_source: true
EOF
cat > docs/api/domain.md << 'EOF'
# Domain
::: claude_parser.domain.conversation
options:
show_root_heading: true
show_source: true
EOF
# Create GitHub Actions workflow for auto-deployment
mkdir -p .github/workflows
cat > .github/workflows/docs.yml << 'EOF'
name: Deploy Documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-autorefs
pip install -e .
- name: Build docs
run: mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
EOF
echo "β
Documentation setup complete!"
echo ""
echo "π Next steps:"
echo "1. Run 'mkdocs serve' to preview locally at http://localhost:8000"
echo "2. Write your documentation in the docs/ folder"
echo "3. Push to GitHub - docs will auto-deploy to GitHub Pages"
echo ""
echo "π¨ Features included:"
echo "- Auto-generated API docs from docstrings"
echo "- Dark/light mode toggle"
echo "- Search functionality"
echo "- Mobile responsive"
echo "- Code copy buttons"
echo "- Type hints displayed"
echo "- GitHub Pages deployment"