Skip to content

Markdown types#1403

Open
davesnx wants to merge 6 commits intoocaml:masterfrom
davesnx:markdown-types
Open

Markdown types#1403
davesnx wants to merge 6 commits intoocaml:masterfrom
davesnx:markdown-types

Conversation

@davesnx
Copy link
Contributor

@davesnx davesnx commented Mar 4, 2026

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

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.

1 participant