Collating multiple GitHub md files into one a single formatted and branded PDF file. For the PDF version

Patrick's Avatar


18 Sep, 2021 09:14 AM

Hi there

I need to regularly convert and collate several Markdown files from GitHub to a single formatted and branded PDF file. For the PDF version, some additional pages (front page, table of contents, ...) need to be included.

Form looking at the Marked2 documentation I seems like this should be possible to achieve. Has anybody done this or something similar?

Ideally the scenario would be as follows:

  1. Fetch the latest version of various md files from a git hub repo
  2. Collate these files into a single file in a specific order
  3. Add a front and back page, as well as some pages with additional info (PDF)
  4. Insert a table of contents that is dynamically created

Is this possible to do? Would anybody be interested in taking this on as a freelance job?

  1. Support Staff 1 Posted by Brett on 18 Sep, 2021 11:13 AM

    Brett's Avatar

    All you really need to do is create a Marked index file (link below)
    with the filenames of the cover pages and the imported files. Then
    updating the document is as easy as running git pull. Insert
    `<!--TOC-->` where you want the table of contents to go, and it will be
    generated every time the file updates in Marked.

    Here are the docs for the index file format:

    TOC Docs:

    Marked should also watch the included files, so if the index file is
    currently open in Marked, any time you run a git pull and the included
    files change, it should automatically update the preview.

    Unfortunately Marked does not allow background generation of PDFs. The
    index file still needs to be opened and exported to create the PDF.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac