· 5 min read

How to Merge Markdown Files and Convert to PDF

This tutorial teaches you how to merge multiple markdown files into one and convert it to PDF or EPUB.

This tutorial teaches you how to merge multiple markdown files into one and convert it to PDF or EPUB.

Markdown has become a popular format for writing documents, blog posts, and even entire books. Its simplicity and flexibility make it an ideal choice for many writers and developers.

However, when working on larger projects, managing multiple Markdown files can become cumbersome. This is where merging Markdown files becomes useful – a process that allows you to combine multiple files into a single document. Also, converting your merged Markdown file to PDF makes it easy to share and collaborate with others who prefer this format.

In this article, I’ll guide you through the process of merging multiple Markdown files into one and converting the result to a PDF or EPUB, making it easy to share and collaborate with others using the Merge Docs Pro Add on.

This process, done using the Merge Docs Pro add-on, works on Windows, Mac, and Linux, as it is performed entirely in a web browser, making it accessible from anywhere.

Google Workspace Marketplace badge

Preparing the Markdown files for Merging

To merge multiple Markdown files into one, you need to place the Markdown files in Google Drive. This allows you to select and add them into the input Google Sheets of the Merge Docs Pro add-on.

Merging Multiple Markdown Files into One

To merge multiple Markdown files into one, Launch the Merge Docs Pro from the Menu by navigating to Extensions -> Merge Docs Pro -> Merge Multiple Docs. This will open the Merge Docs Pro sidebar and create an input sheet template with necessary headers automatically.

Now follow the below steps to merge the Markdown files.

  1. Click the Select Docs to Merge option, which will display the File picker. Select all the Markdown files you need to merge and click the Select option.
  2. All the Markdown file URLs will be added to the input sheet and the sheet will look like below: Example of Markdown files added to the input sheet
  3. The File Type will also be detected as Markdown.
  4. You can customize the merge using the Merge Flag. For example, if you want to skip any Markdown file during the merge, you can set the Merge flag to No.
  5. Once the input is ready, click on the Merge Docs button, which will merge all the Markdown files into one.

When merging Markdown files, the handling of images, links, and page breaks is crucial. Merge Docs Pro handles these elements as follows:

  • If the images mentioned in the Markdown files are available online and publicly accessible, they will be included in the PDF file. However, local images and private images will be ignored.
  • The inline links in the Markdown files will be created as links in the PDF file, ensuring that they remain clickable and accessible.
  • If you want to add a page break before merging each document, select the Add page break before each merge option before starting the merge operation. This will merge each document starting from a new page. Page breaks ensure that each document starts on a new page, preventing the content from different documents from running together.

Merging Markdown files with Links and page breaks

Converting the Merged Markdown File to PDF or EPUB

The Merge Docs Pro add-on supports merging multiple Markdown files into one and automatically creates output files such as PDF or EPUB.

To create a PDF file or EPUB file of the merged document, enable the Save merged Docs as PDF and/or the Save merged Docs as ePUB option as desired.

Additionally, if you want to download the output files automatically, select the Auto download output files option. If the files are not downloaded, they will still be available in the Google Drive folder, making it easier to share them with others as needed.

Mering multiple Markdown files and creating PDF

Access Settings for the Output PDF File or EPUB

If you want to share the output PDF file or EPUB file with someone by default, without requiring any additional actions from your side, Merge Docs Pro supports this feature as well.

Before the merging operation, in the Merge Destination option, select the Use an existing Doc as a template option. This allows you to select a Google Doc as a template.

  • The access settings of the Google Doc will be copied over to the output files, making the output file readable by the target users by default.
  • Additionally, it also copies over the headers and footers from the template, which is particularly useful when you need to maintain a consistent layout and branding across your documents. For instance, you can create output files with defined templates that include your company’s logo, title, and page numbers, ensuring a professional and cohesive look.

Supported Markdown Features

The following Markdown features are supported while merging them.

  • Headings
  • Paragraphs
  • Bold, Italic, Strikethrough stylings
  • Subscripts and Superscripts
  • Inline links
  • Images
  • Lists
  • Code blocks
  • Tables
  • Page breaks

Conclusion

In conclusion, merging multiple Markdown files into one and converting them to PDF or EPUB is a easy process using the Merge Docs Pro add-on.

With its ability to work on Windows, Mac, and Linux, and its accessibility from anywhere through a web browser, this add-on is an ideal solution for writers, developers, and anyone who needs to manage multiple Markdown files.

By following the steps outlined in this article, you can easily merge your Markdown files, convert them to PDF or EPUB, and share them with others.

Google Workspace Marketplace badge

You May Also Like

    Share:
    Back to Blog