Skip to content

Log HTML#

Uploading a HTML file#

You can upload HTML as any other file and display it interactively in the Neptune app:

run["html"].upload("button_example.html")

You'll find it in the All metadata tab.

Tip

You can display the HTML file by creating a dashboard and adding a File preview widget.

Logging a HTML string object#

Create your HTML string and file:

html_str = (
    "<button type='button', style='background-color:#005879; width:400px; "
    "height:400px; font-size:30px'> <a style='color: #ccc', "
    "href='https://docs.neptune.ai'>Take me back to the docs!<a> </button>"
)

with open("sample.html", "w") as f:
    f.write(html_str)

Using File.from_content(), upload the file to Neptune:

from neptune.types import File

run["html_obj"].upload(File.from_content(html_str, extension="html"))

See example in Neptune