Go to the documentation of this file.
12 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_MARKUP_H
13 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_MARKUP_H
15 #include "llvm/Support/raw_ostream.h"
32 virtual std::unique_ptr<Block>
clone()
const = 0;
36 virtual bool isRuler()
const {
return false; }
37 virtual ~Block() =
default;
47 std::unique_ptr<Block>
clone()
const override;
67 bool Preserve =
false;
72 bool SpaceBefore =
false;
73 bool SpaceAfter =
false;
75 std::vector<Chunk> Chunks;
84 std::unique_ptr<Block>
clone()
const override;
89 std::vector<class Document> Items;
125 std::vector<std::unique_ptr<Block>> Children;
std::string asPlainText() const
Doesn't contain any trailing newlines.
Represents a sequence of one or more documents.
Represents parts of the markup that can contain strings, like inline code, code block or plain text.
std::unique_ptr< Block > clone() const override
virtual void renderMarkdown(llvm::raw_ostream &OS) const =0
Paragraph & appendText(llvm::StringRef Text)
Append plain text to the end of the string.
void addCodeBlock(std::string Code, std::string Language="cpp")
Adds a block of code.
Holds text and knows how to lay it out.
Paragraph & addParagraph()
Adds a semantical block that will be separate from others.
Document(const Document &Other)
A format-agnostic representation for structured text.
BulletList & addBulletList()
void addRuler()
Inserts a horizontal separator to the document.
void renderMarkdown(llvm::raw_ostream &OS) const override
std::string asMarkdown() const
std::string asMarkdown() const
Doesn't contain any trailing newlines.
Paragraph & appendSpace()
Ensure there is space between the surrounding chunks.
void renderMarkdown(llvm::raw_ostream &OS) const override
Paragraph & addHeading(size_t Level)
Heading is a special type of paragraph that will be prepended with Level many '#'s in markdown.
void renderPlainText(llvm::raw_ostream &OS) const override
void append(Document Other)
Document & operator=(const Document &)
Paragraph & appendCode(llvm::StringRef Code, bool Preserve=false)
Append inline code, this translates to the ` block in markdown.
std::string asPlainText() const
virtual bool isRuler() const
std::unique_ptr< Block > clone() const override
virtual void renderPlainText(llvm::raw_ostream &OS) const =0
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::raw_string_ostream OS
virtual std::unique_ptr< Block > clone() const =0
class Document & addItem()
void renderPlainText(llvm::raw_ostream &OS) const override