Skip to content

Commit 423aa1a

Browse files
author
ignace
committed
feat: use shikiji
1 parent c03e910 commit 423aa1a

File tree

5 files changed

+3549
-4373
lines changed

5 files changed

+3549
-4373
lines changed

app/styles/app.css

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,8 @@ code[data-diff] .diff-insertion::before {
171171
.chapter code, .chapter code[class*=language-] {
172172
line-height: 1.4;
173173
}
174-
.chapter pre, .chapter pre[class*=language-] {
174+
.chapter .filename, .chapter pre, .chapter pre[class*=language-] {
175175
font-size: 85%;
176-
padding: 0.75em;
177-
}
178-
179-
/* Make the line number "gutter" narrower and more balanced */
180-
181-
.chapter pre.line-numbers,
182-
.chapter pre[class*=language-].line-numbers {
183-
padding-left: 3.6em;
184-
}
185-
.chapter pre.line-numbers code,
186-
.chapter pre[class*=language-].line-numbers code {
187-
display: inline-block;
188-
margin-left: 0.05em;
189176
}
190177

191178
/* ToC heading styles */

config/fastboot.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = function () {
2+
return {
3+
buildSandboxGlobals(defaultGlobals) {
4+
return Object.assign({}, defaultGlobals, {
5+
atob: atob,
6+
});
7+
},
8+
};
9+
};

guides/release/components/template-tag-format.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following template-only component was created in a [previous section](../com
2020

2121
This layout can be turned into a template tag component by wrapping the code in a `<template>` tag and changing the file extension to `.gjs`.
2222

23-
```text {data-filename="app/components/avatar.gjs"}
23+
```gjs {data-filename="app/components/avatar.gjs"}
2424
<template>
2525
<aside>
2626
<div class="avatar" title={{@title}}>{{@initial}}</div>
@@ -30,7 +30,7 @@ This layout can be turned into a template tag component by wrapping the code in
3030

3131
The top-level template tag is exported as default component from the file. You *can* write this export explicitly, but it's not necessary. The following example is equivalent to the previous one.
3232

33-
```text {data-filename="app/components/avatar.gjs"}
33+
```gjs {data-filename="app/components/avatar.gjs"}
3434
export default <template>
3535
<aside>
3636
<div class="avatar" title={{@title}}>{{@initial}}</div>
@@ -42,7 +42,7 @@ export default <template>
4242

4343
A `<template>` tag can also be embedded inside a class definition of a component. This is useful when you need to add state or other logic to your component. Take for example the following "Avatar" component, where a default title is added when the `title` argument is not provided.
4444

45-
```text {data-filename="app/components/avatar.gjs"}
45+
```gjs {data-filename="app/components/avatar.gjs"}
4646
import Component from '@glimmer/component';
4747
4848
export default class Avatar extends Component {
@@ -66,7 +66,7 @@ The template tag format uses strict template semantics. This means that you can
6666

6767
When making use of the "Avatar" component as defined before in a different component file, it first needs to be imported. This is done using the `import` statement, just like you would import any other JavaScript module.
6868

69-
```text {data-filename="app/components/message.gjs"}
69+
```gjs {data-filename="app/components/message.gjs"}
7070
import Avatar from './avatar';
7171
7272
<template>
@@ -107,11 +107,12 @@ For example, when moving the "Avatar" component to the `app/components/messages`
107107
@title="Picture of Zoey"
108108
@initial="Zoey"
109109
/>
110+
110111
```
111112

112113
This quirk is no longer necessary with the template tag format. Instead, importing now works the same as importing any other JavaScript module.
113114

114-
```text {data-filename="app/components/avatar-usage.gjs"}
115+
```gjs {data-filename="app/components/avatar-usage.gjs"}
115116
import Avatar from './messages/avatar';
116117
117118
<template>
@@ -172,7 +173,7 @@ The template tag format follows JavaScript module syntax. Any value that isn't e
172173

173174
In the following example, a "Square" component is defined that calculates the square of a number. The `value` constant is defined locally, and the `square` helper function is only available within the component.
174175

175-
```text {data-filename="app/components/square.gjs"}
176+
```gjs {data-filename="app/components/square.gjs"}
176177
const value = 2;
177178
178179
function square(number) {
@@ -192,7 +193,7 @@ The template tag format allows defining multiple components within a single file
192193

193194
The following example defines a "CustomSelect" component that renders a `<select>` element with a list of options. The locally-defined "Option" component is used to render each option in the list.
194195

195-
```text {data-filename="app/components/custom-select.gjs"}
196+
```gjs {data-filename="app/components/custom-select.gjs"}
196197
const Option = <template>
197198
<option selected={{@selected}} value={{@value}}>
198199
{{@value}}
@@ -221,7 +222,7 @@ Historically, Ember's integration tests have been written using the `hbs` tagged
221222

222223
The following example showcases how the "Avatar" component can be tested using the template tag format.
223224

224-
```text {data-filename="tests/integration/components/avatar-test.gjs"}
225+
```gjs {data-filename="tests/integration/components/avatar-test.gjs"}
225226
import Avatar from 'app/components/avatar';
226227
import { module, test } from 'qunit';
227228
import { setupRenderingTest } from 'ember-qunit';

0 commit comments

Comments
 (0)