Skip to content

Commit 927092f

Browse files
vdusekclaude
andcommitted
docs: remove redundant transformDocs.js and pydoc-markdown setup
The docusaurus-plugin-typedoc-api plugin handles the docspec-to-typedoc conversion internally. The external pydoc-markdown dump and transformDocs.js pipeline are unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6185d55 commit 927092f

File tree

4 files changed

+21
-429
lines changed

4 files changed

+21
-429
lines changed

website/build_api_reference.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
#!/bin/bash
22

3-
# On macOS, sed requires a space between -i and '' to specify no backup should be done
4-
# On Linux, sed requires no space between -i and '' to specify no backup should be done
5-
sed_no_backup() {
6-
if [[ $(uname) = "Darwin" ]]; then
7-
sed -i '' "$@"
8-
else
9-
sed -i'' "$@"
10-
fi
11-
}
12-
13-
# Create docspec dump of this package's source code through pydoc-markdown
14-
pydoc-markdown --quiet --dump > docspec-dump.jsonl
15-
sed_no_backup "s#${PWD}/..#REPO_ROOT_PLACEHOLDER#g" docspec-dump.jsonl
16-
173
# Generate import shortcuts from the modules
184
python generate_module_shortcuts.py
19-
20-
# Transform the docpec dumps into Typedoc-compatible docs tree
21-
node transformDocs.js

website/docusaurus.config.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,29 @@ const { join, resolve } = require('node:path');
33
const { config } = require('@apify/docs-theme');
44

55
const { externalLinkProcessor } = require('./tools/utils/externalLink');
6-
const { groupSort } = require('./transformDocs.js');
76
const versions = require('./versions.json');
87

8+
const GROUP_ORDER = [
9+
'Apify API clients',
10+
'HTTP clients',
11+
'Resource clients',
12+
'Errors',
13+
'Models',
14+
'Other',
15+
];
16+
17+
const groupSort = (g1, g2) => {
18+
const i1 = GROUP_ORDER.indexOf(g1);
19+
const i2 = GROUP_ORDER.indexOf(g2);
20+
// Both known – sort by defined order
21+
if (i1 !== -1 && i2 !== -1) return i1 - i2;
22+
// Unknown groups go after known ones
23+
if (i1 !== -1) return -1;
24+
if (i2 !== -1) return 1;
25+
// Both unknown – alphabetical
26+
return g1.localeCompare(g2);
27+
};
28+
929
const { absoluteUrl } = config;
1030

1131
/** @type {Partial<import('@docusaurus/types').DocusaurusConfig>} */
@@ -109,7 +129,6 @@ module.exports = {
109129
typedocOptions: {
110130
excludeExternals: false,
111131
},
112-
pathToCurrentVersionTypedocJSON: `${__dirname}/api-typedoc-generated.json`,
113132
sortSidebar: groupSort,
114133
routeBasePath: 'reference',
115134
python: true,

website/pydoc-markdown.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)