Generate Markdown

Type: generate_markdown

The markdown output format exports page data (articles, tables, etc.) in a human- and LLM-readable format, removing unnecessary styling and other "junk" that is only relevant to the site's proper functioning.

Gaffa exports GitHub-flavoured markdownarrow-up-right with comments removed and unknown tags ignored.

Parameters

Name
Type
Required
Description

selector

string

The selectorarrow-up-right that defines an element you want to generate markdown from. This is useful if you are only interested in the contents of a certain element.

output_type

string

Should the action output be saved to a file where a URL will be returned or should the parsed JSON object be included directly in the request. Default: file Accepted: ["file", "inline"]

See universal parameters.

Usage

The following converts the current page to markdown:

"actions": [
  {
    "type": "generate_markdown"
  }
]

The following converts only a specific element to markdown and returns it inline:

"actions": [
  {
    "type": "generate_markdown",
    "selector": "article",
    "output_type": "inline"
  }
]

Example Output

Last updated