| name | fetch-url-to-md |
| description | Convert a URL to a Markdown file while removing images. Use this skill when the user wants to fetch a webpage and convert it to a clean Markdown format for documentation, analysis, or archiving. It uses curl to fetch the URL and pandoc with specific flags to ensure a high-quality Markdown output. |
Url To Markdown
Overview
This skill converts a URL to a Markdown file using curl and pandoc. It removes images to ensure a clean, text-focused Markdown document.
Quick Start
To convert a URL to Markdown:
/Users/rubens/projects/myskills/skills/fetch-url-to-md/scripts/fetch_to_md.sh <URL> <OUTPUT_FILENAME.md>
Example:
/Users/rubens/projects/myskills/skills/fetch-url-to-md/scripts/fetch_to_md.sh https://example.com/article example_article.md
Configuration
The skill uses pandoc with the following flags to ensure a robust Markdown output:
-f html: Input format is HTML.
-t markdown-raw_html-native_divs-native_spans-fenced_divs-bracketed_spans-header_attributes-link_attributes-fenced_code_attributes: Targeted Markdown format with several extensions disabled or enabled for a cleaner result.
--wrap=none: Prevents automatic line wrapping.
--lua-filter=remove-images.lua: Uses a Lua filter to remove all <img> tags.
Resources
scripts/
fetch_to_md.sh: A shell script that automates the download and conversion process.
assets/
remove-images.lua: A Pandoc Lua filter that removes image elements from the document.