Serialization HtmlToMarkdown

Serialization HtmlToMarkdown

Certified

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.

yaml
type: io.kestra.plugin.serdes.markdown.HtmlToMarkdown

Fetch a web page and convert it to Markdown.

yaml
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.

yaml
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

Source file URI

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.

SubTypestring

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.

Reference (ref) of the pluginDefaults to apply to this task.

Formaturi

URI of the generated Markdown file in Kestra's internal storage

Number of bytes generated