Skip to content

init mlmdx - #75

Merged
hon-gyu merged 4 commits into
mainfrom
hy/mlmdx
Jul 7, 2026
Merged

init mlmdx#75
hon-gyu merged 4 commits into
mainfrom
hy/mlmdx

Conversation

@hon-gyu

@hon-gyu hon-gyu commented Jul 7, 2026

Copy link
Copy Markdown
Owner
  • mlmdx: codegen (Doc -> Parsetree) + mlmdx-pp dialect preprocessor
  • mlmdx: JSX breadth, prelude, merlin reader; restructure examples
  • mlmdx: route structural markdown through overridable components table
  • bump oymarkit

hon-gyu added 4 commits July 4, 2026 22:46
- mlmdx_codegen: Cmarkit.Doc.t -> Parsetree.structure exposing
  `let make () = <element>`. Structural nodes emit plain JSX.node/string/list
  calls; embedded {expr} spans are parsed by Parse.expression on a lexbuf primed
  from the node's Textloc, so type errors land on the exact .mlmdx byte.
- mlmdx-pp: dialect preprocessor emitting the -pp binary AST protocol
  (magic number + filename + structure).
Complete the .mlmdx -> HTML chain beyond the {expr} slice:

- codegen: inline/block host JSX, fragments, component calls, and a strict
  top-of-file open/let/module prelude, alongside the existing {expr} lowering;
  add codegen.mli.
- ocamlmerlin-mlmdx: merlin-extend reader over the shared codegen core, wired
  via (merlin_reader mlmdx). Adds the merlin-extend dep.
- bump oymarkit to 2678a5a (native JSX expr/element nodes + block container).
- examples/: promote example/ to examples/hello/ with a README and a cram test
  pinning the end-to-end rendered HTML.
- remove spike/: its composition proof is now subsumed by examples/ driving real
  .mlx components through the full pipeline.
- README: self-contained rewrite (no external design doc).
Markdown-structural elements (headings, paragraphs, emphasis,
code,blockquote) now lower to `components.h1 ~children:[…]` calls
dispatchedthrough a `?components` parameter on the generated `make`,
rather thanhardcoded `JSX.node`. This is what makes mlmdx MDX rather
than plainmarkdown-to-HTML: a consumer can restyle or swap any element
page-wide.- runtime/ (new `mlmdx` library): `Mlmdx.Components.t`, the
record of  per-element renderers, plus `default` whose renderers
reproduce the  vanilla HTML nodes — so an un-themed page is
byte-for-byte identical to  before. Literal JSX and `<Component/>` calls
stay author intent and do  not route through the table.- codegen:
`md_elt` emits the table field access; `make` gains  `?(components :
Mlmdx.Components.t = Mlmdx.Components.default)`. The  type annotation
lets the field accesses disambiguate without an `open`.  Expect tests
updated to the new parsetree.- example/hello: render.ml now renders
twice — default, then with an  overridden `h1` — and render.t pins both
lines.- README/docs: components table moved from "not yet done" to done;
the  SSG page-discovery driver is now the remaining open track.- TODO
markers on the `_ -> jnull` catch-alls: unhandled inline/block
constructs (links, images, lists, code blocks) still drop silently.
@hon-gyu
hon-gyu merged commit 2d62832 into main Jul 7, 2026
0 of 2 checks passed
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