Skip to content

Commit e7710e7

Browse files
patrikbraborecfnesveda
authored andcommitted
docs: Add copy for LLMs and view as markdown buttons (apify#1803)
Co-authored-by: František Nesveda <[email protected]>
1 parent 8d5fde6 commit e7710e7

File tree

21 files changed

+332
-17
lines changed

21 files changed

+332
-17
lines changed

apify-docs-theme/src/theme/MDXComponents/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import LLMButtons from '@site/src/components/LLMButtons';
12
import Admonition from '@theme/Admonition';
23
import MDXA from '@theme/MDXComponents/A';
34
import MDXCode from '@theme/MDXComponents/Code';
@@ -29,5 +30,6 @@ const MDXComponents = {
2930
admonition: Admonition,
3031
mermaid: Mermaid,
3132
RunnableCodeBlock,
33+
LLMButtons,
3234
};
3335
export default MDXComponents;

docusaurus.config.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
const { join, resolve } = require('node:path');
22

33
const clsx = require('clsx');
4-
const { createApiPageMD } = require('docusaurus-plugin-openapi-docs/lib/markdown');
4+
const { createApiPageMD, createInfoPageMD } = require('docusaurus-plugin-openapi-docs/lib/markdown');
55

66
const { config } = require('./apify-docs-theme');
77
const { collectSlugs } = require('./tools/utils/collectSlugs');
88
const { externalLinkProcessor } = require('./tools/utils/externalLink');
9+
const { removeLlmButtons } = require('./tools/utils/removeLlmButtons');
910

1011
/** @type {Partial<import('@docusaurus/types').DocusaurusConfig>} */
1112
module.exports = {
@@ -196,6 +197,21 @@ module.exports = {
196197
md = md.replace('--&gt;', '-->');
197198
}
198199

200+
// Find the first Heading h1 and add LLMButtons after it
201+
// eslint-disable-next-line max-len
202+
const headingRegex = /(<Heading[^>]*as=\{"h1"\}[^>]*className=\{"openapi__heading"\}[^>]*children=\{[^}]*\}[^>]*>\s*<\/Heading>)/;
203+
md = md.replace(headingRegex, '$1\n\n<LLMButtons />\n');
204+
205+
return md;
206+
},
207+
createInfoPageMD: (pageData) => {
208+
let md = createInfoPageMD(pageData);
209+
210+
// Find the first Heading h1 and add LLMButtons after it
211+
// eslint-disable-next-line max-len
212+
const headingRegex = /(<Heading[^>]*as=\{"h1"\}[^>]*className=\{"openapi__heading"\}[^>]*children=\{[^}]*\}[^>]*>\s*<\/Heading>)/;
213+
md = md.replace(headingRegex, '$1\n\n<LLMButtons />\n');
214+
199215
return md;
200216
},
201217
},
@@ -293,6 +309,8 @@ module.exports = {
293309
categoryName: 'Platform documentation',
294310
},
295311
],
312+
// Add custom remark processing to remove LLM button text
313+
remarkPlugins: [removeLlmButtons],
296314
},
297315
},
298316
],

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sources/legal/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ slug: /
77
hide_table_of_contents: true
88
---
99

10-
# Apify Legal
1110
<!-- vale off -->
1211

1312
## Company details (Impressum)

sources/platform/actors/running/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ sidebar_position: 7.1
55
slug: /actors/running
66
---
77

8-
# Running Actors
9-
108
**In this section, you learn how to run Apify Actors using Apify Console or programmatically. You will learn about their configuration, versioning, data retention, usage, and pricing.**
119

1210
import Tabs from '@theme/Tabs';

sources/platform/index.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
2-
title: Home
2+
title: Apify platform
33
description: Apify is your one-stop shop for web scraping, data extraction, and RPA. Automate anything you can do manually in a browser.
44
slug: /
55
hide_table_of_contents: true
66
sidebar_position: 0
7+
sidebar_label: Home
78
---
89
import Card from "@site/src/components/Card";
910
import CardGrid from "@site/src/components/CardGrid";
1011
import homepageContent from "./homepage_content.json";
1112

12-
# Apify platform
13-
1413
> **Apify** is a cloud platform that helps you build reliable web scrapers, fast, and automate anything you can do manually in a web browser.
1514
>
1615
> **Actors** are serverless cloud programs running on the Apify platform that can easily crawl websites with millions of pages, but also perform arbitrary computing jobs such as sending emails or data transformations. They can be started manually, using our API or scheduler, and they can be easily integrated with other apps.

sources/platform/proxy/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import TabItem from '@theme/TabItem';
1111
import Card from "@site/src/components/Card";
1212
import CardGrid from "@site/src/components/CardGrid";
1313

14-
# Proxy
15-
1614
**Learn to anonymously access websites in scraping/automation jobs. Improve data outputs and efficiency of bots, and access websites from various geographies.**
1715

1816
---

sources/platform/security.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ category: platform
66
slug: /security
77
---
88

9-
# Security
10-
119
**Learn more about Apify's security practices and data protection measures that are used to protect your Actors, their data, and the Apify platform in general.**
1210

1311
---

sources/platform/storage/dataset.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ toc_max_heading_level: 4
66
slug: /storage/dataset
77
---
88

9-
# Dataset
10-
119
**Store and export web scraping, crawling or data processing job results. Learn how to access and manage datasets in Apify Console or via API.**
1210

1311
import Tabs from '@theme/Tabs';

sources/platform/storage/key_value_store.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ sidebar_position: 9.3
66
slug: /storage/key-value-store
77
---
88

9-
# Key-value store
10-
119
**Store anything from Actor or task run results, JSON documents, or images. Learn how to access and manage key-value stores from Apify Console or via API.**
1210

1311
import Tabs from '@theme/Tabs';

0 commit comments

Comments
 (0)