Open matklad opened 1 year ago
writing this down the second time, as I've already forgot this idea once :)
The end goal would be to define djot_ast.ts file which precisely specifies the JSON AST:
djot_ast.ts
interface Doc { tag: "doc"; attr: Record<string, string>; references: Record<string, ReferenceDefinition>; children: (Para | CodeBlock ... )[] } interface Para { tag: "para"; ... } interface ReferenceDefinition { tag: "reference_definition"; destination: string; }
and generate the Rust AST from it.
Or rather, we probably want:
We could generate .ts also from some more compact representation, but I think hand-written .ts as a source of truth is probably the sweet spot.
.ts
cc https://github.com/jgm/djot/issues/95
writing this down the second time, as I've already forgot this idea once :)
The end goal would be to define
djot_ast.ts
file which precisely specifies the JSON AST:and generate the Rust AST from it.
Or rather, we probably want:
We could generate .ts also from some more compact representation, but I think hand-written
.ts
as a source of truth is probably the sweet spot.