
Serialization HtmlToMarkdown
CertifiedConvert an HTML file from Kestra internal storage into Markdown format
Serialization HtmlToMarkdown
Convert an HTML file from Kestra internal storage into Markdown format
Useful for LLM processing and RAG pipelines where HTML is too verbose — Markdown conveys the same structure with significantly fewer tokens.
type: io.kestra.plugin.serdes.markdown.HtmlToMarkdownExamples
Fetch a web page and convert it to Markdown.
id: web_to_markdown_pipeline
namespace: company.team
tasks:
- id: fetch_html
type: io.kestra.plugin.core.http.Request
uri: "https://kestra.io/docs"
- id: write_html
type: io.kestra.plugin.core.storage.Write
content: "{{ outputs.fetch_html.body }}"
extension: ".html"
- id: convert_to_md
type: io.kestra.plugin.serdes.markdown.HtmlToMarkdown
from: "{{ outputs.write_html.uri }}"
- id: log_result
type: io.kestra.plugin.core.log.Log
message: "{{ outputs.convert_to_md.uri }}"
Convert HTML file to Markdown with custom options.
id: html_to_md_custom
namespace: company.team
tasks:
- id: write_html
type: io.kestra.plugin.core.storage.Write
content: "<h1>Hello</h1><p>This is <strong>bold</strong> text.</p>"
extension: ".html"
- id: convert
type: io.kestra.plugin.serdes.markdown.HtmlToMarkdown
from: "{{ outputs.write_html.uri }}"
ignoreTags:
- script
- style
- nav
Properties
from *Requiredstring
Source file URI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
baseUri string
Base URI for resolving relative links
When provided, relative URLs in the HTML (e.g., href and src attributes) will be resolved to absolute URLs using this base URI.
ignoreTags array
List of HTML tags to ignore during conversion
Tags specified in this list will be skipped during the conversion process. Common tags to ignore include 'script', 'style', 'nav', etc.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
Outputs
uri string
uriURI of the generated Markdown file in Kestra's internal storage
Metrics
bytes counter
Number of bytes generated