This script is designed to convert Markdown files to PDFs using Pandoc. It's suitable for users who need to quickly transform their Markdown documents into a professionally formatted PDF file.
Ensure that Pandoc and LaTeX are installed on your system. If not, you can install them using your package manager. For example, on Ubuntu:
sudo apt-get install pandoc texliveClone the script from the GitHub repository:
git clone [URL to GitHub repository]Make the script executable:
chmod +x mdtopdf.shTo use the script, navigate to the directory containing the script and run it with the following syntax:
./mdtopdf.sh [OPTIONS]... FILEWhere FILE is the path to the Markdown file you want to convert.
-h: Display the help menu.-o: Specify the output file name for the PDF.-f: Set the font family for the PDF.-s: Set the font size for the PDF.-m: Set the monospaced font family for the PDF.-p: Set the paper size for the PDF (default is A4).-r: Execute the script recursively in a directory.
Convert a single file:
./mdtopdf.sh -o output.pdf -f "Arial" -s 12pt -m "Courier New" -p a4paper input.mdConvert all Markdown files in a directory:
./mdtopdf.sh -r /path/to/directoryContributions are welcome. Please fork the repository and submit a pull request with your improvements.
This script is distributed under the MIT License. See the LICENSE file in the repository for more details.