MCPcopy Create free account
hub / github.com/datapane/datapane / Code

Class Code

python-client/src/datapane/blocks/text.py:103–124  ·  view source on GitHub ↗

The code block allows you to embed syntax-highlighted source code into your app. !!! note This block currently supports Python and JavaScript.

Source from the content-addressed store, hash-verified

101
102
103class Code(EmbeddedTextBlock):
104 """
105 The code block allows you to embed syntax-highlighted source code into your app.
106
107 !!! note
108 This block currently supports Python and JavaScript.
109 """
110
111 _tag = "Code"
112
113 def __init__(
114 self, code: str, language: str = "python", caption: str = None, name: BlockId = None, label: str = None
115 ):
116 """
117 Args:
118 code: The source code
119 language: The language of the code, most common languages are supported (optional - defaults to Python)
120 caption: A caption to display below the Code (optional)
121 name: A unique name for the block to reference when adding text or embedding (optional)
122 label: A label used when displaying the block (optional)
123 """
124 super().__init__(content=code, language=language, caption=caption, name=name, label=label)
125
126
127class HTML(EmbeddedTextBlock):

Callers 1

cells_to_blocksFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected