Skip to content
/ mdc Public

Pandoc scripts to add extra features for converting documents

Notifications You must be signed in to change notification settings

mboyea/mdc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title author lang subject keywords default_
Markdown Converter
Matthew T. C. Boyea
en
pandoc
windows
linux
pandoc
markdown
md
latex
tex
gnumake
makefile
pdf
scripts
report

Markdown Converter (mdc) compiles plaintext documents from Markdown into other formats using Pandoc + Makefile + Bash

I use these scripts to convert my Markdown files into other formats at work and on my home computer. The Windows installation process does not require administrator privileges at any step, so the IT department doesn't disallow it.

Screenshot of the resume example in a VSCode workspace.

Manual Install (Windows)

  • Install Pandoc for Windows
  • Install MiKTeX (LaTeX for Windows)
  • Install MSYS2 (Linux build tools for Windows)
  • Install Git, Makefile, and WatchExec: In MSYS2 UCRT64, run pacman -S git make mingw-w64-ucrt-x86_64-watchexec
  • Clone this repository: In MSYS2 UCRT64, cd to the directory you want to install this repository and run git clone https://github.com/mboyea/mdc
  • In C:\msys64\home\<user>\.bashrc add line alias mdc='<INSERT_PATH_TO_PANDOC_SCRIPTS>/mdc/mdc.sh'
  • In C:\msys64\home\<user>\.bash_profile add line if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
  • In C:\msys64\ucrt64.ini uncomment line MSYS2_PATH_TYPE=inherit

Now you can use mdc in the MSYS2 UCRT64 terminal to process your documents. This terminal is capable of running most other Linux tools too, natively in Windows (without WSL). You can find the package list on msys2.org, or search the database with the terminal using pacman -Ss string1 string2 ....

Integrate Into VSCode (Windows)

My favorite Windows text editor is Visual Studio Code

  • Open VSCode
  • Open User Settings (JSON) using Ctrl+Shift+P
  • Add lines:
  // "terminal.integrated.shellIntegration.enabled": false, // fix slow terminals
  "terminal.integrated.profiles.windows": {
    "MSYS2": {
      "path": "C:\\msys64\\usr\\bin\\bash.exe",
      "args": [
        "--login"
      ],
      "env": {
        "MSYSTEM": "UCRT64",
        "MSYS2_PATH_TYPE": "inherit",
        "CHERE_INVOKING": "1",
      }
    }
  },
  "terminal.integrated.env.windows": {
    // "HOME": "C:\\path\\to\\custom\\home\\dir", // change home directory (make sure to create a .bashrc and .bash_profile)
    "MSVSCODE": "1"
  },
  "terminal.integrated.defaultProfile.windows": "MSYS2",
  "settingsSync.ignoredSettings": [
    "terminal.integrated.profiles.windows",
    "terminal.integrated.env.windows",
    "terminal.integrated.defaultProfile.windows"
  ]
  • Save the file.

Now MSYS2 UCRT64 is your default terminal in VSCode. Open it with Ctrl+Shift+`.

Manual Install (Arch Linux)

  • Run pacman -S texlive-basic texlive-latexrecommended texlive-latexextra texlive-fontsrecommended
  • Install Pandoc: Get pandoc-bin from AUR or pandoc-cli from pacman (do not install both)
  • Clone this repository: In your shell, cd to the directory you want to install this repository and run git clone https://github.com/mboyea/mdc
  • In your .bashrc, add line alias mdc='<INSERT_PATH_TO_PANDOC_SCRIPTS>/mdc/mdc.sh'
  • In your .bash_profile add line if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

Manual Install (NixOS Home Manager)

  • Add packages to the config file:
git
pandoc
texliveFull
gnumake
  • Rebuild the config file with home-manager switch.
  • Clone this repository: In your shell, cd to the directory you want to install this repository and run git clone https://github.com/mboyea/mdc
  • In your .bashrc, add line alias mdc='<INSERT_PATH_TO_PANDOC_SCRIPTS>/mdc/mdc.sh'
  • In your .bash_profile add line if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

Script Usage

In the terminal, run mdc --help to view the script list. Run mdc <script-name> --help to view supported usage of any script.

script call description
mdc help Print the script list, or print help for a specific script.
mdc pdf Compile %.md files (Markdown) into %.pdf files (Portable Display Format).

About

Pandoc scripts to add extra features for converting documents

Topics

Resources

Stars

Watchers

Forks