Skip to content

Commit c00661e

Browse files
committed
updates
1 parent 8da6f3a commit c00661e

File tree

3 files changed

+137
-107
lines changed

3 files changed

+137
-107
lines changed

apps/repl/app/templates/docs/repl-sdk.gts

Lines changed: 90 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -169,121 +169,132 @@ const compiler = new Compiler({
169169

170170
<H2 @id="install">Install</H2>
171171

172-
With your favorite package manager
173-
174-
<div data-format="bash" {{highlighted "npm add repl-sdk"}}></div>
175-
<div data-format="bash" {{highlighted "pnpm add repl-sdk"}}></div>
176-
(etc)
177-
178-
<H2 @id="bundled-compilers">Bundled Compilers</H2>
179-
180-
repl-sdk will not load any compiler out of the box on its, unless a
181-
<code>compile</code>
182-
request is made for that compiler's registered
183-
<code>format</code>
184-
(sometimes narrowed by a "<code>flavor</code>").
185-
186-
<br /><br />
187-
Each
188-
<code>format</code>
189-
represents a
190-
<i>file extension</i>. For some
191-
<code>format</code>s, there are multiple
192-
<code>flavor</code>s, like for
193-
<code>jsx</code>.
172+
<p>
173+
With your favorite package manager
174+
175+
<div data-format="bash" {{highlighted "npm add repl-sdk"}}></div>
176+
<div data-format="bash" {{highlighted "pnpm add repl-sdk"}}></div>
177+
(etc)
178+
179+
<H2 @id="bundled-compilers">Bundled Compilers</H2>
180+
181+
repl-sdk will not load any compiler out of the box on its, unless a
182+
<code>compile</code>
183+
request is made for that compiler's registered
184+
<code>format</code>
185+
(sometimes narrowed by a "<code>flavor</code>").
186+
187+
<br /><br />
188+
Each
189+
<code>format</code>
190+
represents a
191+
<i>file extension</i>. For some
192+
<code>format</code>s, there are multiple
193+
<code>flavor</code>s, like for
194+
<code>jsx</code>.
195+
</p>
194196

195197
{{#each formats as |formatDocs|}}
196198
<formatDocs />
197199
{{/each}}
198200

199201
<H2 @id="api-overview">API Overview</H2>
200202

201-
There is only available module, and two exports from that module
203+
<p>
204+
There is only available module, and two exports from that module
202205

203-
<div data-format="js" {{highlighted "import {
206+
<div data-format="js" {{highlighted "import {
204207
Compiler,
205208
defaults
206209
} from 'repl-sdk';"}}></div>
210+
</p>
207211

208212
<H3 class="code-link" @id="index-Compiler"><code>Compiler</code>
209213
from repl-sdk</H3>
214+
<p>
210215

211-
By default, no configuration is needed.
216+
By default, no configuration is needed.
212217

213-
<div data-format="js" {{highlighted samples.Compiler.basic}}></div>
218+
<div data-format="js" {{highlighted samples.Compiler.basic}}></div>
214219

215-
Debug logging can be configured on or conditionally on via any means you choose. Here we can
216-
configure logging when
217-
<code>debug</code>
218-
is present in the query params. This is
219-
<em>very</em>
220-
noisy for some module graphs, but is helpful in debugging the internal of
221-
<code>repl-sdk</code>.
220+
Debug logging can be configured on or conditionally on via any means you choose. Here we can
221+
configure logging when
222+
<code>debug</code>
223+
is present in the query params. This is
224+
<em>very</em>
225+
noisy for some module graphs, but is helpful in debugging the internal of
226+
<code>repl-sdk</code>.
222227

223-
<div data-format="js" {{highlighted samples.Compiler.debug}}></div>
228+
<div data-format="js" {{highlighted samples.Compiler.debug}}></div>
224229

225-
If you want to wire up the higher-level messaging from each compiler to your UI, there is this
226-
<code>on.log</code>
227-
function that can be configured to push log messages outside of the
228-
<code>Compiler</code>
230+
If you want to wire up the higher-level messaging from each compiler to your UI, there is this
231+
<code>on.log</code>
232+
function that can be configured to push log messages outside of the
233+
<code>Compiler</code>
229234

230-
<div data-format="js" {{highlighted samples.Compiler.onlog}}></div>
235+
<div data-format="js" {{highlighted samples.Compiler.onlog}}></div>
231236

232-
The
233-
<code>Compiler</code>
234-
can take an options object for configuring each of the compilers. They each may take a different
235-
configuration, and will ignore any options that are not expected.
237+
The
238+
<code>Compiler</code>
239+
can take an options object for configuring each of the compilers. They each may take a
240+
different configuration, and will ignore any options that are not expected.
236241

237-
<div data-format="js" {{highlighted samples.Compiler.options}}></div>
242+
<div data-format="js" {{highlighted samples.Compiler.options}}></div>
243+
</p>
238244

239245
<H4 class="code-link" @id="index-Compiler-compile"><code>&lt;Compiler#compile&gt;</code></H4>
240-
241-
Calling compile takes 2 to 3 arguments, the file format, the file to compile, and then an
242-
optional set of options. The options are optional for all file formats except when there is some
243-
ambiguity -- such as for the
244-
<code>jsx</code>
245-
and
246-
<code>hbs</code>
247-
file formats.
248-
249-
<br /><br />
250-
The element doesn't need to be immediately attached anywhere, but in order for the user to view
251-
what was compiled, it will need to be placed somewhere.
252-
253-
<div data-format="js" {{highlighted samples.compile.basic}}></div>
246+
<p>
247+
Calling compile takes 2 to 3 arguments, the file format, the file to compile, and then an
248+
optional set of options. The options are optional for all file formats except when there is
249+
some ambiguity -- such as for the
250+
<code>jsx</code>
251+
and
252+
<code>hbs</code>
253+
file formats.
254+
255+
<br /><br />
256+
The element doesn't need to be immediately attached anywhere, but in order for the user to
257+
view what was compiled, it will need to be placed somewhere.
258+
259+
<div data-format="js" {{highlighted samples.compile.basic}}></div>
260+
</p>
254261

255262
<H4 class="code-link" @id="index-Compiler-createEditor"><code
256263
>&lt;Compiler#createEditor&gt;</code></H4>
264+
<p>
257265

258-
This editor uses
259-
<ExternalLink href="https://codemirror.net/">codemirror</ExternalLink>
260-
which supports editing on both mobile and desktop devices, as well as proper keyboard
261-
accessibility.
262-
<br /><br />
263-
It has all extensions and syntax configured for each of the supported language formats.
266+
This editor uses
267+
<ExternalLink href="https://codemirror.net/">codemirror</ExternalLink>
268+
which supports editing on both mobile and desktop devices, as well as proper keyboard
269+
accessibility.
270+
<br /><br />
271+
It has all extensions and syntax configured for each of the supported language formats.
264272

265-
<br /><br />
266-
This is
267-
<code>await import</code>'d, so if you don't want to use codemirror, you will not pay for the
268-
bytes of codemirror in your bundled project.
273+
<br /><br />
274+
This is
275+
<code>await import</code>'d, so if you don't want to use codemirror, you will not pay for the
276+
bytes of codemirror in your bundled project.
269277

270-
<div data-format="js" {{highlighted samples.createEditor.basic}}></div>
278+
<div data-format="js" {{highlighted samples.createEditor.basic}}></div>
279+
</p>
271280

272281
<H3 class="code-link" @id="index-defaults"><code>defaults</code>
273282
from repl-sdk</H3>
283+
<p>
274284

275-
This is the default configuration for the
276-
<code>Compiler</code>. It provides only the
277-
<code>formats</code>
278-
configuration with all the default compilers.
285+
This is the default configuration for the
286+
<code>Compiler</code>. It provides only the
287+
<code>formats</code>
288+
configuration with all the default compilers.
279289

280-
<br /><br />This can be used to add custom compilers, remove existing compilers, or replace them
281-
entirely.
290+
<br /><br />This can be used to add custom compilers, remove existing compilers, or replace
291+
them entirely.
282292

283-
<div data-format="js" {{highlighted samples.defaults.basic}}></div>
293+
<div data-format="js" {{highlighted samples.defaults.basic}}></div>
284294

285-
Each compiler is
286-
<code>await import</code>'d so omitting compilers from this options object will omit their code
287-
from your final bundles.
295+
Each compiler is
296+
<code>await import</code>'d so omitting compilers from this options object will omit their
297+
code from your final bundles.
298+
</p>
288299
</div>
289300
</template>

apps/repl/app/templates/docs/repl-sdk/formats/jsx-react.gts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ExternalLink } from '@nullvoxpopuli/limber-shared';
2+
13
import { H4, snippet } from '../../support/code.gts';
24

35
import type { SimpleComponent } from '#types';
@@ -26,7 +28,10 @@ export const JSXReact = <template>
2628
<H4 @id="format-jsx-react">jsx:React</H4>
2729

2830
<p>
29-
text here
31+
This is the
32+
<ExternalLink href="https://react.dev/">React</ExternalLink>
33+
implementation of JSX.
34+
3035
<snippet.js @code={{usage}} />
3136
</p>
3237
</template> satisfies SimpleComponent;

apps/repl/app/templates/docs/styles.css

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
.docs-nav {
2-
position: sticky;
3-
top: 0;
4-
background: white;
5-
z-index: 1;
6-
border-bottom: 1px solid;
7-
}
8-
91
.docs-nav, .vertical-nav {
102
display: flex;
113
justify-content: space-between;
@@ -32,6 +24,14 @@
3224
}
3325

3426
}
27+
.docs-nav {
28+
position: sticky;
29+
top: 0;
30+
background: white;
31+
z-index: 1;
32+
border-bottom: 1px solid;
33+
}
34+
3535

3636
.vertical-nav {
3737
display: flex;
@@ -159,25 +159,6 @@ article header {
159159
}
160160
}
161161

162-
@media (max-width: 1000px) {
163-
.centered-content main.prose {
164-
max-width: calc(100dvw - 1rem);
165-
display: block;
166-
section, .main-content {
167-
pre > code {
168-
white-space: pre-wrap;
169-
overflow-wrap: break-word;
170-
word-break: break-word;
171-
}
172-
}
173-
}
174-
175-
.centered-content > main:has(aside) {
176-
aside {
177-
display: none;
178-
}
179-
}
180-
}
181162

182163
.limber__docs__option__example {
183164
display: grid;
@@ -277,3 +258,36 @@ a.code-link {
277258
grid-area: description;
278259
}
279260
}
261+
262+
263+
264+
@media (max-width: 1000px) {
265+
.centered-content main.prose {
266+
max-width: calc(100dvw - 1rem);
267+
display: block;
268+
section, .main-content {
269+
pre > code {
270+
white-space: pre-wrap;
271+
overflow-wrap: break-word;
272+
word-break: break-word;
273+
}
274+
}
275+
}
276+
277+
.centered-content > main:has(aside) {
278+
aside {
279+
display: none;
280+
}
281+
}
282+
}
283+
284+
@media (max-width: 800px) {
285+
a:has(h2), a:has(h3), a:has(h4) {
286+
h2, h3, h4 {
287+
scroll-margin-top: 130px;
288+
}
289+
}
290+
.centered-content .main-content {
291+
width: 100% !important;
292+
}
293+
}

0 commit comments

Comments
 (0)