Skip to content

Markdown types - #1403

Merged
jonludlam merged 6 commits into
ocaml:masterfrom
davesnx:markdown-types
Mar 10, 2026
Merged

jonludlam merged 6 commits into
ocaml:masterfrom
davesnx:markdown-types

Conversation

@davesnx

@davesnx davesnx commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

The markdown backend was emitting fenced code blocks without a language identifier (bare ` ``) for OCaml API declarations (type signatures, value definitions, module types, etc.), while other backends correctly assumed OCaml as the default language.

  • Changed the documentedSrc function in src/markdown2/generator.ml to emit `ocaml `` for these code blocks, aligning with the behavior of the HTML and other backends.
  • Refactored documentedSrc to collect Code, Documented, and Nested items into a single unified code block with inline doc comments, rather than rendering them as separate blocks.
  • Verbatim ({v ... v}) and Math code blocks are left without a language tag, as they are not OCaml code.
  • Explicit language tags on Source blocks (e.g. {@python[...]}) continue to be preserved as-is

@jonludlam

Copy link
Copy Markdown
Member

Looks good. Thanks!

@jonludlam
jonludlam merged commit 50402cb into ocaml:master Mar 10, 2026
10 checks passed
shonfeder added a commit to ocaml/dune that referenced this pull request May 14, 2026
The CI keeps failing presumably since
ocaml/odoc#1403 (released in odoc 3.2.0) was
merged.

This PR
 - [X] Updates the constraint to use odoc 3.2.0+
- [X] ~~Updates the tests to expect the new syntax~~ already done in
#14505
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