Home

HTML

Introduction

HTML (HyperText Markup Language) is the standard markup language for structuring and displaying content on the web. Stencila provides bi-directional conversion between Stencila documents and HTML.

Usage

Use the .html file extension, or the --to html or --from html options, when converting to/from HTML e.g.

stencila convert doc.smd doc.html
Note

Stencila also provides a DOM HTML format intended for document previewing, and an Email HTML format optimized for email clients. Plain HTML is best suited for general-purpose web publishing.

Warning

Stencila's HTML support is in alpha status. If you find bugs or unexpected results please file an issue.

Implementation

Stencila supports bi-directional conversion between Stencila documents and HTML. Parsing of HTML uses the tl Rust crate. Encoding to HTML is implemented via derived trait methods in codec-html-trait.

Limitations

  • Decoding from HTML is lossy for elements that have no Stencila Schema equivalent (e.g. <div> layout, <form> elements, custom attributes).

  • CSS styling and JavaScript are not preserved during import.

  • HTML is always decoded as an Article; other root node types are not inferred from HTML structure.

© 2026 Stencila