Docusaurus-based documentation site combining multiple content types:
- Platform docs (
sources/platform/) - Product documentation - Academy (
sources/academy/) - Educational courses and tutorials - API reference (
apify-api/) - Generated from OpenAPI specs - Multi-repo architecture - SDK/Client docs from separate repos served via nginx
One unified site built from multiple repositories. See CONTRIBUTING.md for multi-repo setup.
npm install # Install dependencies (runs patch-package via postinstall)
npm start # Dev server (rebuilds API docs, port 3000)
npm run build # Production build (catches broken links, bad frontmatter)
npm run lint # Run all linters (markdownlint + ESLint)
npm run lint:md # Markdownlint only
npm run lint:code # ESLint only
npm run lint:fix # Auto-fix both linters
vale sync # Download Vale styles (first time only)
vale "path/to/file.md" --minAlertLevel=error # Prose style check
npm run api:rebuild # Regenerate API docs from OpenAPI specs
npm run openapi:lint # Validate OpenAPI spec (Redocly + Spectral + YAML)API docs are generated, NOT hand-written. The workflow:
- Source of truth:
apify-api/openapi/openapi.yaml(splits into/pathsand/components) - Redocly plugins (
apify-api/plugins/apify.mjs) inject custom behavior:code-samples-decorator.mjs- Auto-adds code samples if files exist in/code_samples/{js,curl}/legacy-doc-url-decorator.mjs- Adds backward-compatible URLsclient-references-links-decorator.mjs- Links to client library docs
- Build command:
npm run api:rebuild= clean + bundle with Redocly + generate with Docusaurus - Output: Markdown files in
apify-api/docs/(gitignored, regenerated on each build)
Never edit generated API docs directly. Edit the OpenAPI YAML source or add code samples.
Add code samples by creating files in apify-api/openapi/code_samples/{javascript,curl}/:
- Filename must match
operationIdfrom OpenAPI spec (e.g.,actorRun_get.js) - Decorator auto-detects and adds
x-codeSamplesproperty - Missing samples are logged during build
- Prefer re-use of existing objects via
$refover duplication. Reusable components can be found in/openapi/components. - Components most suitable for re-use are:
- Request parameters and path parameters defined in
/openapi/components/parameters - Request/response schemas defined in
/openapi/components/schemas - Explicit non-automatic examples defined in
/openapi/components/examples
- Request parameters and path parameters defined in
- When changing files in
/openapi/pathslook for opportunities to extract shared duplicate objects into re-usable components saved in/openapi/components. - When adding new endpoints, check first if any existing path is similar and if yes, try to re-use same components. If by adding new paths you create new duplication, try to extract it into a new components and reference it instead.
- Prefer automatically generated examples from schema over explicit examples.
- Re-use schemas for error responses defined in
/apify-api/openapi/components/responses - Each endpoint should have at least following error responses: 400 (Bad Request), 405 (Method Not Allowed), 429 (Too Many Requests).
- Endpoints that define
security: []do not use any authentication. - Each endpoint that uses authentication should have at least following error responses: 401 (Unauthorized), 403 (Forbidden).
- Each endpoint that has
runs/lastin its path or that has any ID related parameter (for exampleactorId,buildId,runId,datasetIdand so on) should have at least one 404 (Not Found) error. - Each endpoint that has
requestBodyshould have at least following error responses: 413 (Payload Too Large), 415 (Unsupported Media Type).
Uses @apify/docs-theme package - a shared theme across all 6+ documentation repos. Don't modify theme files directly. Changes to the theme propagate via CI to all projects.
Post-build scripts (scripts/joinLlmsFiles.mjs + indentLlmsFile.mjs) combine llms.txt files from all sections into root. Edit source llms.txt files in content directories, not the generated root one.
tools/utils/collectSlugs.js scans directories for slug: in frontmatter, used in docusaurus.config.js for dynamic navigation with activeBaseRegex. Ensure slugs are collected when adding new sections.
| Repository | Port | Content |
|---|---|---|
| apify-docs (this repo) | 3000 | Platform, Academy, OpenAPI |
| apify-client-js | 3001 | JavaScript client docs |
| apify-client-python | 3002 | Python client docs |
| apify-sdk-js | 3003 | JavaScript SDK docs |
| apify-sdk-python | 3004 | Python SDK docs |
| apify-cli | 3005 | CLI documentation |
Use npm run start:dev + nginx to serve all repos together locally. See CONTRIBUTING.md for setup.
- Auto-deploy on merge to
master - Preview builds on pull requests
- PR titles must use Conventional Commits format (
docs:,fix:,feat:, etc.) - enforced by CI
- Editing generated API docs - Always edit OpenAPI YAML source, never generated markdown in
apify-api/docs/ - Broken links on build -
onBrokenLinks: 'throw'fails CI. Check slugs match file paths - Missing frontmatter - Description or slug errors break SEO and navigation
- Missing code block language - Always specify language for syntax highlighting
- Stale API docs locally - Run
npm run api:rebuildafter changing OpenAPI specs
- Add new doc: Create
.mdinsources/{platform,academy}/, add frontmatter with title/description/slug - Add API endpoint: Edit
apify-api/openapi/paths/**/*.yaml, add code samples, runnpm run api:rebuild - Fix broken build: Check
onBrokenLinkserrors, verify slugs match file paths, validate frontmatter
- US English spelling (analyze, color, not analyse, colour)
- Active voice and imperative tone ("Install the package", not "You should install")
- Simple English - no sentence over 30 words, get to the point
- Inclusive language - avoid gendered terms, don't use directional language (left/right) for UI
- No first person ("I recommend") - use "you" for the reader
- No sales language ("ultimate", "cutting-edge", "supercharge")
- Sentence case only - capitalize first word and proper nouns only
- No gerunds (-ing forms) - use noun phrases or imperatives
- Capitalize after colons when introducing a complete clause
- Proper hierarchy - H1 (from frontmatter) → H2 → H3 → H4, never skip levels
Examples:
| Avoid | Prefer |
|---|---|
| Store And Manage Data | Store and manage data |
| Getting Started With Actors | Get started with Actors |
| Step 1: install the dependencies | Step 1: Install the dependencies |
- Bold for UI elements only (buttons, menus, fields) and critical warnings
- Italics for emphasis and introducing new terms
codefor file names, commands, config keys, variables, and code values- Never use bold for list introductions or general emphasis
All admonitions must have titles (2-3 scannable words). Types: note, tip, info, caution, danger.
:::note Actor versions
Actors can have multiple versions. Pin to a specific version for production use.
:::- Numbered lists (
1.for all items) for sequential steps - Bullet points for non-sequential items
- All items must follow the same grammatical pattern (parallel structure)
- Use Oxford commas
- Descriptive, action-oriented link text (never "click here" or "here")
- Internal links use relative paths, never full URLs
- Link external tools to official sites on first mention
- Link Actor names on first mention
Don't use em dashes (—). Use hyphen with spaces ( - ) instead.
Every .md/.mdx file requires:
---
title: Sentence case title
description: 140-160 character description for SEO
sidebar_position: 1.0
slug: /path/to/page
---- Complete and runnable
- Syntax highlighting specified for all code blocks
- Code tabs for multi-language examples (JavaScript + Python)
- Version matching between Dockerfile tags and package.json
- Meaningful alt text on all images
- Light theme for screenshots
- Red indicators to highlight UI elements
- Store in
images/subdirectory next to the markdown file - PNG for screenshots, SVG for logos
Apify Actor, Apify Proxy, Apify Console, Apify Store, Apify SDK, Apify CLI, Apify API
the Apify platform, the Apify team, the Apify ecosystem
task, schedule, run, build, dataset, key-value store, request queue, web scraping
AI agent, MCP server, API endpoint, web scraper, proxy server
First mention: full name with link ([Website Content Crawler](https://apify.com/apify/website-content-crawler)). Subsequent mentions: just the name.
- Kebab-case for file names:
web-scraping-basics.md - Match slug to file path
- Group related files in logical directories
When creating or reviewing documentation, verify:
- Sentence case headings, no gerunds, proper hierarchy
- Front matter complete (title, description 140-160 chars, sidebar_position, slug)
- Bold used only for UI elements
- All admonitions have titles
- Code examples are complete with syntax highlighting
- Links use descriptive text, internal links use relative paths
- Images have alt text, use light theme
- Terminology matches rules above
- US English, active voice, no sales language
-
npm run lintpasses