clang-tools 20.0.0git
|
Represents parts of the markup that can contain strings, like inline code, code block or plain text. More...
#include <Markup.h>
Public Member Functions | |
void | renderMarkdown (llvm::raw_ostream &OS) const override |
void | renderPlainText (llvm::raw_ostream &OS) const override |
std::unique_ptr< Block > | clone () const override |
Paragraph & | appendText (llvm::StringRef Text) |
Append plain text to the end of the string. | |
Paragraph & | appendCode (llvm::StringRef Code, bool Preserve=false) |
Append inline code, this translates to the ` block in markdown. | |
Paragraph & | appendSpace () |
Ensure there is space between the surrounding chunks. | |
Public Member Functions inherited from clang::clangd::markup::Block | |
virtual void | renderMarkdown (llvm::raw_ostream &OS) const =0 |
virtual void | renderPlainText (llvm::raw_ostream &OS) const =0 |
virtual std::unique_ptr< Block > | clone () const =0 |
std::string | asMarkdown () const |
std::string | asPlainText () const |
virtual bool | isRuler () const |
virtual | ~Block ()=default |
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.
Paragraph & clang::clangd::markup::Paragraph::appendCode | ( | llvm::StringRef | Code, |
bool | Preserve = false |
||
) |
Append inline code, this translates to the ` block in markdown.
Preserve
indicates the code span must be apparent even in plaintext.
Definition at line 436 of file Markup.cpp.
References C.
Referenced by clang::clangd::HoverInfo::present(), and clang::clangd::CodeCompletion::render().
Paragraph & clang::clangd::markup::Paragraph::appendSpace | ( | ) |
Ensure there is space between the surrounding chunks.
Has no effect at the beginning or end of a paragraph.
Definition at line 417 of file Markup.cpp.
Referenced by clang::clangd::HoverInfo::present().
Paragraph & clang::clangd::markup::Paragraph::appendText | ( | llvm::StringRef | Text | ) |
Append plain text to the end of the string.
Definition at line 423 of file Markup.cpp.
References C, and clang::clangd::Text.
Referenced by clang::clangd::HoverInfo::present(), and clang::clangd::CodeCompletion::render().
|
overridevirtual |
Implements clang::clangd::markup::Block.
Definition at line 367 of file Markup.cpp.
|
overridevirtual |
Implements clang::clangd::markup::Block.
Definition at line 344 of file Markup.cpp.
|
overridevirtual |
Implements clang::clangd::markup::Block.
Definition at line 382 of file Markup.cpp.
References C, clang::clangd::markup::chooseMarker(), and OS.