Skip to content

Logging HTML#

Uploading a HTML file#

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

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

See example in Neptune 

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.new.types import File

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

See example in Neptune