clang-tools 20.0.0git
|
A format-agnostic representation for structured text. More...
#include <Markup.h>
Public Member Functions | |
Document ()=default | |
Document (const Document &Other) | |
Document & | operator= (const Document &) |
Document (Document &&)=default | |
Document & | operator= (Document &&)=default |
void | append (Document Other) |
Paragraph & | addParagraph () |
Adds a semantical block that will be separate from others. | |
void | addRuler () |
Inserts a horizontal separator to the document. | |
void | addCodeBlock (std::string Code, std::string Language="cpp") |
Adds a block of code. | |
Paragraph & | addHeading (size_t Level) |
Heading is a special type of paragraph that will be prepended with Level many '#'s in markdown. | |
BulletList & | addBulletList () |
std::string | asMarkdown () const |
Doesn't contain any trailing newlines. | |
std::string | asPlainText () const |
Doesn't contain any trailing newlines. | |
A format-agnostic representation for structured text.
Allows rendering into markdown and plaintext.
|
default |
|
inline |
|
default |
BulletList & clang::clangd::markup::Document::addBulletList | ( | ) |
Definition at line 493 of file Markup.cpp.
References Children.
void clang::clangd::markup::Document::addCodeBlock | ( | std::string | Code, |
std::string | Language = "cpp" |
||
) |
Adds a block of code.
This translates to a ``` block in markdown. In plain text representation, the code block will be surrounded by newlines.
Definition at line 480 of file Markup.cpp.
References Children.
Paragraph & clang::clangd::markup::Document::addHeading | ( | size_t | Level | ) |
Heading is a special type of paragraph that will be prepended with Level
many '#'s in markdown.
Definition at line 498 of file Markup.cpp.
References Children.
Paragraph & clang::clangd::markup::Document::addParagraph | ( | ) |
Adds a semantical block that will be separate from others.
Definition at line 473 of file Markup.cpp.
References Children.
Referenced by clang::clangd::CodeCompletion::render().
void clang::clangd::markup::Document::addRuler | ( | ) |
Inserts a horizontal separator to the document.
Definition at line 478 of file Markup.cpp.
References Children.
void clang::clangd::markup::Document::append | ( | Document | Other | ) |
Definition at line 468 of file Markup.cpp.
References Children.
Referenced by operator=(), and clang::clangd::CodeCompletion::render().
std::string clang::clangd::markup::Document::asMarkdown | ( | ) | const |
Doesn't contain any trailing newlines.
We try to make the markdown human-readable, e.g. avoid extra escaping. At least one client (coc.nvim) displays the markdown verbatim!
Definition at line 485 of file Markup.cpp.
References Children, and clang::clangd::markup::Block::renderMarkdown().
std::string clang::clangd::markup::Document::asPlainText | ( | ) | const |
Doesn't contain any trailing newlines.
Definition at line 489 of file Markup.cpp.
References Children, and clang::clangd::markup::Block::renderPlainText().
Definition at line 461 of file Markup.cpp.