Markdown to PDF and HTML: themes, code and tables avatar

Markdown to PDF and HTML: themes, code and tables

Pricing

from $4.50 / 1,000 document converteds

Go to Apify Store
Markdown to PDF and HTML: themes, code and tables

Markdown to PDF and HTML: themes, code and tables

Turns Markdown text, .md links or stored files into styled PDF and standalone HTML. Four themes, colored code blocks, tables, task lists, footnotes, an optional table of contents and page numbers. Returns download links for each document.

Pricing

from $4.50 / 1,000 document converteds

Rating

0.0

(0)

Developer

Ed Rayyis

Ed Rayyis

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Give it Markdown as text, as links to .md files, or from one of your key value stores, and it makes a styled PDF and a standalone HTML page for each document. Pick a theme, the code colors, the paper size and margins, and add a table of contents and page numbers. Every file goes into the run's key value store, and the dataset gives you the download links with the title, page count and size.

What it does

  • Four themes: Modern (sans serif, like a project README), Serif (book style with justified text), Compact (smaller type and tighter spacing for reports) and Dark (light text on a dark background, edge to edge on every PDF page)
  • Code blocks colored by language with Pygments, in nine color schemes or one picked to match the theme. Long lines wrap in the PDF
  • Tables with column alignment, borders and striped rows
  • Task lists, footnotes, strikethrough, quotes and links found in plain text
  • Table of contents: a linked list of the level 1 to 3 headings on its own first page
  • Page numbers: page and page count at the foot of every PDF page, on by default
  • Paper: A4, US Letter, US Legal, A3 or A5, wide pages for wide tables, and margins in millimeters
  • Images in the Markdown are loaded. In a file from a link, relative image paths load from the file's own location
  • HTML in Markdown is shown as text by default, or rendered when you allow it. Scripts never run
  • Title for the PDF properties and the HTML page, taken from the first level 1 heading unless you set one
  • Extra CSS added after the theme
  • HTML output: one standalone file per document with the styles inside

Example

A project README from a raw GitHub link, with a logo, screenshots, 23 headings and relative image paths, came out as a 10 page A4 PDF with every image in place, and with the table of contents on page 1. A one page report with a table, a task list, Python and JSON code and a footnote came out on one US Letter page in each of the four themes.

Input

  • Markdown: one document as text, and its document name
  • More documents: a JSON list such as [{"name": "report", "markdown": "# Title"}]
  • Markdown file URLs: links to raw Markdown files
  • Files in a key value store: to use Markdown files from your computer, upload them to one of your key value stores and pick that store. Every record whose key ends in .md, .markdown or .txt is converted
  • Record keys: only convert these records from that store
  • Output: PDF and HTML (default), PDF only or HTML only
  • Theme: Modern (default), Serif, Compact or Dark
  • Code colors: auto (default) or one of nine schemes
  • Table of contents (default off)
  • Page size: A4 (default), US Letter, US Legal, A3 or A5, and wide pages (default off)
  • Margin in millimeters (default 18)
  • Page numbers (default on)
  • Title (default: the first level 1 heading)
  • Language code (default en)
  • Allow HTML in Markdown (default off)
  • Extra CSS
  • Maximum file size in MB (default 5)

Output

Dataset: one item per document with pdfUrl and htmlUrl (download links), pdfKey, htmlKey, title, name, source, pdfPages, pdfBytes, headings and markdownChars. Files are named by the document's position and name, such as 0003-readme.pdf.

A document that cannot be converted gets ok: false and an error, such as HTTP 404, "the link returns a web page, not a Markdown file; use the raw file link", or "the Markdown is empty". One bad document never stops the run.

Pricing

Pay per event: one event per document converted, with the PDF and the HTML together counting as one. Failed documents are not charged. The run stops when it reaches the maximum charge you set.

Scope and conduct

Only the files you supply are downloaded, plus the images your Markdown links to. The actor does not log in anywhere and uses no proxies. Convert documents you have the right to use.

Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.