@@ -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' ;
@@ -135,9 +135,8 @@ export default function Api() {
135135 </ div >
136136 </ div > }
137137 >
138- < ClientCodeWrapper >
139- < CodeBlock content = { [ { key : 'cURL' , label : 'cURL' , language : 'bash' , code : `
140- # Prepare Actor input
138+ < CodeBlock title = "cURL" language = 'bash' >
139+ { `# Prepare Actor input
141140cat > input.json <<'EOF'
142141{
143142 // Define the input in JSON here
@@ -151,8 +150,9 @@ curl "https://api.apify.com/v2/acts/username~actorname/runs?token=<YOUR_API_TOKE
151150 -H 'Content-Type: application/json'
152151
153152# 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" />
155- </ ClientCodeWrapper >
153+ curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<YOUR_API_TOKEN>"`
154+ }
155+ </ CodeBlock >
156156 </ SectionWrapper >
157157 < Section
158158 headingClassName = { styles . ApiSectionHeading }
@@ -184,12 +184,13 @@ curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<YOUR_API_TOKEN
184184 </ div > }
185185 >
186186 < ClientCodeWrapper >
187- < CodeBlock content = 'npm install apify-client' language = "bash" />
187+ < CodeBlock language = "bash" >
188+ npm install apify-client
189+ </ CodeBlock >
188190 < CodeBlock
189191 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.
192+ // eslint-disable-next-line max-len
193+ > { `// Easily run Actors, await them to finish using the convenient .call() method, and retrieve results from the resulting dataset.
193194const { ApifyClient } = require('apify-client');
194195
195196const client = new ApifyClient({
@@ -200,8 +201,8 @@ const client = new ApifyClient({
200201const { defaultDatasetId } = await client.actor('john-doe/my-cool-actor').call();
201202
202203// Fetches results from the actor's dataset.
203- const { items } = await client.dataset(defaultDatasetId).listItems();
204- ` } / >
204+ const { items } = await client.dataset(defaultDatasetId).listItems();` }
205+ </ CodeBlock >
205206 </ ClientCodeWrapper >
206207 </ SectionWrapper >
207208 ) ,
@@ -228,22 +229,18 @@ const { items } = await client.dataset(defaultDatasetId).listItems();
228229 </ div > }
229230 >
230231 < ClientCodeWrapper >
231- < CodeBlock content = ' pip install apify-client' language = "bash" / >
232+ < CodeBlock language = "bash" > pip install apify-client</ CodeBlock >
232233 < CodeBlock
233- className = "codeBlock"
234234 language = 'python'
235- hideLineNumbers
236- content = { `
237- from apify_client import ApifyClient
235+ > { `from apify_client import ApifyClient
238236
239237apify_client = ApifyClient('MY-APIFY-TOKEN')
240238
241239# Start an actor and wait for it to finish
242240actor_call = apify_client.actor('john-doe/my-cool-actor').call()
243241
244242# Fetch results from the actor run's default dataset
245- dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items().items
246- ` } /> </ ClientCodeWrapper >
243+ dataset_items = apify_client.dataset(actor_call['defaultDatasetId']).list_items().items` } </ CodeBlock > </ ClientCodeWrapper >
247244 </ SectionWrapper >
248245 ) ,
249246 } ,
0 commit comments