@@ -2,11 +2,11 @@ import {
22 ActionLink ,
33 BlogArticle ,
44 Button ,
5- CodeBlock ,
65 theme ,
76} from '@apify-packages/ui-library' ;
87import Link from '@docusaurus/Link' ;
98import useBaseUrl from '@docusaurus/useBaseUrl' ;
9+ import CodeBlock from '@theme/CodeBlock' ;
1010import Layout from '@theme/Layout' ;
1111import ThemedImage from '@theme/ThemedImage' ;
1212import React from 'react' ;
@@ -136,8 +136,8 @@ export default function Api() {
136136 </ div > }
137137 >
138138 < ClientCodeWrapper >
139- < CodeBlock content = { [ { key : ' cURL' , label : 'cURL' , language : 'bash' , code : `
140- # Prepare Actor input
139+ < CodeBlock title = " cURL" language = 'bash' >
140+ { ` # Prepare Actor input
141141cat > input.json <<'EOF'
142142{
143143 // Define the input in JSON here
@@ -151,7 +151,9 @@ curl "https://api.apify.com/v2/acts/username~actorname/runs?token=<YOUR_API_TOKE
151151 -H 'Content-Type: application/json'
152152
153153# Use the defaultDatasetId from response and pass it instead of <DATASET_ID>
154- curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<YOUR_API_TOKEN>"` } ] } hideBashPromptPrefixes hideLineNumbers defaultTabKey = "cURL" />
154+ curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<YOUR_API_TOKEN>"`
155+ }
156+ </ CodeBlock >
155157 </ ClientCodeWrapper >
156158 </ SectionWrapper >
157159 < Section
@@ -184,12 +186,13 @@ curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<YOUR_API_TOKEN
184186 </ div > }
185187 >
186188 < ClientCodeWrapper >
187- < CodeBlock content = 'npm install apify-client' language = "bash" />
189+ < CodeBlock language = "bash" >
190+ npm install apify-client
191+ </ CodeBlock >
188192 < CodeBlock
189193 language = 'javascript'
190- hideLineNumbers
191- content = { `
192- // Easily run Actors, await them to finish using the convenient .call() method, and retrieve results from the resulting dataset.
194+ // eslint-disable-next-line max-len
195+ > { `// Easily run Actors, await them to finish using the convenient .call() method, and retrieve results from the resulting dataset.
193196const { ApifyClient } = require('apify-client');
194197
195198const client = new ApifyClient({
@@ -200,8 +203,8 @@ const client = new ApifyClient({
200203const { defaultDatasetId } = await client.actor('john-doe/my-cool-actor').call();
201204
202205// Fetches results from the actor's dataset.
203- const { items } = await client.dataset(defaultDatasetId).listItems();
204- ` } / >
206+ const { items } = await client.dataset(defaultDatasetId).listItems();` }
207+ </ CodeBlock >
205208 </ ClientCodeWrapper >
206209 </ SectionWrapper >
207210 ) ,
@@ -228,22 +231,18 @@ const { items } = await client.dataset(defaultDatasetId).listItems();
228231 </ div > }
229232 >
230233 < ClientCodeWrapper >
231- < CodeBlock content = ' pip install apify-client' language = "bash" / >
234+ < CodeBlock language = "bash" > pip install apify-client</ CodeBlock >
232235 < CodeBlock
233- className = "codeBlock"
234236 language = 'python'
235- hideLineNumbers
236- content = { `
237- from apify_client import ApifyClient
237+ > { `from apify_client import ApifyClient
238238
239239apify_client = ApifyClient('MY-APIFY-TOKEN')
240240
241241# Start an actor and wait for it to finish
242242actor_call = apify_client.actor('john-doe/my-cool-actor').call()
243243
244244# Fetch results from the actor run's default dataset
245- dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items().items
246- ` } /> </ ClientCodeWrapper >
245+ dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items().items` } </ CodeBlock > </ ClientCodeWrapper >
247246 </ SectionWrapper >
248247 ) ,
249248 } ,
0 commit comments