### API v2 Parameter Usage Example (cURL) Source: https://heckyesmarkdown.com/api/index Example demonstrating how to use cURL to interact with the API v2. It shows the required 'url' parameter and an optional 'readability' parameter. Parameter keys can often be shortened to their first unique letter. ```bash curl 'https://heckyesmarkdown.com/api/2/?u=https://brettterpstra.com&read=0' ``` -------------------------------- ### API v2 Endpoint Example Source: https://heckyesmarkdown.com/api/index This is the base endpoint for the API v2. You can append query parameters to customize the conversion process. Both heckyesmarkdown.com and fuckyeahmarkdown.com are functional mirrors. ```http https://heckyesmarkdown.com/api/2/?[query string] ``` -------------------------------- ### API v2 HTML Processing Example (cURL) Source: https://heckyesmarkdown.com/api/index This example shows how to use the 'html' parameter to send raw HTML content directly to the API for conversion. The 'url' parameter can be optionally provided to serve as a base for relative links and as a source identifier. ```bash curl -X POST -d "html=

This is bold HTML.

" https://heckyesmarkdown.com/api/2/?url=http://example.com&title=My%20HTML%20Content ``` -------------------------------- ### Fetch JSON data with link parameter Source: https://heckyesmarkdown.com/api/index This example shows how to fetch JSON data from a URL and generate a specific type of link (e.g., 'obsidian') using the 'link' parameter. The output includes all fields from the basic JSON request, plus an additional 'link' field with the generated URL. ```bash curl "https://fuckyeahmarkdown.com/go/?u=https://example.com&json=1&link=obsidian" ``` -------------------------------- ### Fetch HTML with style parameter Source: https://heckyesmarkdown.com/api/index This command demonstrates fetching content from a URL and applying a specific style ('swiss') for HTML output. The 'read=1' parameter likely indicates a request for rendered content, and the style parameter modifies the HTML presentation. ```bash curl 'https://heckyesmarkdown.com/api/2/?u=https://brettterpstra.com&read=1&style=swiss' ``` -------------------------------- ### POST /api/2/ Source: https://heckyesmarkdown.com/api/index Converts a given URL to Markdown. Parameters are passed as query strings. The 'url' parameter is required. ```APIDOC ## POST /api/2/ ### Description Converts a given URL to Markdown. Parameters are passed as query strings. The `url` parameter is required, all other parameters are optional. ### Method POST ### Endpoint `https://heckyesmarkdown.com/api/2/` ### Parameters #### Query Parameters - **u** (string) - Required - Target url to markdownify. Can be shortened to `url`. - **c** (boolean) - Optional - Output complete HTML page with head/body tags. Default: `false`. Can be shortened to `complete`. - **f** (string) - Optional - Markup format. See Valid formats. Default: `markdown_mmd`. Can be shortened to `format`. - **i** (boolean) - Optional - Use inline link format. Default: `true`. Can be shortened to `inline`. - **icss** (boolean) - Optional - Embed CSS from linked stylesheets. Default: `false`. Can be shortened to `import_css`. - **j** (boolean) - Optional - Output JSON { output, html, url, title }. Default: `false`. Can be shortened to `json`. - **l** (boolean) - Optional - App-specific url. Link Formats. Default: `false`. Can be shortened to `link`. - **o** (boolean) - Optional - Open link automatically. Default: `false`. Can be shortened to `open`. - **output** (string) - Optional - Output format. Values: `complete`, `html`, `markdown`, `url`. Default: `markdown`. - **r** (boolean) - Optional - Use Readability to remove cruft. Default: `false`. Can be shortened to `readability`. - **sf** (boolean) - Optional - Output the Marky results page. Default: `false`. Can be shortened to `showframe`. - **s** (string) - Optional - CSS style (HTML output). Default: `none`. Can be shortened to `style`. - **html** (string) - Optional - If provided, process raw HTML (URL encoded). Default: `none`. - **t** (string) - Optional - If provided, use instead of extracting title. Default: `none`. Can be shortened to `title`. ### Request Example ```json { "example": "curl 'https://heckyesmarkdown.com/api/2/?u=https://brettterpstra.com&read=0'" } ``` ### Response #### Success Response (200) - **output** (string) - The converted Markdown content. - **html** (string) - The generated HTML snippet or full page. - **url** (string) - The original URL processed. - **title** (string) - The title of the document. #### Response Example ```json { "example": "{\"output\": \"# Title\n\nContent...\", \"html\": \"

