This enables generating the documentation of type constraints. So far
this documentation is only generated as part of the full docs, generated
via --gen-dialect-doc.
Details
- Reviewers
mehdi_amini rriddle jdd
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
OOC when would one want to just have the type constraints? I was thinking most were moving towards full doc generation
Well I plan to extend the EmitC dialect documentation. In order to do so, I need to replace
add_mlir_doc(EmitC EmitC Dialects/ -gen-dialect-doc)
I think the Buildin dialect is a good reference here:
add_mlir_doc(BuiltinAttributes BuiltinAttributes Dialects/ -gen-attrdef-doc) add_mlir_doc(BuiltinLocationAttributes BuiltinLocationAttributes Dialects/ -gen-attrdef-doc) add_mlir_doc(BuiltinOps BuiltinOps Dialects/ -gen-op-doc) add_mlir_doc(BuiltinTypes BuiltinTypes Dialects/ -gen-typedef-doc) add_mlir_doc(BuiltinTypes BuiltinTypeInterfaces Dialects/ -gen-type-interface-docs)
This allows to place the TOC at the correct position, to have a header like # 'emitc' Dialect only once, etc. This is hard to achieve when relying on -gen-dialect-doc, e.g. you cannot have the TOC at the top of the documentation or you have multiple TOCs. However, with not using -gen-dialect-doc, you loose the ability to document the type constraints.
Have you looked into fixing the issues with gen-dialect-doc? Or is it not easily feasible?
I don't know if there is anything to fix in gen-dialect-doc. From my point of view it's fine that every generated file starts with
# '${dialect} Dialect' [TOC]
Otherwise you cannot fully rely on a pure auto-generated documentation. Removing those two auto-generated lines would force to add a custom markdown file to every dialect, which seems unnecessary. So I am not sure how we could "fix" gen-dialect-doc, but I am open for suggestions.
Anyway, if you want to put something in between of those two lines, you could do this generating several docs + adding a custom markdown file as the Builtin dialect does and that's fine. However, so far no possibility to generate docs on type constraints.