Skip to content

Commit bbdb8a9

Browse files
committed
style added to pre and code tag
1 parent ebb5c26 commit bbdb8a9

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

_posts/2024-11-10-integrating-ai-and-machine-learning-into-react-native-apps.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ Ensure your React Native project is properly configured with the latest version
4747

4848
bash
4949

50+
```
51+
npx react-native init MyApp
5052
53+
cd MyApp
5154
52-
`npx react-native init MyApp
53-
cd MyApp`
55+
```
5456

5557
### 3. **Install Required Libraries**
5658

@@ -60,27 +62,32 @@ Depending on your use case, install the necessary AI/ML libraries. For example:
6062

6163
bash
6264

65+
```
66+
npm install @tensorflow/tfjs @tensorflow-models/mobilenet
6367
64-
`npm install @tensorflow/tfjs @tensorflow-models/mobilenet`
65-
68+
```
6669
- To integrate Google ML Kit:
6770
6871
bash
6972
7073
74+
```
75+
npm install
7176
72-
`npm install react-native-ml-kit`
77+
react-native-ml-kit
7378
79+
```
7480
7581
4. **Load and Use AI Models**
7682
7783
Here's a sample implementation of image recognition using TensorFlow.js:
7884
7985
javascript
8086
87+
```
8188

8289

83-
`import * as tf from '@tensorflow/tfjs';
90+
import * as tf from '@tensorflow/tfjs';
8491

8592
import * as mobilenet from '@tensorflow-models/mobilenet';
8693

@@ -127,7 +134,9 @@ classifyImage('image-uri-here')} />
127134
);
128135
};
129136

130-
export default App;`
137+
export default App;
138+
139+
```
131140
132141
### 5. **Test the Integration**
133142
@@ -137,9 +146,12 @@ bash
137146
138147
139148
140-
`npx react-native run-android
141-
or
142-
npx react-native run-ios`
149+
```
150+
npx react-native run-android
151+
or
152+
npx react-native run-ios
153+
154+
```
143155
144156
Ensure the AI features work seamlessly across both platforms.
145157

css/syntax.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,22 @@
207207
.highlight {
208208
background-color: #f8f8f8;
209209
}
210+
211+
212+
pre, code {
213+
background-color: #272822;
214+
color: #f8f8f2;
215+
padding: 10px;
216+
border-radius: 5px;
217+
font-family: 'Courier New', Courier, monospace;
218+
overflow-x: auto;
219+
}
220+
221+
code {
222+
padding: 2px 4px;
223+
}
224+
225+
pre code {
226+
display: block;
227+
padding: 0;
228+
}

0 commit comments

Comments
 (0)