Title

Content...

\", \"url\": \"https://example.com\", \"title\": \"Example Page Title\"}" } ``` ``` -------------------------------- ### Fetch JSON data from URL Source: https://heckyesmarkdown.com/api/index This snippet demonstrates how to fetch JSON data from a given URL using curl. It includes parameters for specifying the output format as JSON and for encoding the URL. The response contains the original URL, the markup content, the rendered HTML, and the document title. ```bash curl "https://fuckyeahmarkdown.com/go/?u=https://example.com&json=1" ``` -------------------------------- ### Bookmarklet for Opening Current Page in Marky Source: https://heckyesmarkdown.com/api/index A JavaScript bookmarklet to open the current webpage in Marky, allowing for conversion and processing. ```APIDOC ## Bookmarklet ### Description Opens the current page in Marky using a JavaScript bookmarklet. This allows for conversion and processing of the current URL. ### Code ```javascript javascript:(function(){var nvwin = window.open("","nvwin","status=no,toolbar=no,width=400,height=250,location=no,menubar=no,resizable,scrollbars");nvwin.document.title = "Saving";nvwin.window.location = `https://heckyesmarkdown.com/api/2/?link=nvultra&open=1&read=1&u=${encodeURIComponent(document.location.href)}`;})(); ``` ``` -------------------------------- ### Bookmarklet to open page in Marky Source: https://heckyesmarkdown.com/api/index This JavaScript bookmarklet allows users to open the current web page in Marky with specific parameters. It encodes the current URL and constructs a link for the 'nvultra' application, opening it in a new window with options to read and automatically open the link. ```javascript javascript:(function(){var nvwin = window.open("","nvwin","status=no,toolbar=no,width=400,height=250,location=no,menubar=no,resizable,scrollbars");nvwin.document.title = "Saving";nvwin.window.location = `https://heckyesmarkdown.com/api/2/?link=nvultra&open=1&read=1&u=${encodeURIComponent(document.location.href)}`;})(); ``` -------------------------------- ### Convert URL to JSON with Markup and HTML Source: https://heckyesmarkdown.com/api/index This endpoint converts a given URL to various markup formats and provides JSON output including the original URL, markup, rendered HTML, and title. It accepts a `json=1` parameter for JSON output. ```APIDOC ## POST /go/ ### Description Converts a given URL to various markup formats and provides JSON output including the original URL, markup, rendered HTML, and title. Accepts a `json=1` parameter for JSON output. ### Method GET ### Endpoint /go/ ### Query Parameters - **u** (string) - Required - The URL to process. - **json** (boolean) - Optional - If set to `1`, outputs JSON. - **link** (string) - Optional - Specifies the link format for the output (e.g., `obsidian`, `nv`, `marked`). - **style** (string) - Optional - Specifies a style to apply to the HTML output (e.g., `swiss`, `github`). - **read** (boolean) - Optional - If set to `1`, forces complete HTML output. - **import_css** (boolean) - Optional - If true, linked stylesheets are embedded. ### Request Example ```bash curl "https://heckyesmarkdown.com/go/?u=https://example.com&json=1" ``` ### Response #### Success Response (200) - **url** (string) - The original URL processed. - **markup** (string) - The content in the specified markup format. - **html** (string) - The rendered HTML version of the markup. - **title** (string) - The extracted title of the document. - **link** (string) - Optional - The encoded link, if the `link` parameter was provided. #### Response Example ```json { "url": "https://example.com", "markup": "# Example Title\n\nThis is an example paragraph.", "html": "

Example Title

\n

This is an example paragraph.

", "title": "Example Title", "link": "obsidian://create?content=[url encoded content]" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.