Skip to content

Commit b043c74

Browse files
SkyZeroZxAndrewKushnir
authored andcommitted
docs: update code block syntax highlighting in documentation & fixed identation
1 parent 23fbe5c commit b043c74

14 files changed

Lines changed: 48 additions & 52 deletions

File tree

adev/src/content/ecosystem/service-workers/app-shell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For more information about this command, see [App shell command](cli/generate/ap
2626

2727
The command updates the application code and adds extra files to the project structure.
2828

29-
<docs-code language="text">
29+
```text
3030
src
3131
├── app
3232
│ ├── app.config.server.ts # server application configuration
@@ -36,7 +36,7 @@ src
3636
│ ├── app-shell.component.spec.ts
3737
│ └── app-shell.component.ts
3838
└── main.server.ts # main server application bootstrapping
39-
</docs-code>
39+
```
4040

4141
<docs-step title="Verify the application is built with the shell content">
4242

adev/src/content/guide/di/creating-injectable-service.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ Services can depend on other services.
3333
For example, here's a `HeroService` that depends on the `Logger` service, and also uses `BackendService` to get heroes.
3434
That service in turn might depend on the `HttpClient` service to fetch heroes asynchronously from a server:
3535

36-
<docs-code header="hero.service.ts" language="typescript"
37-
highlight="[7,8,12,13]">
36+
```ts {header: "hero.service.ts", highlight="[7,8,12,13]"}
3837
import { inject } from "@angular/core";
3938

4039
export class HeroService {
@@ -51,7 +50,7 @@ this.logger.log(`Fetched ${this.heroes.length} heroes.`);
5150
return this.heroes;
5251
}
5352
}
54-
</docs-code>
53+
```
5554

5655
## Creating an injectable service with the CLI
5756

@@ -61,9 +60,9 @@ To generate a new `HeroService` class in the `src/app/heroes` folder, follow the
6160

6261
1. Run this [Angular CLI](/tools/cli) command:
6362

64-
<docs-code language="sh">
63+
```sh
6564
ng generate service heroes/hero
66-
</docs-code>
65+
```
6766

6867
This command creates the following default `HeroService`:
6968

adev/src/content/guide/forms/signals/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ NOTE: Signal Forms are [experimental](reference/releases#experimental) as of Ang
2222
The best way to understand the differences is to see the same form implemented in all three approaches.
2323

2424
<docs-code-multifile>
25-
<docs-code header="Signal forms" path="adev/src/content/examples/signal-forms/src/comparison/app/signal-forms.ts"/>
25+
<docs-code language="angular-ts" header="Signal forms" path="adev/src/content/examples/signal-forms/src/comparison/app/signal-forms.ts"/>
2626
<docs-code header="Reactive forms" path="adev/src/content/examples/signal-forms/src/comparison/app/reactive-forms.ts"/>
2727
<docs-code header="Template-driven forms" path="adev/src/content/examples/signal-forms/src/comparison/app/template-driven-forms.ts"/>
2828
</docs-code-multifile>

adev/src/content/guide/forms/signals/validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ The `validateHttp()` validation rule:
652652

653653
While async validation runs, the field's `pending()` signal returns `true`. Use this to show loading indicators:
654654

655-
```ts
655+
```angular-html
656656
@if (form.username().pending()) {
657657
<span class="spinner">Checking...</span>
658658
}

adev/src/content/guide/i18n/import-global-variants.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
The [Angular CLI][CliMain] automatically includes locale data if you run the [`ng build`][CliBuild] command with the `--localize` option.
44

5-
<!--todo: replace with docs-code -->
6-
75
```shell
86
ng build --localize
97
```

adev/src/content/guide/i18n/translation-files.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ To create a translation file for a locale or language, complete the following ac
8686
1. Make a copy of the source language file to create a _translation_ file for each language.
8787
1. Rename the _translation_ file to add the locale.
8888

89-
<docs-code language="file">
89+
```file {hideCopy}
9090
9191
messages.xlf --> messages.{locale}.xlf
9292
93-
</docs-code>
93+
```
9494

9595
1. Create a new directory at your project root named `locale`.
9696

97-
<docs-code language="file">
97+
```file {hideCopy}
9898
9999
src/locale
100100
101-
</docs-code>
101+
```
102102

103103
1. Move the _translation_ file to the new directory.
104104
1. Send the _translation_ file to your translator.
@@ -145,7 +145,7 @@ The following actions describe the translation process for French.
145145
1. Translate the other text nodes.
146146
The following example displays the way to translate.
147147

148-
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-other-nodes"/>
148+
<docs-code header="src/locale/messages.fr.xlf (<trans-unit>)" path="adev/src/content/examples/i18n/doc-files/messages.fr.xlf" visibleRegion="translated-other-nodes"/>
149149

150150
IMPORTANT: Don't change the IDs for translation units.
151151
Each `id` attribute is generated by Angular and depends on the content of the component text and the assigned meaning.

adev/src/content/guide/image-optimization.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ imports: [
4242
],
4343
```
4444

45-
</docs-code>
4645
</docs-step>
4746
<docs-step title="(Optional) Set up a Loader">
4847
An image loader is not **required** in order to use NgOptimizedImage, but using one with an image CDN enables powerful performance features, including automatic `srcset`s for your images.

adev/src/content/guide/tailwind.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ Add the `@tailwindcss/postcss` plugin into your PostCSS configuration.
7070

7171
Add an `@import` to `./src/styles.css` that imports Tailwind CSS.
7272

73-
<docs-code language="css" header="src/styles.css">
73+
```css {header: "src/styles.css"}
7474
@import "tailwindcss";
75-
</docs-code>
75+
```
7676

7777
If you're using SCSS, add `@use` to `./src/styles.scss`.
7878

79-
<docs-code language="scss" header="src/styles.scss">
79+
```scss {header: "src/styles.scss"}
8080
@use "tailwindcss";
81-
</docs-code>
81+
```
8282

8383
### 5. Start using Tailwind in your project
8484

adev/src/content/reference/configs/npm-packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ For a complete list of Angular packages, see the [API reference](api).
3939
| [`@angular/cli`](https://github.com/angular/angular-cli) | Contains the Angular CLI binary for running `ng` commands. |
4040
| [`@angular-devkit/build-angular`](https://www.npmjs.com/package/@angular-devkit/build-angular) | Contains default CLI builders for bundling, testing, and serving Angular applications and libraries. |
4141
| [`rxjs`](https://www.npmjs.com/package/rxjs) | A library for reactive programming using `Observables`. |
42-
| [`zone.js`](https://github.com/angular/zone.js) | Angular relies on `zone.js`` to run Angular's change detection processes when native JavaScript operations raise events. |
42+
| [`zone.js`](https://github.com/angular/zone.js) | Angular relies on `zone.js` to run Angular's change detection processes when native JavaScript operations raise events. |
4343
| [`typescript`](https://www.npmjs.com/package/typescript) | The TypeScript compiler, language server, and built-in type definitions. |

adev/src/content/tutorials/signal-forms/steps/2-connect-form-template/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Add the `[field]` directive to the checkbox input:
6363
<docs-step title="Display the form values">
6464
Below the form, there's a debug section to show current form values. Display each field value using `.value()`:
6565

66-
```html
66+
```angular-html
6767
<p>Email: {{ loginForm.email().value() }}</p>
6868
<p>Password: {{ loginForm.password().value() ? '••••••••' : '(empty)' }}</p>
6969
<p>Remember me: {{ loginForm.rememberMe().value() ? 'Yes' : 'No' }}</p>

0 commit comments

Comments
 (0)