Skip to content

Commit ddd3a3b

Browse files
resolve conflict
2 parents fada6bf + c4c2855 commit ddd3a3b

File tree

194 files changed

+2361
-986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+2361
-986
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Intro
66

7-
This repository is the home of Apify's documentation, which you can find at [docs.apify.com](https://docs.apify.com/). The documentation is written using [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). Source files of the [platform documentation](https://docs.apify.com/platform) are located in the [/sources](https://github.com/apify/apify-docs/tree/master/sources) directory. However, other sections, such as SDKs for [JavaScript/Node.js](https://docs.apify.com/sdk/js/), [Python](https://docs.apify.com/sdk/python/), or [CLI](https://docs.apify.com/cli), have their own repositories. For more information, see the [Contributing guidelines](./CONTRIBUTING.md).
7+
This repository is the home of Apify's documentation, which you can find at [docs.apify.com](https://docs.apify.com/). The documentation is written using [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). Source files of the [platform documentation](https://docs.apify.com/platform) are located in the [/sources](https://github.com/apify/apify-docs/tree/master/sources) directory. However, other sections, such as SDKs for [JavaScript/Node.js](https://docs.apify.com/sdk/js/), [Python](https://docs.apify.com/sdk/python/), or [CLI](https://docs.apify.com/cli/), have their own repositories. For more information, see the [Contributing guidelines](./CONTRIBUTING.md).
88

99
## Before you start contributing
1010

_typos.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[default]
22
extend-ignore-re = [
3-
'`[^`\n]+`',
4-
'```[\s\S]*?```',
3+
'`[^`\n]+`', # skip inline code
4+
'```[\s\S]*?```', # skip code blocks
55
]
66

77
[default.extend-words]

apify-docs-theme/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apify/docs-theme",
3-
"version": "1.0.134",
3+
"version": "1.0.137",
44
"description": "",
55
"main": "./src/index.js",
66
"files": [
@@ -19,7 +19,7 @@
1919
"access": "public"
2020
},
2121
"dependencies": {
22-
"@apify/docs-search-modal": "^1.1.0",
22+
"@apify/docs-search-modal": "^1.1.1",
2323
"@docusaurus/theme-common": "^3.5.2",
2424
"@stackql/docusaurus-plugin-hubspot": "^1.1.0",
2525
"axios": "^1.7.4",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function MDXDetails(props) {
66
// Split summary item from the rest to pass it as a separate prop to the
77
// Details theme component
88
const summary = items.find(
9-
(item) => React.isValidElement(item) && item.props?.mdxType === 'summary',
9+
(item) => React.isValidElement(item) && item.type === 'summary',
1010
);
1111
const children = <>{items.filter((item) => item !== summary)}</>;
1212
return (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const MDXComponents = {
1717
code: MDXCode,
1818
a: MDXA,
1919
pre: MDXPre,
20-
details: MDXDetails,
20+
Details: MDXDetails,
2121
ul: MDXUl,
2222
img: MDXImg,
2323
h1: (props) => <MDXHeading as="h1" {...props} />,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import Link from '@docusaurus/Link';
2+
import clsx from 'clsx';
3+
import React from 'react';
4+
5+
import styles from './styles.module.css';
6+
7+
// Recursive component rendering the toc tree
8+
function TOCItemTree({
9+
toc,
10+
className,
11+
linkClassName,
12+
isChild,
13+
}) {
14+
if (!toc.length) {
15+
return null;
16+
}
17+
return (
18+
<ul className={isChild ? undefined : className}>
19+
{toc.map((heading) => (
20+
<li key={heading.id}>
21+
<Link
22+
to={`#${heading.id}`}
23+
className={clsx(styles.apifyTocLink, linkClassName ?? undefined)}
24+
data-label={heading.value}
25+
// Developer provided the HTML, so assume it's safe.
26+
dangerouslySetInnerHTML={{ __html: heading.value }}
27+
/>
28+
<TOCItemTree
29+
isChild
30+
toc={heading.children}
31+
className={className}
32+
linkClassName={linkClassName}
33+
/>
34+
</li>
35+
))}
36+
</ul>
37+
);
38+
}
39+
40+
// Memo only the tree root is enough
41+
export default React.memo(TOCItemTree);
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { useThemeConfig } from '@docusaurus/theme-common';
2+
import {
3+
useTOCHighlight,
4+
useFilteredAndTreeifiedTOC,
5+
} from '@docusaurus/theme-common/internal';
6+
import TOCItemTree from '@theme/TOCItems/Tree';
7+
import React, { useMemo } from 'react';
8+
9+
export default function TOCItems({
10+
toc,
11+
className = 'table-of-contents table-of-contents__left-border',
12+
linkClassName = 'table-of-contents__link',
13+
linkActiveClassName = undefined,
14+
minHeadingLevel: minHeadingLevelOption,
15+
maxHeadingLevel: maxHeadingLevelOption,
16+
...props
17+
}) {
18+
const themeConfig = useThemeConfig();
19+
20+
const minHeadingLevel = minHeadingLevelOption ?? themeConfig.tableOfContents.minHeadingLevel;
21+
const maxHeadingLevel = maxHeadingLevelOption ?? themeConfig.tableOfContents.maxHeadingLevel;
22+
23+
const tocTree = useFilteredAndTreeifiedTOC({
24+
toc,
25+
minHeadingLevel,
26+
maxHeadingLevel,
27+
});
28+
29+
const tocHighlightConfig = useMemo(() => {
30+
if (linkClassName && linkActiveClassName) {
31+
return {
32+
linkClassName,
33+
linkActiveClassName,
34+
minHeadingLevel,
35+
maxHeadingLevel,
36+
};
37+
}
38+
return undefined;
39+
}, [linkClassName, linkActiveClassName, minHeadingLevel, maxHeadingLevel]);
40+
useTOCHighlight(tocHighlightConfig);
41+
42+
return (
43+
<TOCItemTree
44+
toc={tocTree}
45+
className={className}
46+
linkClassName={linkClassName}
47+
{...props}
48+
/>
49+
);
50+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.apifyTocLink {
2+
display: block;
3+
}
4+
5+
.apifyTocLink::before {
6+
display: block;
7+
content: attr(data-label);
8+
font-weight: 700;
9+
height: 0;
10+
overflow: hidden;
11+
visibility: hidden;
12+
}

apify-docs-theme/src/theme/custom.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ html[data-theme='dark'] .runnable-code-block svg .apify-logo {
15491549
.prism-code.language-javascript .token-line::before,
15501550
.prism-code.language-json .token-line::before,
15511551
.prism-code.language-json5 .token-line::before,
1552+
.prism-code.language-py .token-line::before,
15521553
.prism-code.language-python .token-line::before,
15531554
.prism-code.language-dockerfile .token-line::before,
15541555
.prism-code.language-XML .token-line::before,

clientModule.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// client module for callbacks on route change
2+
// see https://docusaurus.io/docs/advanced/client#client-module-lifecycles
3+
export function onRouteDidUpdate({ location, previousLocation }) {
4+
// Don't execute if we are still on the same page; the lifecycle may be fired
5+
// because the hash changes (e.g. when navigating between headings)
6+
if (location.pathname !== previousLocation?.pathname) {
7+
// hubspot tracking page view
8+
// eslint-disable-next-line no-underscore-dangle, no-multi-assign
9+
const _hsq = window._hsq = window._hsq || [];
10+
_hsq.push(['setPath', window.location.pathname]);
11+
_hsq.push(['trackPageView']);
12+
}
13+
}

0 commit comments

Comments
 (0)