Skip to content

Commit 62179b7

Browse files
committed
Use mdx-code-block escape hatch for Crowdin
1 parent 9eb0c53 commit 62179b7

File tree

7 files changed

+39
-0
lines changed

7 files changed

+39
-0
lines changed

docs/developing/hardware-back-button.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ For complete hardware back button support, we recommend using Capacitor or Cordo
2727
2828
## Basic Usage
2929

30+
````mdx-code-block
3031
<Tabs
3132
defaultValue="javascript"
3233
values={[
@@ -89,6 +90,7 @@ export default {
8990
```
9091
</TabItem>
9192
</Tabs>
93+
````
9294

9395
In this example, we are registering a handler to be called when the hardware back button is pressed. We have set the priority to be 10, and we have not indicated to the framework that we want the next handler to be called. As a result, any handlers with a priority less than 10 will not be called. A handler that has a priority greater than 10 will be called first.
9496

@@ -98,6 +100,7 @@ In the event that there are handlers with the same priority value, the handler t
98100

99101
Each hardware back button callback has a `processNextHandler` parameter. Calling this function allows you to continue calling hardware back button handlers.
100102

103+
````mdx-code-block
101104
<Tabs
102105
defaultValue="javascript"
103106
values={[
@@ -184,6 +187,7 @@ export default {
184187
```
185188
</TabItem>
186189
</Tabs>
190+
````
187191

188192
This example shows how to indicate to Ionic Framework that you want the next handler to be fired. All callbacks are provided with a `processNextHandler` function as a parameter. Calling this will cause the next handler, if any exists, to be fired.
189193

@@ -216,6 +220,7 @@ In the example above, both handlers A and B have a priority of 10. Since handler
216220

217221
In some scenarios, it may be desirable to quit the app when pressing the hardware back button. This can be achieved through the use of the `ionBackButton` event combined with methods that Capacitor/Cordova provide.
218222

223+
````mdx-code-block
219224
<Tabs
220225
defaultValue="javascript"
221226
values={[
@@ -308,6 +313,7 @@ export default {
308313
```
309314
</TabItem>
310315
</Tabs>
316+
````
311317

312318
This example shows the application exiting when the user presses the hardware back button and there is nothing left in the navigation stack. It is also possible to display a confirmation dialog before quitting the app.
313319

docs/developing/keyboard.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Inputs that _require_ a certain data type should use the `type` attribute instea
1818
For a list of accepted values, see the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode" target="_blank" rel="noreferrer">inputmode Documentation</a>.
1919

2020
### Usage
21+
22+
````mdx-code-block
2123
<Tabs
2224
defaultValue="javascript"
2325
values={[
@@ -84,6 +86,7 @@ For a list of accepted values, see the <a href="https://developer.mozilla.org/en
8486
```
8587
</TabItem>
8688
</Tabs>
89+
````
8790

8891
import Codepen from '@site/src/components/Codepen';
8992

docs/native/community.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Cordova plugins are also wrapped in a `Promise` or `Observable` in order to prov
2626

2727
Using the [Camera plugin](/docs/native/camera) as an example, first install it:
2828

29+
````mdx-code-block
2930
<Tabs
3031
defaultValue="cordova"
3132
values={[
@@ -64,6 +65,7 @@ $ ionic cap sync
6465
6566
</TabItem>
6667
</Tabs>
68+
````
6769

6870
Next, begin using the plugin, following the various framework usage options below. For FAQ, see [here](/docs/native/faq).
6971

docs/reference/migration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ For example, if an app is using Angular, that project structure will be exactly
8080
import Tabs from '@theme/Tabs';
8181
import TabItem from '@theme/TabItem';
8282

83+
````mdx-code-block
8384
<Tabs
8485
defaultValue="v4"
8586
values={[
@@ -146,6 +147,7 @@ tslint.json
146147
147148
</TabItem>
148149
</Tabs>
150+
````
149151

150152
The above comparison is an example of a v4 app's project structure. For developers with experience in a vanilla Angular project, this should feel really familiar.
151153

docs/techniques/security.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Developers can also choose to eject from the sanitizer in certain scenarios. Ion
7272

7373
#### Usage
7474

75+
````mdx-code-block
7576
<Tabs
7677
defaultValue="angular"
7778
values={[
@@ -141,3 +142,4 @@ export const ToastExample: React.FC = () => {
141142
```
142143
</TabItem>
143144
</Tabs>
145+
````

docs/utilities/animations.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Ionic Animations uses the [Web Animations API](https://developer.mozilla.org/en-
1515

1616
## Installation
1717

18+
````mdx-code-block
1819
<Tabs
1920
defaultValue="javascript"
2021
values={[
@@ -123,11 +124,13 @@ const animation = createAnimation()
123124
```
124125
</TabItem>
125126
</Tabs>
127+
````
126128

127129
## Basic Animations
128130

129131
### Usage
130132

133+
````mdx-code-block
131134
<Tabs
132135
defaultValue="javascript"
133136
values={[
@@ -195,6 +198,7 @@ createAnimation()
195198
```
196199
</TabItem>
197200
</Tabs>
201+
````
198202

199203
In the example above, an animation that changes the opacity on the `.square` element and moves it from left to right along the X axis has been created. This animation will run an infinite number of times, and each iteration of the animation will last 1500ms.
200204

@@ -212,6 +216,7 @@ Hyphenated CSS properties should be written using camel case when writing keyfra
212216

213217
### Usage
214218

219+
````mdx-code-block
215220
<Tabs
216221
defaultValue="javascript"
217222
values={[
@@ -289,6 +294,7 @@ createAnimation()
289294
```
290295
</TabItem>
291296
</Tabs>
297+
````
292298

293299
In the example above, the `.square` element will transition from a red background color, to a background color defined by the `--background` variable, and then transition on to a green background color.
294300

@@ -302,6 +308,7 @@ Multiple elements can be animated at the same time and controlled via a single p
302308

303309
### Usage
304310

311+
````mdx-code-block
305312
<Tabs
306313
defaultValue="javascript"
307314
values={[
@@ -495,6 +502,7 @@ const parent = createAnimation()
495502
496503
</TabItem>
497504
</Tabs>
505+
````
498506

499507
This example shows 3 child animations controlled by a single parent animation. Animations `squareA` and `squareB` inherit the parent animation's duration of 2000ms, but animation `squareC` has a duration of 5000ms since it was explicitly set.
500508

@@ -506,6 +514,7 @@ Ionic Animations provides hooks that let you alter an element before an animatio
506514

507515
### Usage
508516

517+
````mdx-code-block
509518
<Tabs
510519
defaultValue="javascript"
511520
values={[
@@ -607,6 +616,7 @@ createAnimation()
607616
```
608617
</TabItem>
609618
</Tabs>
619+
````
610620

611621
In this example, an inline opacity of 0.2 is set on the `.square` element prior to the animation starting. Once the animation finishes, the background color of the element is set to `rgba(0, 255, 0, 0.5)`, and the inline opacity is cleared.
612622

@@ -620,6 +630,7 @@ Animations can be chained to run one after the other. The `play` method returns
620630

621631
### Usage
622632

633+
````mdx-code-block
623634
<Tabs
624635
defaultValue="javascript"
625636
values={[
@@ -820,6 +831,7 @@ await squareC.play();
820831
```
821832
</TabItem>
822833
</Tabs>
834+
````
823835

824836
<Codepen user="ionic" slug="MWgGrwX" height="460"></Codepen>
825837

@@ -829,6 +841,7 @@ Ionic Animations gives developers the ability to create powerful gesture-based a
829841

830842
### Usage
831843

844+
````mdx-code-block
832845
<Tabs
833846
defaultValue="javascript"
834847
values={[
@@ -1137,6 +1150,7 @@ const getStep = (ev): {
11371150
```
11381151
</TabItem>
11391152
</Tabs>
1153+
````
11401154

11411155
In this example we are creating a track along which we can drag the `.square` element. Our `animation` object will take care of moving the `.square` element either left or right, and our `gesture` object will instruct the `animation` object which direction to move in.
11421156

@@ -1166,6 +1180,7 @@ Developers can also tailor their animations to user preferences such as `prefers
11661180
}
11671181
```
11681182

1183+
````mdx-code-block
11691184
<Tabs
11701185
defaultValue="javascript"
11711186
values={[
@@ -1235,6 +1250,7 @@ createAnimation()
12351250
```
12361251
</TabItem>
12371252
</Tabs>
1253+
````
12381254

12391255
This method works in all supported browsers when creating animations for the first time. Most browsers are also capable of dynamically updating keyframe animations as the CSS Variables change.
12401256

@@ -1248,6 +1264,7 @@ Certain Ionic components allow developers to provide custom animations. All anim
12481264

12491265
### Modals
12501266

1267+
````mdx-code-block
12511268
<Tabs
12521269
defaultValue="javascript"
12531270
values={[
@@ -1465,6 +1482,7 @@ export default defineComponent({
14651482
```
14661483
</TabItem>
14671484
</Tabs>
1485+
````
14681486

14691487
<Codepen user="ionic" slug="ExapZBZ"></Codepen>
14701488

docs/utilities/gestures.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Building complex gestures can be time consuming. Other libraries that provide cu
1313

1414
## Installation
1515

16+
````mdx-code-block
1617
<Tabs
1718
defaultValue="javascript"
1819
values={[
@@ -122,12 +123,14 @@ const gesture = createGesture({
122123
```
123124
</TabItem>
124125
</Tabs>
126+
````
125127

126128

127129
## Basic Gestures
128130

129131
### Usage
130132

133+
````mdx-code-block
131134
<Tabs
132135
defaultValue="javascript"
133136
values={[
@@ -251,6 +254,7 @@ const onMove = (detail) => {
251254
```
252255
</TabItem>
253256
</Tabs>
257+
````
254258

255259
In this example, our app listens for gestures on the `.rectangle` element. When a gesture movement is detected, the `onMove` function is called, and our app logs the current gesture information.
256260

@@ -262,6 +266,7 @@ import Codepen from '@site/src/components/Codepen';
262266

263267
### Usage
264268

269+
````mdx-code-block
265270
<Tabs
266271
defaultValue="javascript"
267272
values={[
@@ -424,6 +429,7 @@ const getRandomBackground = () => {
424429
```
425430
</TabItem>
426431
</Tabs>
432+
````
427433

428434
In the example above, we want to be able to detect double clicks on an element. By setting our `threshold` to `0`, we can ensure our gesture object can detect clicks. Additionally, we define a click threshold so that only 2 clicks that occur in quick succession count as a double click.
429435

0 commit comments

Comments
 (0)