-
Notifications
You must be signed in to change notification settings - Fork 489
docs: update @apify/docusaurus-plugin-typedoc-api
#713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# Create docspec dump of this package's source code through pydoc-markdown | ||
python ./pydoc-markdown/generate_ast.py > docspec-dump.jsonl | ||
|
||
rm -rf "${apify_shared_tempdir}" | ||
|
||
# Generate import shortcuts from the modules | ||
python generate_module_shortcuts.py | ||
|
||
# Transform the docpec dumps into Typedoc-compatible docs tree | ||
node transformDocs.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
/* eslint-disable global-require,import/no-extraneous-dependencies */ | ||
/* eslint-disable global-require */ | ||
const path = require('path'); | ||
|
||
const { externalLinkProcessor } = require('./tools/utils/externalLink'); | ||
const { groupSort } = require('./transformDocs'); | ||
|
||
const GROUP_ORDER = [ | ||
'Classes', | ||
'Abstract classes', | ||
'Data structures', | ||
'Errors', | ||
'Functions', | ||
'Constructors', | ||
'Methods', | ||
'Properties', | ||
'Constants', | ||
'Enumeration Members', | ||
]; | ||
|
||
const groupSort = (g1, g2) => { | ||
if (GROUP_ORDER.includes(g1) && GROUP_ORDER.includes(g2)) { | ||
return GROUP_ORDER.indexOf(g1) - GROUP_ORDER.indexOf(g2); | ||
} | ||
return g1.localeCompare(g2); | ||
}; | ||
|
||
/** @type {Partial<import('@docusaurus/types').DocusaurusConfig>} */ | ||
module.exports = { | ||
|
@@ -14,6 +35,7 @@ module.exports = { | |
'/python/js/custom.js', | ||
'/crawlee-python/js/custom.js', | ||
], | ||
githubHost: 'github.com', | ||
headTags: [ | ||
// Intercom messenger | ||
{ | ||
|
@@ -78,9 +100,11 @@ module.exports = { | |
excludeExternals: false, | ||
}, | ||
sortSidebar: groupSort, | ||
pathToCurrentVersionTypedocJSON: `${__dirname}/api-typedoc-generated.json`, | ||
routeBasePath: 'api', | ||
python: true, | ||
pythonOptions: { | ||
pythonModulePath: path.join(__dirname, '../src/crawlee'), | ||
moduleShortcutsPath: path.join(__dirname, 'module_shortcuts.json'), | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new unified API docs generating pipeline - we don't need to generate the json ourselves, just supply the path to the project (and the |
||
}, | ||
], | ||
// [ | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the plugin now runs
pydoc-markdown
(and other python tooling) automatically, we need to run the Docusaurus build with the correct venv usingpoetry run
(hopefully this is how it works).