mirror-llvm-project/mlir/utils
Reid Kleckner 97f1c7c185
[docs] Register MLIR lexer for Sphinx docs (#206194)
Fixes building `docs-clang-html` when `cmake -DCLANG_ENABLE_CIR=ON`.

Fragments of generated documentation contain code blocks tagged with the
`mlir` language, and that generates Pygments warnings, which fails the
build.

I chose to register a sphinx extension, which in turn registers the MLIR
pygments dialect from utils/docs/llvm_sphinx. The idea here is that
`mlir` syntax highlighting should work in any llvm-project documentation
anywhere (openmp, or anything else).

I'm a little less confident about the change to the mlir lexer itself,
which seems to be necessary in order to get pygments to run without
error. Here is an example error message of what happens if you don't
match whitespace tokens as Text:

```
Warning, treated as error:
/path/to/index.md:3:Lexing literal_block '   %0 = cir.foo : !cir.int<s, 32>\n' as "mlir" resulted in an error at token: ' '. Retrying in relaxed mode.
```

Authored with LLM assistance
2026-06-30 11:46:53 -07:00
..
clang-tidy
emacs [NFC][emacs] Fix emacs lints in the LLVM and MLIR modes (#182074) 2026-02-19 09:44:27 -08:00
gdb-scripts [mlir][IR] Rename DenseIntOrFPElementsAttr to DenseTypedElementsAttr (#185687) 2026-03-13 17:27:23 +01:00
jupyter
lldb-scripts
mbr
MLIRVisualizers
pygments [docs] Register MLIR lexer for Sphinx docs (#206194) 2026-06-30 11:46:53 -07:00
spirv
textmate [mlir][vscode] Update to capture angle brackets in types/attrs (#176665) 2026-01-18 11:15:00 -08:00
tree-sitter-mlir [MLIR][Vector] Remove vector.splat (#162167) 2025-10-10 09:58:18 -07:00
verify-canon
vim
vscode [MLIR][lldb-dap] Update brace-expansion dependencies in VSCode plugins, resolving security alerts (#198549) 2026-05-20 13:00:47 -07:00
generate-test-checks.py [mlir] Fix generate-test-checks.py: don't put attr refs in CHECK-LABEL (#188985) 2026-03-27 14:59:42 +01:00