reallysimpledocs 1.0.0 → 1.0.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reallysimpledocs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.js",
@@ -43,6 +43,7 @@
43
43
  "devDependencies": {
44
44
  "astro": "^6.4.6",
45
45
  "basecoat-css": "^1.0.0-beta.6",
46
+ "htmx.org": "^2.0.10",
46
47
  "tailwindcss": "4.1.17"
47
48
  },
48
49
  "overrides": {
@@ -61,7 +61,11 @@ const actionItems = [
61
61
  ];
62
62
  ---
63
63
 
64
- <BaseLayout title={page.title} description={site.description} pagePath={page.path}>
64
+ <BaseLayout
65
+ title={page.title}
66
+ description={site.description}
67
+ pagePath={page.path}
68
+ >
65
69
  <CommandDialog />
66
70
  <Sidebar menu={sidebar} />
67
71
 
@@ -85,16 +89,26 @@ const actionItems = [
85
89
  </button>
86
90
 
87
91
  <div
88
- class="input-group h-8 w-full min-w-0 max-w-72 cursor-text sm:ml-auto"
92
+ class="input-group h-8 w-full min-w-0 max-w-72 cursor-text ml-auto"
89
93
  role="button"
90
94
  tabindex="0"
91
95
  aria-label="Search docs"
92
96
  onclick="window.rsdOpenCommandSearch ? window.rsdOpenCommandSearch() : document.getElementById('command-search')?.showModal()"
93
97
  onkeydown="if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); window.rsdOpenCommandSearch ? window.rsdOpenCommandSearch() : document.getElementById('command-search')?.showModal(); }"
94
98
  >
95
- <input type="text" placeholder="Search..." readonly tabindex="-1" aria-hidden="true" />
96
- <span data-align="start" aria-hidden="true"><Fragment set:html={searchIcon} /></span>
97
- <span data-align="end" aria-hidden="true"><kbd class="kbd">⌘K</kbd></span>
99
+ <input
100
+ type="text"
101
+ placeholder="Search..."
102
+ readonly
103
+ tabindex="-1"
104
+ aria-hidden="true"
105
+ />
106
+ <span data-align="start" aria-hidden="true"
107
+ ><Fragment set:html={searchIcon} /></span
108
+ >
109
+ <span data-align="end" aria-hidden="true"
110
+ ><kbd class="kbd">⌘K</kbd></span
111
+ >
98
112
  </div>
99
113
 
100
114
  <ContentHeader site={site} page={page} />
@@ -106,9 +120,17 @@ const actionItems = [
106
120
  <article class="min-w-0 flex-1 wrap-break-word">
107
121
  <div class="mx-auto w-full max-w-2xl flex-1 space-y-10">
108
122
  <header class="space-y-2">
109
- <div class="flex flex-col-reverse items-start gap-3 sm:flex-row sm:gap-x-2">
110
- <h1 class="mr-auto text-3xl font-semibold tracking-tight sm:text-4xl">{page.title}</h1>
111
- <div class="flex w-full items-center justify-end gap-x-2 sm:mt-1 sm:w-auto">
123
+ <div
124
+ class="flex flex-col-reverse items-start gap-3 sm:flex-row sm:gap-x-2"
125
+ >
126
+ <h1
127
+ class="mr-auto text-3xl font-semibold tracking-tight sm:text-4xl"
128
+ >
129
+ {page.title}
130
+ </h1>
131
+ <div
132
+ class="flex w-full items-center justify-end gap-x-2 sm:mt-1 sm:w-auto"
133
+ >
112
134
  <div role="group" class="button-group">
113
135
  <button
114
136
  type="button"
@@ -127,16 +149,30 @@ const actionItems = [
127
149
  <div role="group" class="button-group">
128
150
  {
129
151
  navigation.prev && (
130
- <a href={navigation.prev.path} class="btn" data-variant="secondary" data-size="icon-sm">
152
+ <a
153
+ href={navigation.prev.path}
154
+ class="btn"
155
+ data-variant="secondary"
156
+ data-size="icon-sm"
157
+ >
131
158
  <span class="sr-only">{navigation.prev.title}</span>
132
159
  <Fragment set:html={ArrowLeft} />
133
160
  </a>
134
161
  )
135
162
  }
136
- {navigation.prev && navigation.next && <hr role="separator" />}
163
+ {
164
+ navigation.prev && navigation.next && (
165
+ <hr role="separator" />
166
+ )
167
+ }
137
168
  {
138
169
  navigation.next && (
139
- <a href={navigation.next.path} class="btn" data-variant="secondary" data-size="icon-sm">
170
+ <a
171
+ href={navigation.next.path}
172
+ class="btn"
173
+ data-variant="secondary"
174
+ data-size="icon-sm"
175
+ >
140
176
  <span class="sr-only">{navigation.next.title}</span>
141
177
  <Fragment set:html={ArrowRight} />
142
178
  </a>
@@ -152,7 +188,12 @@ const actionItems = [
152
188
  <footer class="mt-12 flex items-center">
153
189
  {
154
190
  navigation.prev && (
155
- <a href={navigation.prev.path} class="btn mr-auto" data-variant="secondary" data-size="sm">
191
+ <a
192
+ href={navigation.prev.path}
193
+ class="btn mr-auto"
194
+ data-variant="secondary"
195
+ data-size="sm"
196
+ >
156
197
  <Fragment set:html={ArrowLeft} />
157
198
  {navigation.prev.title}
158
199
  </a>
@@ -160,7 +201,12 @@ const actionItems = [
160
201
  }
161
202
  {
162
203
  navigation.next && (
163
- <a href={navigation.next.path} class="btn ml-auto" data-variant="secondary" data-size="sm">
204
+ <a
205
+ href={navigation.next.path}
206
+ class="btn ml-auto"
207
+ data-variant="secondary"
208
+ data-size="sm"
209
+ >
164
210
  {navigation.next.title}
165
211
  <Fragment set:html={ArrowRight} />
166
212
  </a>
@@ -170,15 +216,18 @@ const actionItems = [
170
216
  </div>
171
217
  </article>
172
218
  <aside class="hidden w-56 xl:block">
173
- <div class="docs-toc sticky top-20 space-y-2 text-sm [&_a]:text-muted-foreground [&_a]:hover:text-foreground [&_a[aria-current='location']]:text-foreground [&_ol]:space-y-2 [&_ol_ol]:mt-2 [&_ol_ol]:pl-3" data-docs-toc>
174
- <h2 class="flex items-center gap-1 font-medium">
175
- On this page
176
- </h2>
219
+ <div
220
+ class="docs-toc sticky top-20 space-y-2 text-sm [&_a]:text-muted-foreground [&_a]:hover:text-foreground [&_a[aria-current='location']]:text-foreground [&_ol]:space-y-2 [&_ol_ol]:mt-2 [&_ol_ol]:pl-3"
221
+ data-docs-toc
222
+ >
223
+ <h2 class="flex items-center gap-1 font-medium">On this page</h2>
177
224
  <ol>
178
225
  {
179
226
  headings.map((heading) => (
180
227
  <li class={heading.depth === 3 ? "pl-3" : ""}>
181
- <a href={`#${heading.id}`} data-toc-link>{heading.text}</a>
228
+ <a href={`#${heading.id}`} data-toc-link>
229
+ {heading.text}
230
+ </a>
182
231
  </li>
183
232
  ))
184
233
  }
@@ -196,7 +245,10 @@ const actionItems = [
196
245
  const originalIcon = icon?.outerHTML || "";
197
246
 
198
247
  try {
199
- const response = await fetch(markdownUrl, { credentials: "same-origin", cache: "no-store" });
248
+ const response = await fetch(markdownUrl, {
249
+ credentials: "same-origin",
250
+ cache: "no-store",
251
+ });
200
252
  if (!response.ok) throw new Error("Failed to fetch markdown");
201
253
  const markdown = await response.text();
202
254
  await writeToClipboard(markdown);
@@ -204,11 +256,16 @@ const actionItems = [
204
256
  icon.outerHTML = checkIcon;
205
257
  window.setTimeout(() => {
206
258
  const currentIcon = button.querySelector("svg");
207
- if (currentIcon && originalIcon) currentIcon.outerHTML = originalIcon;
259
+ if (currentIcon && originalIcon)
260
+ currentIcon.outerHTML = originalIcon;
208
261
  }, 1200);
209
262
  }
210
263
  } catch (_) {
211
- window.open(new URL(markdownUrl, window.location.href).toString(), "_blank", "noopener");
264
+ window.open(
265
+ new URL(markdownUrl, window.location.href).toString(),
266
+ "_blank",
267
+ "noopener",
268
+ );
212
269
  }
213
270
  };
214
271
 
@@ -259,7 +316,8 @@ const actionItems = [
259
316
  let current = entries[0];
260
317
 
261
318
  for (const entry of entries) {
262
- if (entry.heading.getBoundingClientRect().top <= marker) current = entry;
319
+ if (entry.heading.getBoundingClientRect().top <= marker)
320
+ current = entry;
263
321
  else break;
264
322
  }
265
323
 
@@ -286,7 +344,9 @@ const actionItems = [
286
344
  activeFromScroll();
287
345
  window.addEventListener("scroll", queueActiveUpdate, { passive: true });
288
346
  window.addEventListener("resize", queueActiveUpdate);
289
- window.addEventListener("hashchange", () => window.setTimeout(activeFromScroll, 0));
347
+ window.addEventListener("hashchange", () =>
348
+ window.setTimeout(activeFromScroll, 0),
349
+ );
290
350
  }
291
351
 
292
352
  initDocsToc();