//===--- Markup.h -------------------------------------------*- C++-*------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // A model of formatted text that can be rendered to plaintext or markdown. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_MARKUP_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_MARKUP_H #include "llvm/Support/raw_ostream.h" #include <cstddef> #include <memory> #include <string> #include <vector> namespace clang { namespace clangd { namespace markup { /// Holds text and knows how to lay it out. Multiple blocks can be grouped to /// form a document. Blocks include their own trailing newlines, container /// should trim them if need be. class Block { … }; /// Represents parts of the markup that can contain strings, like inline code, /// code block or plain text. /// One must introduce different paragraphs to create separate blocks. class Paragraph : public Block { … }; /// Represents a sequence of one or more documents. Knows how to print them in a /// list like format, e.g. by prepending with "- " and indentation. class BulletList : public Block { … }; /// A format-agnostic representation for structured text. Allows rendering into /// markdown and plaintext. class Document { … }; } // namespace markup } // namespace clangd } // namespace clang #endif