Skip to content

Commit 30ff75b

Browse files
authored
docs: fix broken links across the documentation site (#865)
Checked all documentation links with lychee (the same checker used in apify-docs, run over the built site) and fixed the broken ones. Doc-link 404s drop from 379 to 10. - **Frozen versioned API reference**: source links were hardcoded to `blob/master/…`, which started 404ing after the `clients/resource_clients/`→`_resource_clients/` and `client.py`→`_apify_client.py` refactor. Pinned them to the immutable version tag (e.g. `blob/v2.5.1/…`), mirroring how apify-sdk-python pins them to a commit SHA. - **Model docstrings**: absolutized relative `](/platform/…)` links and fixed the malformed Docker build-cache anchor. Added `absolutize_doc_links()` to `scripts/postprocess_generated_models.py` so regeneration keeps them absolute. - **Changelog**: corrected release-tag URLs (`releases/tags/` → `releases/tag/`, and `v1.3.0` → `1.3.0` since that tag has no `v` prefix). - Applied the matching docstring fixes to the committed version snapshots (0.6/1.12/2.5/3.0) so the published pages are correct now. The remaining 10 are theme/plugin artifacts (changelog "Edit this page" links pointing at generated files, an llms-txt `blog.md` link, a frozen 1.12 cross-reference) plus a local-only `reference/next` Docker link that regenerates correctly in CI.
1 parent 4afa352 commit 30ff75b

9 files changed

Lines changed: 488 additions & 476 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ All notable changes to this project will be documented in this file.
256256
- Add rate limit statistics ([#343](https://github.com/apify/apify-client-python/pull/343)) ([f35c68f](https://github.com/apify/apify-client-python/commit/f35c68ff824ce83bf9aca893589381782a1a48c7)) by [@Mantisus](https://github.com/Mantisus)
257257

258258

259-
## [1.8.1](https://github.com/apify/apify-client-python/releases/tags/v1.8.1) (2024-09-17)
259+
## [1.8.1](https://github.com/apify/apify-client-python/releases/tag/v1.8.1) (2024-09-17)
260260

261261
### 🐛 Bug Fixes
262262

263263
- Batch add requests can handle more than 25 requests ([#268](https://github.com/apify/apify-client-python/pull/268)) ([9110ee0](https://github.com/apify/apify-client-python/commit/9110ee08954762aed00ac09cd042e802c1d041f7)) by [@vdusek](https://github.com/vdusek), closes [#264](https://github.com/apify/apify-client-python/issues/264)
264264

265265

266-
## [1.8.0](https://github.com/apify/apify-client-python/releases/tags/v1.8.0) (2024-08-30)
266+
## [1.8.0](https://github.com/apify/apify-client-python/releases/tag/v1.8.0) (2024-08-30)
267267

268268
- drop support for Python 3.8
269269

@@ -372,7 +372,7 @@ All notable changes to this project will be documented in this file.
372372
- Start importing general constants and utilities from the `apify-shared` library
373373

374374

375-
## [1.3.0](https://github.com/apify/apify-client-python/releases/tag/v1.3.0) (2023-07-24)
375+
## [1.3.0](https://github.com/apify/apify-client-python/releases/tag/1.3.0) (2023-07-24)
376376

377377
### 🚀 Features
378378

scripts/postprocess_generated_models.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ def _collapse_blank_lines(content: str) -> str:
6666
return re.sub(r'\n{3,}', '\n\n\n', content)
6767

6868

69+
def absolutize_doc_links(content: str) -> str:
70+
"""Rewrite root-relative Markdown links to absolute `docs.apify.com` URLs.
71+
72+
Descriptions come from the Apify API OpenAPI spec, where links to the Apify documentation are written
73+
root-relative (e.g. `](/platform/...)`). Rendered under the API reference `baseUrl`, those resolve to a
74+
non-existent `/api/client/python/platform/...` path, so prefix them with the docs domain. The negative
75+
lookahead leaves protocol-relative `](//host)` links untouched.
76+
"""
77+
return re.sub(r'\]\(/(?!/)', '](https://docs.apify.com/', content)
78+
79+
6980
def _ensure_typing_import(content: str, name: str) -> str:
7081
"""Append `name` to the `from typing import ...` line if not already imported.
7182
@@ -588,6 +599,7 @@ def postprocess_models(models_path: Path, literals_path: Path) -> list[Path]:
588599
"""
589600
original = models_path.read_text()
590601
fixed = fix_discriminators(original)
602+
fixed = absolutize_doc_links(fixed)
591603
fixed = convert_enums_to_literals(fixed)
592604
fixed = add_docs_group_decorators(fixed, 'Models')
593605
models_content, literals_content = split_literals_to_file(fixed)

src/apify_client/_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class ActorDefinition(BaseModel):
209209
storages: Storages | None = None
210210
default_memory_mbytes: Annotated[str | int | None, Field(alias='defaultMemoryMbytes')] = None
211211
"""
212-
Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory).
212+
Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](https://docs.apify.com/platform/actors/development/actor-definition/dynamic-actor-memory).
213213
"""
214214
min_memory_mbytes: Annotated[int | None, Field(alias='minMemoryMbytes', ge=128)] = None
215215
"""
@@ -828,7 +828,7 @@ class Dataset(BaseModel):
828828
),
829829
] = None
830830
"""
831-
Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema)
831+
Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)
832832
"""
833833
console_url: Annotated[
834834
AnyUrl, Field(alias='consoleUrl', examples=['https://console.apify.com/storage/datasets/27TmTznX9YPeAYhkC'])

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@apify/docs-theme": "^1.0.252",
24-
"@apify/docusaurus-plugin-typedoc-api": "^5.1.7",
24+
"@apify/docusaurus-plugin-typedoc-api": "^5.1.14",
2525
"@docusaurus/core": "^3.8.1",
2626
"@docusaurus/faster": "^3.8.1",
2727
"@docusaurus/plugin-client-redirects": "^3.8.1",

website/pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/versioned_docs/version-0.6/api-typedoc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20562,7 +20562,7 @@
2056220562
"version_number": "Actor version number to be built.",
2056320563
"beta_packages": "If True, then the actor is built with beta versions of Apify NPM packages.\nBy default, the build uses latest stable packages.",
2056420564
"tag": "Tag to be applied to the build on success. By default, the tag is taken from the actor version's buildTag property.",
20565-
"use_cache": "If true, the actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache).\nThis is to enable quick rebuild during development.\nBy default, the cache is not used.",
20565+
"use_cache": "If true, the actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).\nThis is to enable quick rebuild during development.\nBy default, the cache is not used.",
2056620566
"wait_for_finish": "The maximum number of seconds the server waits for the build to finish before returning.\nBy default it is 0, the maximum value is 300.\n"
2056720567
},
2056820568
"returns": "dict: The build object"
@@ -20692,7 +20692,7 @@
2069220692
"summary": [
2069320693
{
2069420694
"kind": "text",
20695-
"text": "If true, the actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache).\nThis is to enable quick rebuild during development.\nBy default, the cache is not used."
20695+
"text": "If true, the actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).\nThis is to enable quick rebuild during development.\nBy default, the cache is not used."
2069620696
}
2069720697
]
2069820698
},

website/versioned_docs/version-1.12/api-typedoc.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24356,7 +24356,7 @@
2435624356
"summary": [
2435724357
{
2435824358
"kind": "text",
24359-
"text": "Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory)."
24359+
"text": "Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](https://docs.apify.com/platform/actors/development/actor-definition/dynamic-actor-memory)."
2436024360
}
2436124361
]
2436224362
},
@@ -24366,7 +24366,7 @@
2436624366
"module": "_models",
2436724367
"name": "default_memory_mbytes",
2436824368
"parsedDocstring": {
24369-
"text": "Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](/platform/actors/development/actor-definition/dynamic-actor-memory)."
24369+
"text": "Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](https://docs.apify.com/platform/actors/development/actor-definition/dynamic-actor-memory)."
2437024370
},
2437124371
"sources": [
2437224372
{
@@ -38481,7 +38481,7 @@
3848138481
"summary": [
3848238482
{
3848338483
"kind": "text",
38484-
"text": "Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema)"
38484+
"text": "Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)"
3848538485
}
3848638486
]
3848738487
},
@@ -38491,7 +38491,7 @@
3849138491
"module": "_models",
3849238492
"name": "schema_",
3849338493
"parsedDocstring": {
38494-
"text": "Defines the schema of items in your dataset, the full specification can be found in [Apify docs](/platform/actors/development/actor-definition/dataset-schema)"
38494+
"text": "Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)"
3849538495
},
3849638496
"sources": [
3849738497
{
@@ -73153,7 +73153,7 @@
7315373153
"version_number": "Actor version number to be built.",
7315473154
"beta_packages": "If True, then the Actor is built with beta versions of Apify NPM packages. By default,\nthe build uses latest stable packages.",
7315573155
"tag": "Tag to be applied to the build on success. By default, the tag is taken from the Actor version's\nbuild tag property.",
73156-
"use_cache": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used.",
73156+
"use_cache": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used.",
7315773157
"wait_for_finish": "The maximum number of seconds the server waits for the build to finish before returning.\nBy default it is 0, the maximum value is 60.",
7315873158
"timeout": "Timeout for the API HTTP request.\n"
7315973159
},
@@ -73292,7 +73292,7 @@
7329273292
"summary": [
7329373293
{
7329473294
"kind": "text",
73295-
"text": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used."
73295+
"text": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used."
7329673296
}
7329773297
]
7329873298
},
@@ -76821,7 +76821,7 @@
7682176821
"version_number": "Actor version number to be built.",
7682276822
"beta_packages": "If True, then the Actor is built with beta versions of Apify NPM packages. By default,\nthe build uses latest stable packages.",
7682376823
"tag": "Tag to be applied to the build on success. By default, the tag is taken from the Actor version's\nbuild tag property.",
76824-
"use_cache": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used.",
76824+
"use_cache": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used.",
7682576825
"wait_for_finish": "The maximum number of seconds the server waits for the build to finish before returning.\nBy default it is 0, the maximum value is 60.",
7682676826
"timeout": "Timeout for the API HTTP request.\n"
7682776827
},
@@ -76962,7 +76962,7 @@
7696276962
"summary": [
7696376963
{
7696476964
"kind": "text",
76965-
"text": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/`leverage`-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used."
76965+
"text": "If true, the Actor's Docker container will be rebuilt using layer cache\n(https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).\nThis is to enable quick rebuild during development. By default, the cache is not used."
7696676966
}
7696776967
]
7696876968
},

0 commit comments

Comments
 (0)