Skip to content

Commit 6512e2b

Browse files
committed
feat: Add AI model templates section to README and enhance sidebar resizer functionality
1 parent 261d51e commit 6512e2b

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

Readme.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,33 @@ The user interface is built with a clean, professional dark theme inspired by mo
4949
- **Dark (Background)**: `#141413`
5050
- **Accent (UI Elements)**: `#e3dacc`
5151

52+
## 🤖 AI Model Templates
53+
54+
CodeToContext optimizes the output format for different AI models. Choose the template that matches your target AI:
55+
56+
### 📝 GPT-4 (Markdown Format)
57+
**Best for:** ChatGPT, GPT-4, OpenAI API
58+
- Clean markdown structure with code blocks
59+
- Clear instructions at the top
60+
- Language-specific syntax highlighting
61+
- Easy to read and parse for GPT models
62+
63+
### 🤖 Claude (XML Format)
64+
**Best for:** Claude (Anthropic), Claude API
65+
- Structured XML tags for semantic understanding
66+
- Explicit `<context>`, `<file>`, `<content>` hierarchy
67+
- Better comprehension of project structure
68+
- Optimized for Claude's training on structured data
69+
70+
### ✨ Gemini (Hybrid Format)
71+
**Best for:** Google Gemini, Bard
72+
- Combination of markdown and metadata
73+
- File metadata with language tags
74+
- Organized sections for better navigation
75+
- Balanced between readability and structure
76+
77+
**How to use:** Select your preferred AI model from the dropdown in the editor header before generating context. The output will be automatically formatted for optimal performance with that AI.
78+
5279
## 🛠️ Key JavaScript Functions
5380
5481
The application's logic is contained within a single `<script>` tag in `index.html`. Here are some of the core functions:

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ <h3>EXPLORER</h3>
101101
</div>
102102
</div>
103103
</aside>
104+
<div class="sidebar-resizer" id="sidebarResizer" role="separator" aria-orientation="vertical" title="Drag to resize sidebar"></div>
104105

105106
<!-- CONTENT AREA -->
106107
<div class="content-area">

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
exp: $safe('expandAll'), col: $safe('collapseAll'),
374374
all: $safe('selectAll'), none: $safe('deselectAll'),
375375
gen: $safe('generateContextBtn'), ed: $safe('codeEditor'),
376+
resizer: $safe('sidebarResizer'),
376377
cnt: $safe('fileCount'), tok: $safe('tokenCount'), sz: $safe('totalSize'),
377378
pron: $safe('tokenPronunciation'), lang: $safe('languagesList'),
378379
copy: $safe('copyBtn'), txt: $safe('downloadTxtBtn'),

style.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,31 @@ html, body {
255255
transition: width 0.2s ease;
256256
overflow: hidden;
257257
flex-shrink: 0;
258+
min-width: 280px;
259+
max-width: 520px;
258260
}
259261

260262
.sidebar.collapsed {
261263
width: 0;
262264
border-right: none;
263265
}
264266

267+
.sidebar-resizer {
268+
width: 6px;
269+
cursor: ew-resize;
270+
background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
271+
border-radius: 3px;
272+
margin-left: 1px;
273+
flex-shrink: 0;
274+
transition: background 0.2s ease;
275+
height: 100%;
276+
}
277+
278+
.sidebar-resizer:hover,
279+
.sidebar-resizer.active {
280+
background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.5) 100%);
281+
}
282+
265283
.content-area {
266284
flex: 1;
267285
display: flex;

0 commit comments

Comments
 (0)