Skip to content

Code

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

Simple Code Block

import datapane as dp

code = """
function foo(n) {
  return foo(n + 1)
}
"""

app = dp.App(dp.Code(code=code, language="javascript"))
app.save(path="simple-code.html")