@apify/docs-theme 1.0.203 → 1.0.205

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.203",
3
+ "version": "1.0.205",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -0,0 +1,66 @@
1
+ import { useDoc } from '@docusaurus/plugin-content-docs/client';
2
+ import { useLocation } from '@docusaurus/router';
3
+ import { ThemeClassNames } from '@docusaurus/theme-common';
4
+ import Heading from '@theme/Heading';
5
+ import LLMButtons from '@theme/LLMButtons';
6
+ import MDXContent from '@theme/MDXContent';
7
+ import clsx from 'clsx';
8
+ import React from 'react';
9
+
10
+ function useSyntheticTitle() {
11
+ const { metadata, frontMatter, contentTitle } = useDoc();
12
+ const shouldRender = !frontMatter.hide_title && typeof contentTitle === 'undefined';
13
+
14
+ if (!shouldRender) {
15
+ return null;
16
+ }
17
+
18
+ return metadata.title;
19
+ }
20
+
21
+ /**
22
+ * This component is also used in other Apify docs (clients, SDKs, CLI)
23
+ */
24
+ export default function DocItemContent({ children }) {
25
+ const syntheticTitle = useSyntheticTitle();
26
+ const location = useLocation();
27
+
28
+ // Define the allowed paths that should show LLMButtons
29
+ // The logic is handled here, and also in docusaurus.config.js (see docusaurus-plugin-openapi-docs)
30
+ const allowedPaths = [
31
+ '/api/v2/getting-started',
32
+ '/api/v2/actors',
33
+ '/api/v2/actors-actor-versions',
34
+ '/api/v2/actors-actor-builds',
35
+ '/api/v2/actors-actor-runs',
36
+ '/api/v2/actors-webhook-collection',
37
+ '/api/v2/actor-builds',
38
+ '/api/v2/actor-runs',
39
+ '/api/v2/actor-tasks',
40
+ '/api/v2/storage-datasets',
41
+ '/api/v2/storage-key-value-stores',
42
+ '/api/v2/storage-request-queues',
43
+ '/api/v2/storage-request-queues-requests',
44
+ '/api/v2/storage-request-queues-requests-locks',
45
+ '/api/v2/webhooks-webhooks',
46
+ '/api/v2/webhooks-webhook-dispatches',
47
+ '/api/v2/schedules',
48
+ '/api/v2/store',
49
+ '/api/v2/logs',
50
+ '/api/v2/users',
51
+ '/api/client',
52
+ '/platform',
53
+ '/sdk',
54
+ '/cli',
55
+ ];
56
+
57
+ const shouldShowLLMButtons = allowedPaths.some((path) => location.pathname.startsWith(path));
58
+
59
+ return (
60
+ <div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
61
+ {syntheticTitle && <Heading as="h1">{syntheticTitle}</Heading>}
62
+ {shouldShowLLMButtons && <LLMButtons />}
63
+ <MDXContent>{children}</MDXContent>
64
+ </div>
65
+ );
66
+ }
@@ -934,7 +934,7 @@ div[class*="searchBox"] {
934
934
  .navbar__item > .navbar__link,
935
935
  .navbar-sidebar__back {
936
936
  padding: 0.8rem 1.2rem;
937
- border-radius: 2rem;
937
+ border-radius: 0.8rem;
938
938
  font-size: 1.4rem;
939
939
  line-height: 2.4rem;
940
940
  font-weight: 500;