One of the challenges with building reports in Python is working with long chunks of text. To make this easier, we've introduced a Markdown editor on the web, where you can build rich long-form reports for articles or tutorials and seamlessly include interactive elements from your Python environment.
You can also create a TextReport directly in Python by running the following code (just make sure to pass in real objects for
You can get started writing straight away with Markdown - check out this cheat sheet for more information or use the formatting icons at the top of the text area.
For example, try the following Markdown in the Text editor:
# This is a heading**This is bold text***This is text in italics*- These- are1. list2. items> This is a quote[Click me](thisisalink.com)
This will generate a report which looks as follows:
Aside from Markdown, you can enrich your report by adding different blocks.
You can insert these blocks directly into your report from the editor, and edit the content inside the blocks (parameters follow YAML syntax so make sure you get your indentations correct). For example, clicking on the Formula block will insert the following snippet into the web editor:
```datapaneblock: Formulaformula: x^2 + y^2 = z^2```
When you click 'Preview', you'll see this display as follows:
For more information check out the pages about the block types:
You can push up assets to your existing report from Python by passing in the report
id to a TextReport object, like this:
(You'll need to replace
plot with your own assets).
As mentioned above, you can also create a Markdown Report directly from your Python script or notebook. In that case, you'll need to use the
name parameter instead, as follows:
dp.TextReport(df=df, plot=plot).upload(name="My First Report")