clang-tools 10.0.0

Public Member Functions | List of all members
clang::clangd::markup::Document Class Reference

A format-agnostic representation for structured text. More...

`#include <FormattedString.h>`

## Public Member Functions
Paragraph & | addParagraph ()
| Adds a semantical block that will be separate from others. More...
void | addRuler ()
| Inserts a horizontal separator to the document. More...
void | addCodeBlock (std::string Code, std::string Language="cpp")
| Adds a block of code. More...
Paragraph & | addHeading (size_t Level)
| Heading is a special type of paragraph that will be prepended with `Level` many '#'s in markdown. More...
BulletList & | addBulletList ()
std::string | asMarkdown () const
| Doesn't contain any trailing newlines. More...
std::string | asPlainText () const
| Doesn't contain any trailing newlines. More...

## Detailed Description

A format-agnostic representation for structured text.

Allows rendering into markdown and plaintext.

Definition at line 82 of file FormattedString.h.

## Member Function Documentation

## ◆ addBulletList()

BulletList& clang::clangd::markup::Document::addBulletList | ( |  | ) |

Referenced by clang::clangd::HoverInfo::present().

## ◆ addCodeBlock()

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.

## ◆ addHeading()

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.

Referenced by clang::clangd::HoverInfo::present().

## ◆ addParagraph()

Paragraph& clang::clangd::markup::Document::addParagraph | ( |  | ) |

Adds a semantical block that will be separate from others.

Referenced by clang::clangd::HoverInfo::present().

## ◆ addRuler()

void clang::clangd::markup::Document::addRuler | ( |  | ) |

Inserts a horizontal separator to the document.

Referenced by clang::clangd::HoverInfo::present().

## ◆ asMarkdown()

std::string clang::clangd::markup::Document::asMarkdown | ( |  | ) | const

Doesn't contain any trailing newlines.

## ◆ asPlainText()

std::string clang::clangd::markup::Document::asPlainText | ( |  | ) | const

Doesn't contain any trailing newlines.

The documentation for this class was generated from the following file:

- FormattedString.h