Skip to content

Conversation

@casper-oai
Copy link

@casper-oai casper-oai commented Nov 25, 2025

Summary

This PR fixes Issue #2222. It updates the notebook metadata for markdown‑only cookbook notebooks by setting language_info.nbconvert_exporter to markdown. This ensures that nbviewer returns a non‑empty response when using “View as Markdown”.

For example, GPT-5.1 prompting guide 'View as Markdown' is broken: https://nbviewer.org/format/script/github/openai/openai-cookbook/blob/main/examples/gpt-5/gpt-5-1_prompting_guide.ipynb
The notebook in a commit of this PR including the fix does render: https://nbviewer.org/format/script/github/openai/openai-cookbook/blob/141d9eadd12588bcfc803a4a2d850f465de05010/examples/gpt-5/gpt-5-1_prompting_guide.ipynb?flush_cache=1

This is a temporary fix to restore functionality while we should work toward a better solution that does not rely on nbviewer’s script exporter behavior.

Motivation

Some cookbook pages failed to render in nbviewer when opened via the “View as Markdown” link. The root cause was that nbviewer’s /format/script endpoint delegates to the exporter specified in language_info.nbconvert_exporter. For markdown‑only notebooks, this exporter was set to python, causing nbviewer to emit an empty output because the notebook contained zero code cells. The result was a completely blank page on nbviewer.

@casper-oai casper-oai marked this pull request as ready for review November 26, 2025 00:31
@casper-oai casper-oai requested a review from justonf November 26, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants