-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
chore(API docs): link to related docs pages #17276
base: main
Are you sure you want to change the base?
Conversation
Links from the API docs to the related documentation pages. This helps identify which features each API route represents. Related to https://linear.app/prefect/issue/PLA-987/add-links-to-documentation-from-the-oss-api-docs
CodSpeed Performance ReportMerging #17276 will not alter performanceComparing Summary
|
@@ -68,6 +68,8 @@ async def create_deployment( | |||
If the deployment has an active schedule, flow runs will be scheduled. | |||
When upserting, any scheduled runs from the existing deployment will be deleted. | |||
For more information, see [deployments](/v3/deploy). |
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.
So this seems to work fine from the OSS API docs pages (https://docs.prefect.io/v3/api-ref/rest-api/server/), but I believe these also get ingested into the Cloud API docs pages (https://app.prefect.cloud/api/docs).
The text added in this PR should appear here:

I'm not sure, though, if this markdown link will render as expected so it's a click-able link.
Also, the current change uses relative links, meaning it links back to docs.prefect.io
. From the Cloud API docs, this won't work, so we may want to ditch relative links and instead provide the full URL here so it works from both the OSS API docs and the Cloud API docs.
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.
I tested to make sure the markdown would render in the Cloud API docs, and looks like it will.
Diff with a change (link is wrong, but just used any link to confirm markdown would render):
diff --git a/src/prefect_cloud/nebula/collections.py b/src/prefect_cloud/nebula/collections.py
index aa6df49f1..0b8cf3b29 100644
--- a/src/prefect_cloud/nebula/collections.py
+++ b/src/prefect_cloud/nebula/collections.py
@@ -31,7 +31,11 @@ CollectionViewName = Literal[
async def read_view_content(
view: CollectionViewName,
) -> Dict[str, Any]:
- """Reads the content of a view from the prefect-collection-registry."""
+ """
+ Reads the content of a view from the prefect-collection-registry.
+
+ For more information, see [collections](https://docs.prefect.io/v3/develop/blocks).
+ """
try:
collection_view = await get_collection_view(view)

The relative links will work fine for the OSS API docs on docs.prefect.io, but this information is also consumed by the Cloud API docs on app.prefect.cloud/api/docs. Of course, the relative links won't work from there. So instead, this change specifies the full URL so it works from both locations.
Links from the API docs to the related documentation pages. This helps identify which features each API route represents.
Related to https://linear.app/prefect/issue/PLA-987/add-links-to-documentation-from-the-oss-api-docs
Checklist
<link to issue>
"mint.json
.