### Basic URL to Markdown Conversion Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/examples/usage.md Fetches a given URL and returns its content as clean Markdown. This is the default behavior of the skill. ```bash /url-to-markdown https://developers.cloudflare.com/browser-rendering/ ``` -------------------------------- ### URL to Markdown Conversion with Raw JSON Output Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/examples/usage.md Retrieves the full API response, including metadata, in JSON format. This is useful for programmatic access to the conversion results. ```bash /url-to-markdown https://example.com --json ``` -------------------------------- ### Install url-to-markdown Skill (Bash) Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/README.md Provides bash commands to copy the url-to-markdown skill to either the personal Claude skills directory (for all projects) or a project-specific directory. ```bash cp -r url-to-markdown-skill ~/.claude/skills/url-to-markdown ``` ```bash cp -r url-to-markdown-skill .claude/skills/url-to-markdown ``` -------------------------------- ### markdown.new API Request with Image Retention and Browser Rendering (Bash) Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Shows how to use the markdown.new API with specific options enabled. This example requests that images be retained in the Markdown output and forces the use of browser rendering for potentially JavaScript-heavy websites. The URL provided is for the React.dev learning section. ```bash # With image retention and browser rendering curl -s 'https://markdown.new/' \ -H 'Content-Type: application/json' \ -d '{"url": "https://react.dev/learn", "retain_images": true, "method": "browser"}' ``` -------------------------------- ### URL to Markdown Conversion with Browser Rendering Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/examples/usage.md Forces headless browser rendering for JavaScript-heavy websites or single-page applications. This ensures that content requiring JavaScript to display is correctly captured. ```bash /url-to-markdown https://react.dev/learn --browser ``` -------------------------------- ### URL to Markdown Conversion with Combined Flags Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/examples/usage.md Combines browser rendering and image retention flags for comprehensive conversion of complex web pages. This ensures JavaScript-rendered content is captured with its images intact. ```bash /url-to-markdown https://docs.github.com/en/rest --images --browser ``` -------------------------------- ### URL to Markdown Conversion with Image Retention Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/examples/usage.md Converts a URL to Markdown while preserving image syntax (e.g., `![alt](url)`). This is useful for maintaining visual elements from the original webpage. ```bash /url-to-markdown https://blog.cloudflare.com/some-post --images ``` -------------------------------- ### Parsing markdown.new API Response with Python (Bash) Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt This example demonstrates how to make a request to the markdown.new API and then parse the JSON response using Python. It specifically extracts and prints the 'content' field if the conversion was successful, or prints an error message to stderr otherwise. This is useful for integrating the API into Python-based workflows. ```bash # Parse response with Python curl -s 'https://markdown.new/' \ -H 'Content-Type: application/json' \ -d '{"url": "https://example.com"}' | python3 -c " import sys, json data = json.load(sys.stdin) if data.get('success'): print(data['content']) else: print('Error:', data.get('error', 'Unknown error'), file=sys.stderr) sys.exit(1) " ``` -------------------------------- ### Claude Code Skill: Combine Multiple Flags Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Provides an example of combining multiple flags with the `/url-to-markdown` Claude Code skill. This command uses both `--images` to retain image syntax and `--browser` to force browser rendering, demonstrating the flexibility of the skill for complex conversion needs. ```shell # Combine multiple flags /url-to-markdown https://docs.github.com/en/rest --images --browser ``` -------------------------------- ### Claude Code Skill: Get Raw JSON Response Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Explains how to use the `--json` flag with the `/url-to-markdown` Claude Code skill. This flag modifies the output to be the raw JSON response from the markdown.new API, including metadata like success status, title, conversion method, and duration, instead of just the Markdown content. ```shell # Get full JSON response with metadata /url-to-markdown https://example.com --json ``` -------------------------------- ### POST /markdown.new Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/SKILL.md Converts a given URL to Markdown format. Supports options for retaining images and forcing browser rendering. ```APIDOC ## POST /markdown.new ### Description Converts a given URL to clean, readable Markdown format using the markdown.new service. This endpoint allows for customization through query parameters. ### Method POST ### Endpoint `https://markdown.new/` ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the web page to convert. - **images** (boolean) - Optional - If `true`, retains images in the Markdown output. Defaults to `false`. - **browser** (boolean) - Optional - If `true`, forces browser rendering for JavaScript-heavy sites. Defaults to `false`. - **json** (boolean) - Optional - If `true`, returns the raw JSON response instead of just the Markdown content. Defaults to `false`. ### Request Body This endpoint does not typically use a request body when called directly via curl with JSON data. The parameters are usually passed in the JSON payload. ```json { "url": "", "retain_images": , "method": "" } ``` ### Request Example #### Using curl with flags: ```bash curl -s 'https://markdown.new/' \ -H 'Content-Type: application/json' \ -d '{"url": "https://example.com", "retain_images": true, "method": "browser"}' ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the conversion was successful. - **url** (string) - The original URL that was processed. - **title** (string) - The title of the web page. - **content** (string) - The converted Markdown content of the page. - **method** (string) - The rendering method used (e.g., "Cloudflare Workers AI"). - **duration_ms** (integer) - The time taken for the conversion in milliseconds. #### Error Response (Non-200 Status or `success: false` in JSON) - **success** (boolean) - Always `false`. - **error** (string) - A message describing the error that occurred. #### Response Example (Success) ```json { "success": true, "url": "https://example.com", "title": "Example Domain", "content": "# Example Domain\n\nThis domain is for use in illustrative examples in documents. You may use this\ncontent freely.", "method": "auto", "duration_ms": 150 } ``` #### Response Example (Error) ```json { "success": false, "url": "https://invalid-url.xyz", "error": "Failed to fetch URL: DNS resolution failed.", "method": "auto", "duration_ms": 50 } ``` ``` -------------------------------- ### Usage of url-to-markdown Skill (CLI) Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/README.md Demonstrates the command-line usage of the url-to-markdown skill, including the required URL argument and optional flags for controlling output. ```bash /url-to-markdown [--images] [--browser] [--json] ``` -------------------------------- ### Call markdown.new API with Bash Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/SKILL.md This snippet demonstrates how to call the markdown.new API using curl in Bash. It constructs a JSON payload with the URL and optional flags for retaining images and specifying the rendering method. The output is captured for further processing. ```bash curl -s 'https://markdown.new/' \ -H 'Content-Type: application/json' \ -d '{"url": "", "retain_images": , "method": ""}' ``` -------------------------------- ### Basic markdown.new API Request (Bash) Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Demonstrates a basic curl request to the markdown.new API endpoint for URL-to-Markdown conversion. It sends a JSON payload with the target URL and optional parameters, expecting a JSON response containing the converted content and metadata. The default method is 'auto' and images are not retained. ```bash # Basic conversion request curl -s 'https://markdown.new/' \ -H 'Content-Type: application/json' \ -d '{"url": "https://example.com", "retain_images": false, "method": "auto"}' # Response format: # { # "success": true, # "url": "https://example.com", # "title": "Example Domain", # "content": "# Example Domain\n\nThis domain is for use in illustrative examples...", # "method": "Cloudflare Workers AI", # "duration_ms": 42 # } ``` -------------------------------- ### Claude Code Skill: Basic URL to Markdown Conversion Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Illustrates the basic usage of the `/url-to-markdown` Claude Code skill command. This command takes a URL as an argument and converts its content to Markdown. No additional flags are specified, so default settings (no image retention, auto rendering method) are applied. ```shell # Basic conversion /url-to-markdown https://developers.cloudflare.com/browser-rendering/ ``` -------------------------------- ### markdown.new API Endpoint Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt The core API endpoint for converting a given URL to Markdown. It accepts a JSON payload with the URL and optional parameters for image retention and rendering method. The response includes the converted Markdown, page title, conversion method, and timing information. ```APIDOC ## POST /markdown.new API Endpoint ### Description Converts a given URL to clean, readable Markdown. Supports options for retaining images and choosing the rendering method (auto or browser). ### Method POST ### Endpoint https://markdown.new/ ### Parameters #### Request Body - **url** (string) - Required - The URL to convert to markdown. - **retain_images** (boolean) - Optional - Defaults to `false`. If `true`, image syntax (`![alt](url)`) is retained in the output. - **method** (string) - Optional - Defaults to `"auto"`. Specifies the conversion method. Accepts `"auto"` (prioritizes fast HTML parsing) or `"browser"` (uses headless browser rendering for JavaScript-heavy sites). ### Request Example ```json { "url": "https://example.com", "retain_images": false, "method": "auto" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the conversion was successful. - **url** (string) - The original URL that was converted. - **title** (string) - The title of the web page. - **content** (string) - The converted Markdown content. - **method** (string) - The conversion method used (e.g., "Cloudflare Workers AI", "Headless Browser"). - **duration_ms** (number) - The time taken for the conversion in milliseconds. #### Error Response (non-200) - **success** (boolean) - Always `false`. - **url** (string) - The original URL. - **error** (string) - A message describing the error. #### Response Example (Success) ```json { "success": true, "url": "https://example.com", "title": "Example Domain", "content": "# Example Domain\n\nThis domain is for use in illustrative examples...", "method": "Cloudflare Workers AI", "duration_ms": 42 } ``` #### Response Example (Error) ```json { "success": false, "url": "https://invalid-url.xyz", "error": "Failed to fetch URL: DNS resolution failed" } ``` ``` -------------------------------- ### Claude Code Skill Command: /url-to-markdown Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt A command-line interface within Claude Code to convert URLs to Markdown. Supports various flags for customization, including image retention, browser rendering, and raw JSON output. ```APIDOC ## Claude Code Skill Command: /url-to-markdown ### Description Provides a convenient way to convert web page content to Markdown directly within Claude Code sessions using natural language prompts or direct commands. ### Usage `/url-to-markdown [URL] [FLAGS]` ### Parameters - **URL** (string) - Required - The URL of the web page to convert. ### Flags - **--images** (boolean) - Optional - Retains image markdown syntax (`![alt](url)`) in the output. - **--browser** (boolean) - Optional - Forces the use of the headless browser rendering method, suitable for JavaScript-heavy sites. - **--json** (boolean) - Optional - Outputs the full JSON response from the markdown.new API, including metadata like title, method, and duration, instead of just the Markdown content. ### Examples #### Basic Conversion ``` /url-to-markdown https://developers.cloudflare.com/browser-rendering/ ``` #### Retain Images ``` /url-to-markdown https://blog.cloudflare.com/some-post --images ``` #### Force Browser Rendering ``` /url-to-markdown https://react.dev/learn --browser ``` #### Get Raw JSON Output ``` /url-to-markdown https://example.com --json ``` #### Combine Flags ``` /url-to-markdown https://docs.github.com/en/rest --images --browser ``` ### Natural Language Invocation Claude Code can automatically trigger this skill with prompts such as: - "Convert this URL to markdown: https://example.com" - "Fetch the content of https://developers.cloudflare.com as markdown, keeping images." - "Use the url-to-markdown skill to get the markdown for https://react.dev/learn, forcing browser rendering." ``` -------------------------------- ### Claude Code Skill: Force Browser Rendering Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Demonstrates the use of the `--browser` flag with the `/url-to-markdown` Claude Code skill. This flag forces the skill to use a headless browser for rendering the target URL, which is essential for accurately converting content from modern JavaScript-heavy Single Page Applications (SPAs). ```shell # Force browser rendering for JavaScript-heavy sites /url-to-markdown https://react.dev/learn --browser ``` -------------------------------- ### Claude Code Skill: Retain Images in Markdown Output Source: https://context7.com/markdown-new/url-to-markdown-skill/llms.txt Shows how to use the `--images` flag with the `/url-to-markdown` Claude Code skill. This flag instructs the skill to preserve image references (e.g., `![alt](url)`) within the generated Markdown output, which is useful for maintaining visual context or links to images. ```shell # Keep images in output (retains ![alt](url) syntax) /url-to-markdown https://blog.cloudflare.com/some-post --images ``` -------------------------------- ### Parse markdown.new API JSON response with Python Source: https://github.com/markdown-new/url-to-markdown-skill/blob/main/url-to-markdown/SKILL.md This code snippet uses Python 3 to parse the JSON response from the markdown.new API. It loads the JSON from standard input, checks for a successful conversion, and prints the Markdown content or an error message to standard error. This is useful for integrating the API call into scripts. ```python import sys, json data = json.load(sys.stdin) if data.get('success'): print(data['content']) else: print('Error:', data.get('error', 'Unknown error'), file=sys.stderr) sys.exit(1) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.