Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::TextDocument Struct Reference

Archetype: A text element intended to be displayed in its own text box. More...

#include <rerun/archetypes/text_document.hpp>

Public Types

using IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 TextDocument (TextDocument &&other)=default
 
 TextDocument (rerun::components::Text _text)
 
TextDocument with_media_type (rerun::components::MediaType _media_type) &&
 The Media Type of the text.
 

Public Attributes

rerun::components::Text text
 Contents of the text document.
 
std::optional< rerun::components::MediaTypemedia_type
 The Media Type of the text.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 

Detailed Description

Archetype: A text element intended to be displayed in its own text box.

Supports raw text and markdown.

Example

Markdown text document

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_text_document");
rec.spawn().exit_on_failure();
rec.log("text_document", rerun::TextDocument("Hello, TextDocument!"));
rec.log(
"markdown",
rerun::TextDocument(R"#(# Hello Markdown!
[Click here to see the raw text](recording://markdown:Text).
Basic formatting:
| **Feature** | **Alternative** |
| ----------------- | --------------- |
| Plain | |
| *italics* | _italics_ |
| **bold** | __bold__ |
| ~~strikethrough~~ | |
| `inline code` | |
----------------------------------
## Support
- [x] [Commonmark](https://commonmark.org/help/) support
- [x] GitHub-style strikethrough, tables, and checkboxes
- Basic syntax highlighting for:
- [x] C and C++
- [x] Python
- [x] Rust
- [ ] Other languages
## Links
You can link to [an entity](recording://markdown),
a [specific instance of an entity](recording://markdown[#0]),
or a [specific component](recording://markdown:Text).
Of course you can also have [normal https links](https://github.com/rerun-io/rerun), e.g. <https://rerun.io>.
## Image
![A random image](https://picsum.photos/640/480))#")
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Archetype: A text element intended to be displayed in its own text box.
Definition text_document.hpp:77
TextDocument with_media_type(rerun::components::MediaType _media_type) &&
The Media Type of the text.
Definition text_document.hpp:110
static MediaType markdown()
text/markdown
Definition media_type.hpp:39

Member Function Documentation

◆ with_media_type()

TextDocument rerun::archetypes::TextDocument::with_media_type ( rerun::components::MediaType  _media_type) &&
inline

The Media Type of the text.

For instance:

  • text/plain
  • text/markdown

If omitted, text/plain is assumed.

Member Data Documentation

◆ media_type

std::optional<rerun::components::MediaType> rerun::archetypes::TextDocument::media_type

The Media Type of the text.

For instance:

  • text/plain
  • text/markdown

If omitted, text/plain is assumed.

◆ IndicatorComponentName

constexpr const char rerun::archetypes::TextDocument::IndicatorComponentName[]
staticconstexpr
Initial value:
=
"rerun.components.TextDocumentIndicator"

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