apify-docs icon indicating copy to clipboard operation
apify-docs copied to clipboard

Add support for "Run on Apify" button in the Platform docs

Open vdusek opened this issue 2 years ago • 0 comments

Add support for "Run on Apify" button for the code examples (both Javascript and Python) in the Apify platform docs.

look it's quite simple, we just have Actors that can run the code, and they generate a new main script within their main script and it runs right after them, surely something similar could be done in Python

  • https://github.com/apify/example-code-runner/blob/main/example-code-runner-pw/src/main.ts
  • https://github.com/apify/example-code-runner/blob/main/example-code-runner-pw/package.json#L28

Usage:

  • https://github.com/apify/apify-docs/pull/709/files?w=1#diff-17aef22136a4820cfa0097c1235dcce1f4dce7b10ec369a90f326376ed90d67aR8
  • the example code must be in a file that is loaded via our webpack loader

vdusek avatar Sep 22 '23 15:09 vdusek