55 lines
1.4 KiB
Markdown
55 lines
1.4 KiB
Markdown
## [buildnote](../../scripts/buildnote)
|
|
|
|
Converts markdown notes to PDF using pandoc with xelatex engine.
|
|
|
|
## Description
|
|
|
|
This script generates professionally formatted PDF documents from markdown files. It uses pandoc with the xelatex PDF engine and applies syntax highlighting, custom fonts, and margins.
|
|
|
|
## Dependencies
|
|
|
|
- pandoc
|
|
- xelatex (TeX Live)
|
|
- DejaVu fonts (DejaVuSerif, DejaVuSans, DejaVuSansMono)
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
./buildnote.sh <input_file> <output_file>
|
|
```
|
|
|
|
## Arguments
|
|
|
|
- `input_file`: Path to the markdown file to convert
|
|
- `output_file`: Path for the generated PDF file
|
|
|
|
## Features
|
|
|
|
- **PDF Engine**: xelatex for Unicode and custom font support
|
|
- **Syntax Highlighting**: pygments style for code blocks
|
|
- **Fonts**:
|
|
- Main: DejaVuSerif (with Bold, Italic, BoldItalic variants)
|
|
- Sans: DejaVuSans
|
|
- Mono: DejaVuSansMono
|
|
- **Margins**: 1 inch on all sides
|
|
- **Links**: NavyBlue color for URLs
|
|
|
|
## Example
|
|
|
|
```bash
|
|
# Convert a markdown note to PDF
|
|
./buildnote.sh notes.md output.pdf
|
|
|
|
# The script runs in background and prints the output path
|
|
./buildnote.sh ~/notes/daily.md ~/notes/daily.pdf
|
|
```
|
|
|
|
## Integration with Neovim
|
|
|
|
The script is designed to work with Neovim. It prints the output file path on the last line, which can be captured by editor integrations.
|
|
|
|
## Notes
|
|
|
|
- The conversion runs in the background (using `&`)
|
|
- Ensure all dependencies are installed before running
|
|
- The script validates that the input file exists before processing
|