Skip to content

Commit 0513fbc

Browse files
hawkgspkozlowski-opensource
authored andcommitted
docs: set syntax highlighting of code examples MD code blocks (#59026)
Set the syntax highlighting based on the code examples' language. PR Close #59026
1 parent dc7d555 commit 0513fbc

File tree

140 files changed

+397
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+397
-400
lines changed

packages/animations/browser/src/dsl/animation_timeline_builder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ const LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
5757
*
5858
* The code below will be converted from:
5959
*
60-
* ```
60+
* ```ts
6161
* sequence([
6262
* style({ opacity: 0 }),
6363
* animate(1000, style({ opacity: 0 }))
6464
* ])
6565
* ```
6666
*
6767
* To:
68-
* ```
68+
* ```ts
6969
* keyframes = [{ opacity: 0, offset: 0 }, { opacity: 1, offset: 1 }]
7070
* duration = 1000
7171
* delay = 0
@@ -104,7 +104,7 @@ const LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
104104
* Each timeline has a `backFill` property which is responsible for filling in new styles into
105105
* already processed keyframes if a new style shows up later within the animation sequence.
106106
*
107-
* ```
107+
* ```ts
108108
* sequence([
109109
* style({ width: 0 }),
110110
* animate(1000, style({ width: 100 })),

packages/animations/src/animation_event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* An instance of this class is returned as an event parameter when an animation
1111
* callback is captured for an animation either during the start or done phase.
1212
*
13-
* ```typescript
13+
* ```ts
1414
* @Component({
1515
* host: {
1616
* '[@myAnimationTrigger]': 'someExpression',

packages/animations/src/animation_metadata.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
488488
* The provided animation value is expected to be an array consisting of state and
489489
* transition declarations.
490490
*
491-
* ```typescript
491+
* ```ts
492492
* @Component({
493493
* selector: "my-component",
494494
* templateUrl: "my-component-tpl.html",
@@ -518,7 +518,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
518518
* The `transition` animation method also supports reading an inline function which can decide
519519
* if its associated animation should be run.
520520
*
521-
* ```typescript
521+
* ```ts
522522
* // this method is run each time the `myAnimationTrigger` trigger value changes.
523523
* function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key:
524524
string]: any}): boolean {
@@ -551,7 +551,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
551551
*
552552
* The following example shows how to use this feature:
553553
*
554-
* ```typescript
554+
* ```angular-ts
555555
* @Component({
556556
* selector: 'my-component',
557557
* template: `
@@ -580,7 +580,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
580580
* This means that you can disable all animations for an app
581581
* by placing a host binding set on `@.disabled` on the topmost Angular component.
582582
*
583-
* ```typescript
583+
* ```ts
584584
* import {Component, HostBinding} from '@angular/core';
585585
*
586586
* @Component({
@@ -654,12 +654,12 @@ export function trigger(name: string, definitions: AnimationMetadata[]): Animati
654654
* **Style examples**
655655
*
656656
* The following example calls `style()` to set a single CSS style.
657-
* ```typescript
657+
* ```ts
658658
* animate(500, style({ background: "red" }))
659659
* ```
660660
* The following example calls `keyframes()` to set a CSS style
661661
* to different values for successive keyframes.
662-
* ```typescript
662+
* ```ts
663663
* animate(500, keyframes(
664664
* [
665665
* style({ background: "blue" }),
@@ -686,7 +686,7 @@ export function animate(
686686
* `keyframes()`, or use `animate()` calls with a delay value.
687687
* For example:
688688
*
689-
* ```typescript
689+
* ```ts
690690
* group([
691691
* animate("1s", style({ background: "black" })),
692692
* animate("2s", style({ color: "white" }))
@@ -724,7 +724,7 @@ export function group(
724724
* - Steps defined by `animate()` calls apply the styling data over time
725725
* as specified by the timing data.
726726
*
727-
* ```typescript
727+
* ```ts
728728
* sequence([
729729
* style({ opacity: 0 }),
730730
* animate("1s", style({ opacity: 1 }))
@@ -777,7 +777,7 @@ export function sequence(
777777
* The following examples create animation styles that collect a set of
778778
* CSS property values:
779779
*
780-
* ```typescript
780+
* ```ts
781781
* // string values for CSS properties
782782
* style({ background: "red", color: "blue" })
783783
*
@@ -788,7 +788,7 @@ export function sequence(
788788
* The following example uses auto-styling to allow an element to animate from
789789
* a height of 0 up to its full height:
790790
*
791-
* ```
791+
* ```ts
792792
* style({ height: 0 }),
793793
* animate("1s", style({ height: "*" }))
794794
* ```
@@ -859,7 +859,7 @@ export function state(
859859
* when each `backgroundColor` value is applied. The color is red at the start, and changes to
860860
* blue when 20% of the total time has elapsed.
861861
*
862-
* ```typescript
862+
* ```ts
863863
* // the provided offset values
864864
* animate("5s", keyframes([
865865
* style({ backgroundColor: "red", offset: 0 }),
@@ -872,7 +872,7 @@ export function state(
872872
* If there are no `offset` values specified in the style entries, the offsets
873873
* are calculated automatically.
874874
*
875-
* ```typescript
875+
* ```ts
876876
* animate("5s", keyframes([
877877
* style({ backgroundColor: "red" }) // offset = 0
878878
* style({ backgroundColor: "blue" }) // offset = 0.33
@@ -915,23 +915,23 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
915915
* expression bound to the trigger's element goes from `fromState` to `toState`
916916
*
917917
* _Example:_
918-
* ```typescript
918+
* ```ts
919919
* transition('open => closed', animate('.5s ease-out', style({ height: 0 }) ))
920920
* ```
921921
*
922922
* - `fromState <=> toState`, which indicates that the transition's animations should occur then
923923
* the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa
924924
*
925925
* _Example:_
926-
* ```typescript
926+
* ```ts
927927
* transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)'))
928928
* ```
929929
*
930930
* - `:enter`/`:leave`, which indicates that the transition's animations should occur when the
931931
* element enters or exists the DOM
932932
*
933933
* _Example:_
934-
* ```typescript
934+
* ```ts
935935
* transition(':enter', [
936936
* style({ opacity: 0 }),
937937
* animate('500ms', style({ opacity: 1 }))
@@ -942,15 +942,15 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
942942
* the numerical expression bound to the trigger's element has increased in value or decreased
943943
*
944944
* _Example:_
945-
* ```typescript
945+
* ```ts
946946
* transition(':increment', query('@counter', animateChild()))
947947
* ```
948948
*
949949
* - a sequence of any of the above divided by commas, which indicates that transition's animations
950950
* should occur whenever one of the state change expressions matches
951951
*
952952
* _Example:_
953-
* ```typescript
953+
* ```ts
954954
* transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([
955955
* style({ transform: 'scale(1)', offset: 0}),
956956
* style({ transform: 'scale(1.1)', offset: 0.7}),
@@ -999,7 +999,7 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
999999
* </div>
10001000
* ```
10011001
*
1002-
* ```typescript
1002+
* ```ts
10031003
* trigger("myAnimationTrigger", [
10041004
* ..., // states
10051005
* transition("on => off, open => closed", animate(500)),
@@ -1019,7 +1019,7 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
10191019
* </div>
10201020
* ```
10211021
*
1022-
* ```typescript
1022+
* ```ts
10231023
* trigger("myAnimationTrigger", [
10241024
* ..., // states
10251025
* transition(
@@ -1065,7 +1065,7 @@ export function transition(
10651065
* The following example defines a reusable animation, providing some default parameter
10661066
* values.
10671067
*
1068-
* ```typescript
1068+
* ```ts
10691069
* var fadeAnimation = animation([
10701070
* style({ opacity: '{{ start }}' }),
10711071
* animate('{{ time }}',
@@ -1168,7 +1168,7 @@ export function useAnimation(
11681168
*
11691169
* Tokens can be merged into a combined query selector string. For example:
11701170
*
1171-
* ```typescript
1171+
* ```ts
11721172
* query(':self, .record:enter, .record:leave, @subTrigger', [...])
11731173
* ```
11741174
*
@@ -1226,7 +1226,7 @@ export function useAnimation(
12261226
* The following example queries for inner elements and animates them
12271227
* individually using `animate()`.
12281228
*
1229-
* ```typescript
1229+
* ```angular-ts
12301230
* @Component({
12311231
* selector: 'inner',
12321232
* template: `
@@ -1301,7 +1301,7 @@ export function query(
13011301
*
13021302
* Here is the component code:
13031303
*
1304-
* ```typescript
1304+
* ```ts
13051305
* import {trigger, transition, style, animate, query, stagger} from '@angular/animations';
13061306
* @Component({
13071307
* templateUrl: 'list.component.html',
@@ -1330,7 +1330,7 @@ export function query(
13301330
*
13311331
* Here is the animation trigger code:
13321332
*
1333-
* ```typescript
1333+
* ```ts
13341334
* trigger('listAnimation', [
13351335
* transition('* => *', [ // each time the binding value changes
13361336
* query(':leave', [

packages/common/http/src/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function addBody<T>(
7171
*
7272
* ### HTTP Request Example
7373
*
74-
* ```
74+
* ```ts
7575
* // GET heroes whose name contains search term
7676
* searchHeroes(term: string): observable<Hero[]>{
7777
*
@@ -82,20 +82,20 @@ function addBody<T>(
8282
*
8383
* Alternatively, the parameter string can be used without invoking HttpParams
8484
* by directly joining to the URL.
85-
* ```
85+
* ```ts
8686
* this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'});
8787
* ```
8888
*
8989
*
9090
* ### JSONP Example
91-
* ```
91+
* ```ts
9292
* requestJsonp(url, callback = 'callback') {
9393
* return this.httpClient.jsonp(this.heroesURL, callback);
9494
* }
9595
* ```
9696
*
9797
* ### PATCH Example
98-
* ```
98+
* ```ts
9999
* // PATCH one of the heroes' name
100100
* patchHero (id: number, heroName: string): Observable<{}> {
101101
* const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42

packages/common/http/src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class HttpContextToken<T> {
2525
*
2626
* ### Usage Example
2727
*
28-
* ```typescript
28+
* ```ts
2929
* // inside cache.interceptors.ts
3030
* export const IS_CACHE_ENABLED = new HttpContextToken<boolean>(() => false);
3131
*

packages/common/http/src/interceptor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<
107107
*
108108
* @usageNotes
109109
* Here is a noop interceptor that passes the request through without modifying it:
110-
* ```typescript
110+
* ```ts
111111
* export const noopInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next:
112112
* HttpHandlerFn) => {
113113
* return next(modifiedReq);
@@ -118,7 +118,7 @@ export type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<
118118
* `next()` handler function.
119119
*
120120
* Here is a basic interceptor that adds a bearer token to the headers
121-
* ```typescript
121+
* ```ts
122122
* export const authenticationInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next:
123123
* HttpHandlerFn) => {
124124
* const userToken = 'MY_TOKEN'; const modifiedReq = req.clone({

packages/common/http/src/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function makeHttpFeature<KindT extends HttpFeatureKind>(
8989
* Server-Side Rendering for better performance and compatibility. To enable `fetch`, add
9090
* `withFetch()` feature to the `provideHttpClient()` call at the root of the application:
9191
*
92-
* ```
92+
* ```ts
9393
* provideHttpClient(withFetch());
9494
* ```
9595
*

packages/common/http/src/transfer_cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export type HttpTransferCacheOptions = {
6868
*
6969
* When the same API endpoint is accessed via `http://internal-domain.com:8080` on the server and
7070
* via `https://external-domain.com` on the client, you can use the following configuration:
71-
* ```typescript
71+
* ```ts
7272
* // in app.server.config.ts
7373
* {
7474
* provide: HTTP_TRANSFER_CACHE_ORIGIN_MAP,

packages/common/src/directives/ng_class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface CssClassState {
4242
* @ngModule CommonModule
4343
*
4444
* @usageNotes
45-
* ```
45+
* ```html
4646
* <some-element [ngClass]="'first second'">...</some-element>
4747
*
4848
* <some-element [ngClass]="['first', 'second']">...</some-element>

packages/common/src/directives/ng_component_outlet.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,27 @@ import {
5454
* ### Syntax
5555
*
5656
* Simple
57-
* ```
57+
* ```html
5858
* <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
5959
* ```
6060
*
6161
* With inputs
62-
* ```
62+
* ```html
6363
* <ng-container *ngComponentOutlet="componentTypeExpression;
6464
* inputs: inputsExpression;">
6565
* </ng-container>
6666
* ```
6767
*
6868
* Customized injector/content
69-
* ```
69+
* ```html
7070
* <ng-container *ngComponentOutlet="componentTypeExpression;
7171
* injector: injectorExpression;
7272
* content: contentNodesExpression;">
7373
* </ng-container>
7474
* ```
7575
*
7676
* Customized NgModule reference
77-
* ```
77+
* ```html
7878
* <ng-container *ngComponentOutlet="componentTypeExpression;
7979
* ngModule: ngModuleClass;">
8080
* </ng-container>

0 commit comments

Comments
 (0)