[Mlir-commits] [mlir] 5c09caf - [MLIR][doc] Make summary appear different than discription

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Jun 10 10:19:59 PDT 2023


Author: rikhuijzer
Date: 2023-06-10T19:18:46+02:00
New Revision: 5c09caf55eb701d37ef4770f4ab178a71ca7e387

URL: https://github.com/llvm/llvm-project/commit/5c09caf55eb701d37ef4770f4ab178a71ca7e387
DIFF: https://github.com/llvm/llvm-project/commit/5c09caf55eb701d37ef4770f4ab178a71ca7e387.diff

LOG: [MLIR][doc] Make summary appear different than discription

This patch aims to clarify which part of the docs is the summary and which
part is the description.

I did a preview of the output and think the suggested bold and italic style
is much clearer and looks reasonably nice.

I've considered also to enforce capitalization of the first letter of the
summary and ending with a dot (as discussed in
https://reviews.llvm.org/D151649), but it seems to me that the tradeoff in
extra test running time is not worth it. Currently, `emitOpDoc` is not
triggered for every `summary` during `check-mlir`.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D152621

Added: 
    

Modified: 
    mlir/tools/mlir-tblgen/OpDocGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-tblgen/OpDocGen.cpp b/mlir/tools/mlir-tblgen/OpDocGen.cpp
index 7c2f1e1ce51eb..61def4435e00e 100644
--- a/mlir/tools/mlir-tblgen/OpDocGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDocGen.cpp
@@ -160,7 +160,7 @@ static void emitOpDoc(const Operator &op, raw_ostream &os) {
 
   // Emit the summary, syntax, and description if present.
   if (op.hasSummary())
-    os << "\n" << op.getSummary() << "\n\n";
+    os << "\n**Summary:** _" << op.getSummary() << "_\n\n";
   if (op.hasAssemblyFormat())
     emitAssemblyFormat(op.getOperationName(), op.getAssemblyFormat().trim(),
                        os);


        


More information about the Mlir-commits mailing list