Create your first PDF¶
In this tutorial, we will create a small Markdown file and convert it to a PDF.
By the end, you will have an example.pdf file next to the Markdown source.
Make sure the command is available¶
Run:
Tip
If you are running from the repository instead of an installed release, replace md-to-pdf with cargo run --.
From the repository, check the command with:
You should see the command help.
Create a Markdown file¶
Create example.md:
# First PDF
This PDF was created from Markdown.
- Headings become PDF headings.
- Lists stay as lists.
- Inline code like `md-to-pdf` stays readable.
Convert it¶
Run:
From the repository, use cargo run -- example.md instead.
You should see:
Now check that example.pdf exists next to example.md.
Repeat it¶
Run the same command again:
The command rewrites example.pdf. This repetition is useful: it confirms that converting a Markdown file is a normal, repeatable workflow.
Recap¶
You created example.md, converted it with md-to-pdf example.md, and confirmed that example.pdf was written next to the source file.
Next steps¶
- Add a diagram with Render Mermaid diagrams.
- Look up output, browser, and CSS flags in CLI options.