├── README.md ├── pandoc-beamer.sh ├── pandoc-docx.sh ├── pandoc-html.sh ├── pandoc-pdf.sh └── pandoc-preview.sh /README.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | These scripts allow you to call Pandoc from within BBEdit or Textwrangler. 4 | 5 | # Installation instructions 6 | 7 | Unzip and copy the folder to `~/Library/Application Support/BBEdit/Scripts`, replacing "BBEdit" with "TextWrangler" if you use the latter. 8 | 9 | ## BBedit preview filters 10 | 11 | If you have BBEdit, copy `pandoc-preview.sh` to `~/Library/Application Support/BBEdit/Preview Filters` (create this directory if it doesn't exist) to use Pandoc as a preview filter. Custom CSS files can be placed in `~/Library/Application Support/BBEdit/Preview CSS`. Renaming the file to `DefaultFilter_LanguageName.sh` where "LanguageName" is the extension you use for markdown files will set Pandoc as the default preview filter (e.g. `DefaultFilter_Text File.sh` if you use `.txt` for pandoc files). 12 | 13 | If the preview filter doesn't work, you may need to open the terminal, navigate to the preview filter, and use `chmod +x pandoc-preview.sh` to give the filter execute permissions. 14 | 15 | # Use 16 | 17 | To execute the scripts, open the Scripts Palette (Window: Palettes: Scripts) and select the desired output format. Keyboard shortcuts can be assigned from the Scripts Palette. 18 | 19 | The scripts assume that your file is saved. Any error reports will be opened in a new text document. 20 | 21 | # Modifications 22 | 23 | It's straightforward to modify the scripts to include new output formats or customize the existing ones. 24 | 25 | Including 26 | 27 | ``` 28 | open "${BB_DOC_PATH%%.*}".ext 29 | ``` 30 | 31 | where "ext" is the desired extension (e.g., pdf, docx) will tell your system to open the resulting output file using the default application for that type of document. 32 | -------------------------------------------------------------------------------- /pandoc-beamer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=$PATH:/usr/local/bin:/Library/TeX/texbin:/usr/texbin 3 | 4 | cd "$(dirname "$BB_DOC_PATH")" 5 | pandoc "$BB_DOC_PATH" -t beamer -o "${BB_DOC_PATH%%.*}".pdf 6 | -------------------------------------------------------------------------------- /pandoc-docx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=$PATH:/usr/local/bin 3 | 4 | cd "$(dirname "$BB_DOC_PATH")" 5 | pandoc -o "${BB_DOC_PATH%%.*}".docx "$BB_DOC_PATH" 6 | -------------------------------------------------------------------------------- /pandoc-html.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=$PATH:/usr/local/bin 3 | 4 | cd "$(dirname "$BB_DOC_PATH")" 5 | pandoc -f markdown+smart "${BB_DOC_PATH}" -o "${BB_DOC_PATH%%.*}".html --standalone --mathjax --email-obfuscation=references 6 | 7 | -------------------------------------------------------------------------------- /pandoc-pdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=$PATH:/usr/local/bin:/Library/TeX/texbin:/usr/texbin 3 | 4 | cd "$(dirname "$BB_DOC_PATH")" 5 | pandoc -o "${BB_DOC_PATH%%.*}".pdf "$BB_DOC_PATH" --pdf-engine=pdflatex -V geometry:margin=1in -V fontsize:11pt 6 | 7 | -------------------------------------------------------------------------------- /pandoc-preview.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=$PATH:/usr/local/bin 3 | 4 | pandoc -f markdown+smart -t html --mathjax --standalone 5 | 6 | --------------------------------------------------------------------------------