Skip to content

Commit

Permalink
refactor: Move Prism to the server (#1204)
Browse files Browse the repository at this point in the history
* refactor: Use `language-` as everywhere for codeblocks

* refactor: Incorrect `node` code block annotation

* refactor: Replace use of `lanaguage-sh` for `language-bash`

* refactor: Move Prism to the server
  • Loading branch information
rschristian authored Dec 7, 2024
1 parent 550fcde commit 287ce5c
Show file tree
Hide file tree
Showing 52 changed files with 220 additions and 227 deletions.
6 changes: 3 additions & 3 deletions content/de/guide/v8/switching-to-preact.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Das ermöglicht es einem, mit dem Schreiben von React/ReactDOM-Code fortzufahren
Der Installationsprozess ist in zwei Schritte unterteilt.
Zuerst muss man `preact` und `preact-compat`, zwei separate Pakete, installieren:

```sh
```bash
npm i -S preact preact-compat
```

Expand Down Expand Up @@ -89,7 +89,7 @@ Dieser Ansatz wird im nächsten Abschnitt erläutert.

Beachtet man Small Screen Rendering-Funktionalitäten, kann man das [module-alias](https://npmjs.com/package/module-alias)-Paket zum Ersetzen von React mit Preact verwenden, sollte man keinen Bundler (wie z.B. Webpack) für den Build-Prozess des serverseitigen Codes verwenden.

```sh
```bash
npm i -S module-alias
```

Expand Down Expand Up @@ -150,7 +150,7 @@ Generell involviert der Prozess des Wechselns zu Preact einige Schritte:

Dieser Schritt ist vermutlich der Einfachste: man muss die Bibliothek lediglich installieren, um sie verwenden zu können!

```sh
```bash
npm install --save preact # or: npm i -S preact
```

Expand Down
2 changes: 1 addition & 1 deletion content/de/guide/v8/unit-testing-with-enzyme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Wir benötigen zwei Module:
- `preact-compat-enzyme`: Um weitere interne React-Properties bereitzustellen.
- `preact-test-utils`: Um Teile der `react-addons-test-utils`-API, die von `enzyme` genutzt werden, bereitzustellen.

```sh
```bash
npm install --save-dev preact-compat-enzyme preact-test-utils
```

Expand Down
8 changes: 4 additions & 4 deletions content/de/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function Counter() {
<section class="home-split">
<div>
<h3>To Do-Listen-Komponente</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class TodoList extends Component {
state = { todos: [], text: '' };
Expand Down Expand Up @@ -173,7 +173,7 @@ render(&lt;TodoList /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Laufendes Beispiel</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import ToDoList from './todo-list';<br>
render(&lt;ToDoList /&gt;, document.body);
</code></pre>
Expand All @@ -187,7 +187,7 @@ render(&lt;ToDoList /&gt;, document.body);
<section class="home-split">
<div>
<h3>Zeige GitHub-Stars</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class Stars extends Component {
async componentDidMount() {
Expand All @@ -209,7 +209,7 @@ render(&lt;Stars repo="preactjs/preact" /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Laufendes Beispiel</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import Stars from './stars';<br>
render(
&lt;Stars repo="developit/preact" /&gt;,
Expand Down
2 changes: 1 addition & 1 deletion content/en/guide/v10/preact-testing-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Unlike [Enzyme](/guide/v10/unit-testing-with-enzyme), Preact Testing Library mus

Install the testing-library Preact adapter via the following command:

```sh
```bash
npm install --save-dev @testing-library/preact
```

Expand Down
2 changes: 1 addition & 1 deletion content/en/guide/v10/server-side-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Server-Side Rendering (often abbreviated as "SSR") allows you to render your app

The server-side renderer for Preact lives in its [own repository](https://github.com/preactjs/preact-render-to-string/) and can be installed via your packager of choice:

```sh
```bash
npm install -S preact-render-to-string
```

Expand Down
2 changes: 1 addition & 1 deletion content/en/guide/v10/signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ render(<Counter />, document.getElementById("app"));

Signals can be installed by adding the `@preact/signals` package to your project:

```sh
```bash
npm install @preact/signals
```

Expand Down
2 changes: 1 addition & 1 deletion content/en/guide/v10/unit-testing-with-enzyme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Preact differs from Enzyme with React.

Install Enzyme and the Preact adapter using:

```sh
```bash
npm install --save-dev enzyme enzyme-adapter-preact-pure
```

Expand Down
6 changes: 3 additions & 3 deletions content/en/guide/v8/switching-to-preact.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ all the necessary tweaks on top of Preact's core to make it work just like `reac
The process for installation is two steps.
First, you must install preact and preact-compat (they are separate packages):

```sh
```bash
npm i -S preact preact-compat
```

Expand Down Expand Up @@ -107,7 +107,7 @@ That approach is covered in the next section.

For SSR purposes, if you are not using a bundler like webpack to build your server side code, you can use the [module-alias](https://www.npmjs.com/package/module-alias) package to replace react with preact.

```sh
```bash
npm i -S module-alias
```

Expand Down Expand Up @@ -168,7 +168,7 @@ Generally, the process of switching to Preact involves a few steps:

This one is simple: you'll need to install the library in order to use it!

```sh
```bash
npm install --save preact # or: npm i -S preact
```

Expand Down
2 changes: 1 addition & 1 deletion content/en/guide/v8/unit-testing-with-enzyme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Preact differs from Enzyme with React.

Install Enzyme and the Preact adapter using:

```sh
```bash
npm install --save-dev enzyme enzyme-adapter-preact-pure
```

Expand Down
8 changes: 4 additions & 4 deletions content/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function Counter() {
<section class="home-split">
<div>
<h3>Todo List</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class TodoList extends Component {
state = { todos: [], text: '' };
Expand Down Expand Up @@ -170,7 +170,7 @@ render(&lt;TodoList /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Running Example</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import TodoList from './todo-list';<br>
render(&lt;TodoList /&gt;, document.body);
</code></pre>
Expand All @@ -183,7 +183,7 @@ render(&lt;TodoList /&gt;, document.body);
<section class="home-split">
<div>
<h3>Fetch GitHub Stars</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class Stars extends Component {
async componentDidMount() {
Expand All @@ -205,7 +205,7 @@ render(&lt;Stars repo="preactjs/preact" /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Running Example</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import Stars from './stars';<br>
render(
&lt;Stars repo="preactjs/preact" /&gt;,
Expand Down
8 changes: 4 additions & 4 deletions content/es/guide/v10/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ El proyecto `preact-cli` es una solución preparada para agrupar aplicaciones Pr

Como su nombre lo indica, `preact-cli` es una herramienta de línea de comandos que se puede ejecutar en el terminal de su máquina. Instálelo globalmente ejecutando:

```node
```bash
npm install -g preact-cli
```

Después de eso, tendrá un nuevo comando en su terminal llamado `preact`. Con él puedes crear una nueva aplicación ejecutando el siguiente comando:

```node
```bash
preact create default my-project
```

Expand All @@ -90,7 +90,7 @@ El comando anterior extrae la plantilla de `preactjs-templates/default`, solicit

Ahora estamos listos para comenzar nuestra aplicación. Para iniciar el servidor de desarrollo, ejecute el siguiente comando dentro de la carpeta del proyecto recién generado (`my-project` en este ejemplo):

```node
```bash
# Go into the generated project folder
cd my-project/

Expand All @@ -105,7 +105,7 @@ Una vez que el servidor está activo, puede acceder a su aplicación en la URL q

Llega un momento en que debe implementar su aplicación en algún lugar. La CLI entrega un práctico comando `build` que generará una compilación altamente optimizada para su ambiente de producción.

```node
```bash
npm run build
```

Expand Down
4 changes: 2 additions & 2 deletions content/es/guide/v8/switching-to-preact.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Esto te permite continuar escribiendo código de React/ReactDOM sin hacer cambio
El proceso de instalación consta de dos pasos.
Primero, tienes que instalar preact y preact-compat (son paquetes separados):

```sh
```bash
npm i -S preact preact-compat
```

Expand Down Expand Up @@ -106,7 +106,7 @@ En general, este proceso de cambiar a Preact envuelve unos pocos pasos:

Este es simple: Tienes que instalar la librería para poder usarla!

```sh
```bash
npm install --save preact # ó: npm i -S preact
```

Expand Down
2 changes: 1 addition & 1 deletion content/es/guide/v8/unit-testing-with-enzyme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Necesitamos dos módulos:
- `Preact-compat-enzyme`: Para proporcionar propiedades internas adicionales de `React`.
- `Preact-test-utils`: Para proporcionar partes de la API del `react-addons-test-utils` usadas por el `enzyme`.

```sh
```bash
npm install --save-dev preact-compat-enzyme preact-test-utils
```

Expand Down
8 changes: 4 additions & 4 deletions content/es/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Counter() {
<section class="home-split">
<div>
<h3>Componente de Todo List</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class TodoList extends Component {
state = { todos: [], text: '' };
Expand Down Expand Up @@ -179,7 +179,7 @@ render(&lt;TodoList /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Ejemplo corriendo</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import TodoList from './todo-list';<br>
render(&lt;TodoList /&gt;, document.body);
</code></pre>
Expand All @@ -193,7 +193,7 @@ render(&lt;TodoList /&gt;, document.body);
<section class="home-split">
<div>
<h3>Buscando las estrellas de Github</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class Stars extends Component {
async componentDidMount() {
Expand All @@ -215,7 +215,7 @@ render(&lt;Stars repo="preactjs/preact" /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Ejemplo corriendo</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import Stars from './stars';<br>
render(
&lt;Stars repo="developit/preact" /&gt;,
Expand Down
6 changes: 3 additions & 3 deletions content/fr/guide/v8/switching-to-preact.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Cela vous permet de continuer à écrire du code pour React/ReactDOM sans aucun
Le processus d'installation comprend deux étapes :
Premièrement, vous devez installer preact et preact-compat (ce sont deux packages séparés) :

```sh
```bash
npm i -S preact preact-compat
```

Expand Down Expand Up @@ -85,7 +85,7 @@ Cette approche est couverte dans la prochaine section.

Pour des raison de rendu côté serveur, si vous n'utilisez pas un bundler comme webpack pour construire votre code côté serveur, vous pouvez utiliser le package [module-alias](https://www.npmjs.com/package/module-alias) pour remplacer react par preact.

```sh
```bash
npm i -S module-alias
```

Expand Down Expand Up @@ -145,7 +145,7 @@ Généralement, le processus pour passer à Preact comporte quelques étapes :

Cette étape est simple : vous allez devoir installer la bibliothèque avant de pouvoir l'utiliser !

```sh
```bash
npm install --save preact # ou : npm i -S preact
```

Expand Down
2 changes: 1 addition & 1 deletion content/fr/guide/v8/unit-testing-with-enzyme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Nous avons besoin de deux modules :
- `preact-compat-enzyme`: pour fournir les propriétés internes de React aditionnelles
- `preact-test-utils`: pour fournir les parties de l'API de `react-addons-test-utils` utilisées par `enzyme`

```sh
```bash
npm install --save-dev preact-compat-enzyme preact-test-utils
```

Expand Down
8 changes: 4 additions & 4 deletions content/fr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function Counter() {
<section class="home-split">
<div>
<h3>Composant liste de tâches</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class TodoList extends Component {
state = { todos: [], text: '' };
Expand Down Expand Up @@ -172,7 +172,7 @@ render(&lt;TodoList /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Exemple interactif</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import TodoList from './todo-list';<br>
render(&lt;TodoList /&gt;, document.body);
</code></pre>
Expand All @@ -186,7 +186,7 @@ render(&lt;TodoList /&gt;, document.body);
<section class="home-split">
<div>
<h3>Récupérer les Stars Github</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class Stars extends Component {
async componentDidMount() {
Expand All @@ -208,7 +208,7 @@ render(&lt;Stars repo="preactjs/preact" /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Exemple fonctionnel</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import Stars from './stars';<br>
render(
&lt;Stars repo="developit/preact" /&gt;,
Expand Down
8 changes: 4 additions & 4 deletions content/it/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Counter() {
<section class="home-split">
<div>
<h3>Componente Lista delle attività</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class TodoList extends Component {
state = { todos: [], text: '' };
Expand Down Expand Up @@ -179,7 +179,7 @@ render(&lt;TodoList /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Esempio in esecuzione</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import TodoList from './todo-list';<br>
render(&lt;TodoList /&gt;, document.body);
</code></pre>
Expand All @@ -193,7 +193,7 @@ render(&lt;TodoList /&gt;, document.body);
<section class="home-split">
<div>
<h3>Visualizzare le stelle su GitHub</h3>
<pre><code class="lang-jsx">
<pre><code class="language-jsx">
// --repl
export default class Stars extends Component {
async componentDidMount() {
Expand All @@ -215,7 +215,7 @@ render(&lt;Stars repo="preactjs/preact" /&gt;, document.getElementById("app"));
</div>
<div>
<h3>Esempio in esecuzione</h3>
<pre repl="false"><code class="lang-jsx">
<pre repl="false"><code class="language-jsx">
import Stars from './stars';<br>
render(
&lt;Stars repo="developit/preact" /&gt;,
Expand Down
2 changes: 1 addition & 1 deletion content/ja/guide/v10/preact-testing-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ description: 'Testing Libraryを使用してPreactアプリケーションのテ

以下のコマンドでtesting-libraryのPreact用のアダプタをインストールします。

```sh
```bash
npm install --save-dev @testing-library/preact
```

Expand Down
Loading

0 comments on commit 287ce5c

Please sign in to comment.