Run zeke/cog-markdown-example using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"zeke/cog-markdown-example:146e98d6b010c431f601ac8482d7f0f9562730c8e82f93f9ad6eff711f95023a",
{
input: {
markdown: "```py\ndef allow_iframe_youtube(tag, name, value):\n if name == \"src\" and value.startswith(\"https://www.youtube.com/embed/\"):\n return True\n if name in (\"allow\", \"width\", \"height\"):\n return True\n return False\n\n\ndef allow_fenced_code_languages(tag, name, value):\n return (\n tag == \"code\"\n and name == \"class\"\n and value.startswith(\"language-\")\n and \" \" not in value\n )\n```"
}
}
);
// To access the file URL:console.log(output.url()); //=> "http://example.com"// To write the file to disk:
fs.writeFile("my-image.png", output);
Run zeke/cog-markdown-example using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"zeke/cog-markdown-example:146e98d6b010c431f601ac8482d7f0f9562730c8e82f93f9ad6eff711f95023a",
input={
"markdown": "```py\ndef allow_iframe_youtube(tag, name, value):\n if name == \"src\" and value.startswith(\"https://www.youtube.com/embed/\"):\n return True\n if name in (\"allow\", \"width\", \"height\"):\n return True\n return False\n\n\ndef allow_fenced_code_languages(tag, name, value):\n return (\n tag == \"code\"\n and name == \"class\"\n and value.startswith(\"language-\")\n and \" \" not in value\n )\n```"
}
)
print(output)