@zack/html-to-markdown

Convert raw HTML into Markdown and plain text, with optional main-content extraction.

Z
@zack
Publication time unavailable7 installs · all versions

Get started

Install, run, or load this Tool.

Run directly with the CLI or call from an SDK

01Install

Resolve this exact Tool version and its prepared dependencies.

agentpm install @zack/html-to-markdown@0.1.1

02Run Tool

Send JSON to its declared input contract and receive JSON output.

agentpm run @zack/html-to-markdown@0.1.1 --input-file input.json

Supply input.json matching this Tool’s input schema.

ORLoad via SDK

Call the installed Tool through an SDK.

import { load } from '@agentpm/sdk';
const t = await load('@zack/html-to-markdown@0.1.1');
CLI version & updates

CLI 0.1.36+ reads and preserves standard declarations. New publications require an explicit supported standard; use the latest CLI for current authoring checks. Historical releases remain installable as published. This floor does not establish selected-release installation support or Harness readiness.

Check agentpm --version, then follow the CLI installation and update guide. See the publication compatibility requirements.

html-to-markdown

What it does

Convert raw HTML into Markdown and plain text, with optional main-content extraction.

AgentPM manifest

See agent.json in this folder. It declares:

  • "kind": "tool", "runtime": { "type": "node", "version": "20" }
  • "entrypoint": { "command": "node", "args": ["dist/index.js"] }
  • JSON Schema for inputs and outputs

Quirks

  • Use HTML2MD_DEFAULT_BASE_URL to define default base URL used to resolve relative links when base_url is not provided in inputs.
  • node_modules is packaged with this tool to handle jsdom issues when not externalized with esbuild

Entrypoint reads JSON from stdin and prints a single JSON object to stdout.

Setup & run


# install and build

pnpm -C tools-node/html-to-markdown build

# set env and run

echo '{"url":"https://agentpackagemanager.com"}' \
  | node tools-node/http-fetch/dist/index.js \
  | jq -r 'select(.ok == true) | {html: .body_text, main_content_only: true, base_url: "https://agentpackagemanager.com"} | @json' \
  | node tools-node/html-to-markdown/dist/index.js \
  | jq -r '.markdown'
  
@zack/html-to-markdown v0.1.1 · AgentPM™