kash-shell 0.3.17__py3-none-any.whl → 0.3.20__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kash/actions/core/{markdownify.py → markdownify_html.py} +3 -6
- kash/actions/core/minify_html.py +41 -0
- kash/commands/base/show_command.py +11 -1
- kash/commands/workspace/workspace_commands.py +10 -88
- kash/config/colors.py +6 -2
- kash/docs/markdown/topics/a1_what_is_kash.md +52 -23
- kash/docs/markdown/topics/a2_installation.md +17 -30
- kash/docs/markdown/topics/a3_getting_started.md +5 -19
- kash/exec/__init__.py +3 -0
- kash/exec/action_exec.py +3 -3
- kash/exec/fetch_url_items.py +109 -0
- kash/exec/precondition_registry.py +3 -3
- kash/file_storage/file_store.py +24 -1
- kash/file_storage/store_filenames.py +4 -0
- kash/help/function_param_info.py +1 -1
- kash/help/help_pages.py +1 -1
- kash/help/help_printing.py +1 -1
- kash/llm_utils/llm_features.py +5 -1
- kash/llm_utils/llms.py +18 -8
- kash/media_base/media_cache.py +48 -24
- kash/media_base/media_services.py +63 -14
- kash/media_base/services/local_file_media.py +9 -1
- kash/model/items_model.py +22 -8
- kash/model/media_model.py +9 -1
- kash/model/params_model.py +9 -3
- kash/utils/common/function_inspect.py +97 -1
- kash/utils/common/parse_docstring.py +347 -0
- kash/utils/common/testing.py +58 -0
- kash/utils/common/url_slice.py +329 -0
- kash/utils/file_utils/file_formats.py +1 -1
- kash/utils/text_handling/markdown_utils.py +424 -16
- kash/web_content/web_extract.py +34 -15
- kash/web_content/web_page_model.py +10 -1
- kash/web_gen/templates/base_styles.css.jinja +137 -15
- kash/web_gen/templates/base_webpage.html.jinja +13 -17
- kash/web_gen/templates/components/toc_scripts.js.jinja +319 -0
- kash/web_gen/templates/components/toc_styles.css.jinja +284 -0
- kash/web_gen/templates/components/tooltip_scripts.js.jinja +730 -0
- kash/web_gen/templates/components/tooltip_styles.css.jinja +482 -0
- kash/web_gen/templates/content_styles.css.jinja +13 -8
- kash/web_gen/templates/simple_webpage.html.jinja +15 -481
- kash/workspaces/workspaces.py +10 -1
- {kash_shell-0.3.17.dist-info → kash_shell-0.3.20.dist-info}/METADATA +75 -72
- {kash_shell-0.3.17.dist-info → kash_shell-0.3.20.dist-info}/RECORD +47 -40
- kash/exec/fetch_url_metadata.py +0 -72
- kash/help/docstring_utils.py +0 -111
- {kash_shell-0.3.17.dist-info → kash_shell-0.3.20.dist-info}/WHEEL +0 -0
- {kash_shell-0.3.17.dist-info → kash_shell-0.3.20.dist-info}/entry_points.txt +0 -0
- {kash_shell-0.3.17.dist-info → kash_shell-0.3.20.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/* Table of Contents Styles */
|
|
2
|
+
:root {
|
|
3
|
+
--toc-width: max(21vw, 15rem);
|
|
4
|
+
--toc-breakpoint: {{ toc_breakpoint | default(1200) }}px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@media (min-width: 1536px) {
|
|
8
|
+
:root {
|
|
9
|
+
--toc-width: min(21vw, 30rem);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Desktop: Always use grid layout, adjust TOC column width */
|
|
14
|
+
@media (min-width: {{ toc_breakpoint | default(1200) }}px) {
|
|
15
|
+
.content-with-toc {
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: calc(var(--toc-width) + 4rem) 1fr;
|
|
18
|
+
max-width: none;
|
|
19
|
+
min-height: 100vh;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content-with-toc.has-toc {
|
|
23
|
+
grid-template-columns: calc(var(--toc-width) + 4rem) 1fr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Content goes in the second column (right side) */
|
|
27
|
+
.content-with-toc .long-text {
|
|
28
|
+
max-width: 48rem;
|
|
29
|
+
margin-left: max(1rem, calc((100vw - 48rem) / 2 - var(--toc-width)));
|
|
30
|
+
margin-right: auto;
|
|
31
|
+
order: 2;
|
|
32
|
+
grid-column: 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* TOC goes in the first column (left side) */
|
|
36
|
+
.toc-container {
|
|
37
|
+
order: 1;
|
|
38
|
+
grid-column: 1;
|
|
39
|
+
align-self: start;
|
|
40
|
+
width: var(--toc-width);
|
|
41
|
+
position: sticky;
|
|
42
|
+
top: 2rem;
|
|
43
|
+
max-height: calc(100vh - 4rem);
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
padding: 0.5rem 0.7rem 1rem 1.2rem;
|
|
46
|
+
margin: 0 0 0 2rem;
|
|
47
|
+
border: 1px solid var(--color-border-hint);
|
|
48
|
+
opacity: 0;
|
|
49
|
+
transform: translateX(-100%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.content-with-toc.has-toc .toc-container {
|
|
53
|
+
transform: translateX(0);
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Hide mobile toggle on desktop */
|
|
58
|
+
.toc-toggle {
|
|
59
|
+
display: none !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* More minimal TOC scrollbar */
|
|
63
|
+
.toc-container::-webkit-scrollbar {
|
|
64
|
+
width: 2px;
|
|
65
|
+
}
|
|
66
|
+
.toc-container::-webkit-scrollbar-track {
|
|
67
|
+
background: transparent; /* Invisible track */
|
|
68
|
+
}
|
|
69
|
+
.toc-container::-webkit-scrollbar-thumb {
|
|
70
|
+
background: var(--color-hint-gentle);
|
|
71
|
+
border-radius: 2px;
|
|
72
|
+
opacity: 0.1;
|
|
73
|
+
}
|
|
74
|
+
.toc-container::-webkit-scrollbar-thumb:hover {
|
|
75
|
+
opacity: 0.2;
|
|
76
|
+
}
|
|
77
|
+
.toc-container {
|
|
78
|
+
/* For Firefox */
|
|
79
|
+
scrollbar-width: thin;
|
|
80
|
+
scrollbar-color: var(--color-hint-gentle) transparent;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* TOC Styling */
|
|
85
|
+
.toc {
|
|
86
|
+
font-family: var(--font-sans);
|
|
87
|
+
color: var(--color-tertiary);
|
|
88
|
+
font-variant-numeric: tabular-nums;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.toc-title {
|
|
92
|
+
font-size: var(--font-size-small);
|
|
93
|
+
font-weight: 550;
|
|
94
|
+
text-transform: uppercase;
|
|
95
|
+
letter-spacing: 0.025em;
|
|
96
|
+
padding-left: 0.3rem;
|
|
97
|
+
border-bottom: 1px solid var(--color-border-hint);
|
|
98
|
+
border-left: none !important; /* Override toc-link border */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.toc-list {
|
|
102
|
+
list-style: none;
|
|
103
|
+
margin: 0.5rem 0 0 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
font-size: var(--font-size-small);
|
|
106
|
+
line-height: 1.2;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.toc-list li {
|
|
110
|
+
margin: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.toc-list li::before {
|
|
114
|
+
display: none; /* Remove custom bullet points */
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.toc-link {
|
|
118
|
+
display: block;
|
|
119
|
+
color: var(--color-tertiary);
|
|
120
|
+
text-decoration: none;
|
|
121
|
+
padding-top: 0.2rem;
|
|
122
|
+
padding-bottom: 0.2rem;
|
|
123
|
+
transition: background 0.4s ease-in-out, all 0.15s ease-in-out;
|
|
124
|
+
border-left: 2px solid transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.toc-link:hover {
|
|
128
|
+
color: var(--color-secondary);
|
|
129
|
+
background-color: var(--color-hover-bg);
|
|
130
|
+
text-decoration: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.toc-link.active {
|
|
134
|
+
color: var(--color-secondary);
|
|
135
|
+
border-left: 2px solid var(--color-primary);
|
|
136
|
+
background-color: var(--color-bg-selected);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Hanging indent and styles for each TOC heading */
|
|
140
|
+
.toc-h1 {
|
|
141
|
+
padding-left: 1.3rem;
|
|
142
|
+
text-indent: -1em;
|
|
143
|
+
font-weight: 550;
|
|
144
|
+
letter-spacing: 0.007em;
|
|
145
|
+
}
|
|
146
|
+
.toc-h2 {
|
|
147
|
+
padding-left: 2.0rem;
|
|
148
|
+
text-indent: -1em;
|
|
149
|
+
font-weight: 550;
|
|
150
|
+
letter-spacing: 0.007em;
|
|
151
|
+
}
|
|
152
|
+
.toc-h3 {
|
|
153
|
+
padding-left: 2.7rem;
|
|
154
|
+
text-indent: -1em;
|
|
155
|
+
font-weight: 370;
|
|
156
|
+
}
|
|
157
|
+
.toc-h4 {
|
|
158
|
+
padding-left: 3.4rem;
|
|
159
|
+
text-indent: -1em;
|
|
160
|
+
font-weight: 370;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Prevent body scroll when TOC is open */
|
|
164
|
+
body.toc-open {
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
position: fixed;
|
|
167
|
+
width: 100%;
|
|
168
|
+
/* Prevent iOS bounce scrolling on body */
|
|
169
|
+
touch-action: none;
|
|
170
|
+
-webkit-overflow-scrolling: auto;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Mobile TOC Layout */
|
|
174
|
+
@media (max-width: {{ toc_breakpoint | default(1200) - 1 }}px) {
|
|
175
|
+
/* TOC backdrop - semi-transparent overlay */
|
|
176
|
+
.toc-backdrop {
|
|
177
|
+
position: fixed;
|
|
178
|
+
top: 0;
|
|
179
|
+
left: 0;
|
|
180
|
+
width: 100vw;
|
|
181
|
+
height: 100vh;
|
|
182
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
183
|
+
z-index: 199; /* Below TOC container (200) but above everything else */
|
|
184
|
+
|
|
185
|
+
/* Hidden by default */
|
|
186
|
+
opacity: 0;
|
|
187
|
+
visibility: hidden;
|
|
188
|
+
pointer-events: none;
|
|
189
|
+
|
|
190
|
+
/* Smooth transition */
|
|
191
|
+
transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Specific positioning and z-index for TOC toggle */
|
|
195
|
+
.toc-toggle {
|
|
196
|
+
left: 1rem;
|
|
197
|
+
z-index: 101;
|
|
198
|
+
opacity: 0; /* Hidden by default */
|
|
199
|
+
visibility: hidden; /* Start hidden for FOUC prevention on mobile */
|
|
200
|
+
transition: opacity 0.3s ease-in-out,
|
|
201
|
+
visibility 0.3s ease-in-out,
|
|
202
|
+
background-color 0.4s ease-in-out,
|
|
203
|
+
color 0.4s ease-in-out;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Show TOC toggle when user has scrolled past top */
|
|
207
|
+
.toc-toggle.show-toggle {
|
|
208
|
+
opacity: 1;
|
|
209
|
+
visibility: visible;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Show backdrop when visible */
|
|
213
|
+
.toc-backdrop.visible {
|
|
214
|
+
opacity: 1;
|
|
215
|
+
visibility: visible;
|
|
216
|
+
pointer-events: auto;
|
|
217
|
+
/* Prevent any scrolling or touch interaction on backdrop */
|
|
218
|
+
touch-action: none;
|
|
219
|
+
-webkit-overflow-scrolling: auto;
|
|
220
|
+
overflow: hidden;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Mobile TOC state: always rendered but hidden by default */
|
|
224
|
+
.toc-container {
|
|
225
|
+
display: block !important; /* Override base rule and any JS inline styles */
|
|
226
|
+
position: fixed;
|
|
227
|
+
top: 4rem;
|
|
228
|
+
left: 1rem;
|
|
229
|
+
width: calc(100vw - 2rem);
|
|
230
|
+
max-height: calc(100vh - 5rem);
|
|
231
|
+
/* Keep background and darker text on mobile since it's primary UI */
|
|
232
|
+
color: var(--color-text);
|
|
233
|
+
background: var(--color-bg-alt-solid);
|
|
234
|
+
border: 1px solid var(--color-border-hint);
|
|
235
|
+
padding: 1rem 0.7rem;
|
|
236
|
+
z-index: 200;
|
|
237
|
+
|
|
238
|
+
/* Ensure TOC itself is scrollable */
|
|
239
|
+
overflow-y: auto;
|
|
240
|
+
overflow-x: hidden; /* Prevent horizontal scroll */
|
|
241
|
+
-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
|
|
242
|
+
overscroll-behavior: contain; /* Prevent scroll chaining */
|
|
243
|
+
|
|
244
|
+
/* Ensure touch scrolling works properly */
|
|
245
|
+
touch-action: pan-y;
|
|
246
|
+
|
|
247
|
+
/* Initial hidden state for mobile FOUC and animation */
|
|
248
|
+
opacity: 0;
|
|
249
|
+
transform: translateY(-0.5rem);
|
|
250
|
+
visibility: hidden;
|
|
251
|
+
pointer-events: none; /* Prevent interaction when hidden */
|
|
252
|
+
|
|
253
|
+
transition: opacity 0.3s ease-in-out,
|
|
254
|
+
transform 0.3s ease-in-out,
|
|
255
|
+
visibility 0.3s ease-in-out,
|
|
256
|
+
pointer-events 0.3s ease-in-out,
|
|
257
|
+
background-color 0.4s ease-in-out,
|
|
258
|
+
border-color 0.4s ease-in-out,
|
|
259
|
+
box-shadow 0.4s ease-in-out;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Darker text on mobile */
|
|
263
|
+
.toc {
|
|
264
|
+
color: var(--color-secondary);
|
|
265
|
+
}
|
|
266
|
+
.toc-link {
|
|
267
|
+
color: var(--color-secondary);
|
|
268
|
+
}
|
|
269
|
+
.toc-link:hover {
|
|
270
|
+
color: var(--color-text);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.toc-link.active {
|
|
274
|
+
color: var(--color-text);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.toc-container.mobile-visible {
|
|
278
|
+
/* Visible state */
|
|
279
|
+
opacity: 1;
|
|
280
|
+
transform: translateY(0);
|
|
281
|
+
visibility: visible;
|
|
282
|
+
pointer-events: auto; /* Re-enable interaction */
|
|
283
|
+
}
|
|
284
|
+
}
|