Skip to content

docs(snippets): replace HTML comments with JSX comments for strict MDX compatibility#11117

Merged
anakin87 merged 1 commit intodeepset-ai:mainfrom
Aftabbs:docs/jsx-comments-docstrings
Apr 16, 2026
Merged

docs(snippets): replace HTML comments with JSX comments for strict MDX compatibility#11117
anakin87 merged 1 commit intodeepset-ai:mainfrom
Aftabbs:docs/jsx-comments-docstrings

Conversation

@Aftabbs
Copy link
Copy Markdown
Contributor

@Aftabbs Aftabbs commented Apr 16, 2026

What does this PR do?

Closes #11104.

Replaces all <!-- test-ignore --> HTML comment markers in Python docstrings and generated API reference docs with JSX comments {/* test-ignore */} to be compatible with strict MDX parsing in Docusaurus v4.

Changes:

  • haystack/**/*.py (31 files): <!-- test-ignore -->{/* test-ignore */} in docstring usage examples
  • docs-website/reference/haystack-api/*.md (13 files): same replacement in generated API reference docs
  • docs-website/scripts/test_python_snippets.py: update TEST_IGNORE_MARK, TEST_CONCEPT_MARK, TEST_RUN_MARK, TEST_REQUIRE_FILES_PREFIX constants + detection logic (startswith/endswith checks) + docstring examples
  • docs-website/docusaurus.config.js: remove mdx1Compat: { comments: true } compatibility shim

After this change the docs site can run with strict MDX and the mdx1Compat.comments workaround is no longer needed.

Before submitting

  • This PR fixes a bug (non-breaking change that fixes an issue)
  • This PR is a new feature
  • This PR is a breaking change

Testing

The test_python_snippets.py script will correctly detect the new JSX marker format since all constants and detection logic have been updated consistently.

…mpatibility

Replace all `<!-- test-ignore -->` HTML comment markers in Python docstrings
and generated API reference docs with JSX comments `{/* test-ignore */}` to be
compatible with strict MDX parsing in Docusaurus v4.

Also update test_python_snippets.py to use the new JSX marker format for
`TEST_IGNORE_MARK`, `TEST_CONCEPT_MARK`, `TEST_RUN_MARK`, and
`TEST_REQUIRE_FILES_PREFIX` constants, and remove the `mdx1Compat: { comments: true }`
compatibility setting from docusaurus.config.js.

Closes deepset-ai#11104
@Aftabbs Aftabbs requested a review from a team as a code owner April 16, 2026 09:03
@Aftabbs Aftabbs requested review from davidsbatista and removed request for a team April 16, 2026 09:03
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

@Aftabbs is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the type:documentation Improvements on the docs label Apr 16, 2026
@anakin87 anakin87 requested review from anakin87 and removed request for davidsbatista April 16, 2026 09:04
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-docs Ready Ready Preview, Comment Apr 16, 2026 9:07am

Request Review

@anakin87 anakin87 added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label Apr 16, 2026
Copy link
Copy Markdown
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@anakin87 anakin87 enabled auto-merge (squash) April 16, 2026 09:14
@anakin87 anakin87 merged commit 2b1ca62 into deepset-ai:main Apr 16, 2026
35 of 36 checks passed
anakin87 added a commit that referenced this pull request Apr 16, 2026
anakin87 added a commit that referenced this pull request Apr 16, 2026
* Revert "Sync Haystack API reference on Docusaurus (#11118)"

This reverts commit 8d9df4c.

* Revert "docs(snippets): replace HTML comments with JSX comments for MDX v4 compatibility (#11117)"

This reverts commit 2b1ca62.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes PRs with this flag won't be included in the release notes. type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use JSX comments for docstrings

2 participants