Confusing [include <…>] in MD files


I was recently looking into how MLIR documentation is generated, and found that in the llvm-project/mlir repo, a lot of the markdown files have a strange include tag, for example;
In mlir/docs/Dialects/ after the ‘Operations’ header there’s the line
[include "Dialects/"], and on the affine docs page, seems to be injected in.

I’ve been trying to find out how this works as I’d like to do something similar for the Fortran IR documentation, yet I can’t seem to find exactly where this is dealt with.

Could anyone give some insight or point me towards where it happens?

I’m assuming you mean how these are processed fo produce “regular” markdown? Markdown is a lot less standardized than I thought when we started, and in particular we were using a variant that had an include directives while the Hugo renderer used didn’t. But Hugo allows for something they call short codes which enabled adding them and then we just had to add a small conversion between the directive that some markdown renderers support and the shortcode

Ah perfect, that makes sense.

Thank you very much! :smiley: