SkillAgentSearch skills...

Md2pdf

Convert your markdown files to PDF instantly

Install / Use

/learn @arnabsen1729/Md2pdf
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Contributors Stargazers Issues Builds Tests

<!-- [![MIT License][license-shield]][license-url] --> <!-- [![Forks][forks-shield]][forks-url] --> <!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/arnabsen1729/md2pdf"> <img src=".github/assets/hero.png" alt="Logo"> </a> <h3 align="center">Markdown to PDF</h3> <p align="center"> Will take a markdown file as input and then create a PDF file with the markdown formatting. <br /> <a href="https://github.com/arnabsen1729/md2pdf"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="https://github.com/arnabsen1729/md2pdf#demo">View Demo</a> · <a href="https://github.com/arnabsen1729/md2pdf/issues">Report Bug</a> · <a href="https://github.com/arnabsen1729/md2pdf/issues">Request Feature</a> </p> </div> <!-- ABOUT THE PROJECT -->

About The Project

demo

Many people love using markdown to take notes and write documentation. But when it comes to sharing it, they need to convert it to PDF. md2pdf is a simple tool which does exactly that.

Currently, it supports:

| Features | Support | |---|---| | Headings (L1 - L6) | ✔️ | | Paragraph | ✔️ | | Blockquotes | ✔️ | | Bold | ✔️ | | Italic | ✔️ | | Code | ✔️ | | Link | ✔️ | | Images | ✔️ | | CodeBlock | ⬛ | | Lists (Ordered and Unordered) | ⬛ | | Horizontal Rules | ⬛ | | Tables | ⬛ |

Take a look at the PDF generated from the sample markdown file. | PDF File | Markdown File | |---|---| | pdfss | mdss |

<!-- USAGE -->

Usage

$ md2pdf -h
Usage of md2pdf:
  -file string
     Name of the markdown file to read
  -output string
     Name of the PDF file to be exported  (default: <input-file-name>.pdf)

Example:

md2pdf -file=MyFile.md -output=MyFile.pdf

Working

We can look at the markdown file as a bunch of lines, and each lines are further a collection of tokens. Tokens refer to the smallest/atomic unit of markdown. Each token has it's own style, content and alternate content (altContent is optional).

For example, a token can be a heading, a paragraph, a bold text, an image, a code block, a list, etc. The token for heading will have the text in the content, the respective style like being bold, a larger font etc in the style.

Alternate content of the token is used in cases of images and links. For example, the alternate content of an image will be the image URL.

diag1

Parser first reads the markdown file splits it by lines and then further splits the lines by tokens.

diag2

This list of list of tokens are then passed to the Writer to generate the final PDF.

This project follows the standard markdown guidelines.

<hr>

forthebadge forthebadge

<!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
View on GitHub
GitHub Stars36
CategoryDevelopment
Updated4mo ago
Forks4

Languages

Go

Security Score

87/100

Audited on Dec 2, 2025

No findings