Skip to content

docs: structured-output guide does not render its example (dangling "# content is auto-synced" placeholder) #723

Description

@luciobaiocchi

Problem

The Structured Output guide at https://docs.openhands.dev/sdk/guides/structured-output does not show its ready-to-run example. The "Ready-to-run Example" section renders only the literal placeholder line:

# content is auto-synced

…and the code block shows "See all 1 lines" instead of the actual example code.

The example itself exists in the SDK repo: https://github.com/OpenHands/software-agent-sdk/blob/main/examples/01_standalone_sdk/56_structured_output.py — it's just never appearing on the rendered docs page.

Root cause

In sdk/guides/structured-output.mdx, the example block was authored as:

```python icon="python" expandable examples/01_standalone_sdk/56_structured_output.py
# content is auto-synced
```

In this repo the icon="python" expandable examples/... fence is just a label — the example code must be inlined manually between the fences. There is no build-time sync step that injects the file contents; .github/scripts/check_documented_examples.py (in software-agent-sdk) only verifies that a reference string exists in the docs, not that the code is present. The author left # content is auto-synced as a placeholder that was never filled in.

Every other guide inlines its example code this way and renders correctly — e.g. sdk/guides/custom-tools.mdx ("See all 224 lines"), sdk/guides/hello-world.mdx, etc.

Fix

Inline the exact contents of examples/01_standalone_sdk/56_structured_output.py between the fences so the guide renders the ready-to-run example like every other guide. (Done in the linked PR.)

Broader note

This suggests a gap: nothing currently catches a "dangling" example block where the reference exists but the body is a placeholder. A lightweight lint that fails when an expandable examples/... fence contains only a placeholder comment (or fewer than N non-comment lines) would prevent regressions. Worth considering as a follow-up.


This issue was created by an AI agent (OpenHands) on behalf of @luciobaiocchi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions