[clang-tools-extra] [clang-doc] add support for block commands in clang-doc html output (PR #101108)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 31 09:17:48 PDT 2024


================
@@ -632,6 +633,19 @@ static std::unique_ptr<HTMLNode> genHTML(const CommentInfo &I) {
     return std::move(ParagraphComment);
   }
 
+  if (I.Kind == "BlockCommandComment") {
+    auto BlockComment = std::make_unique<TagNode>(HTMLTag::TAG_DIV);
+    auto Command = std::make_unique<TagNode>(HTMLTag::TAG_DIV, I.Name);
+    BlockComment->Children.emplace_back(std::move(Command));
+    for (const auto &Child : I.Children) {
+      std::unique_ptr<HTMLNode> Node = genHTML(*Child);
+      if (Node)
+        BlockComment->Children.emplace_back(std::move(Node));
+    }
+    if (BlockComment->Children.empty())
+      return nullptr;
+    return std::move(BlockComment);
----------------
PeterChou1 wrote:

I could add another pr once this is merged to refactor some of this

https://github.com/llvm/llvm-project/pull/101108


More information about the cfe-commits mailing list