mill-cli

papermill CLI tool

mill -- papermill CLI utility

written in javascript on node.js

See papermill.

  1. The only dependencies you need to install yourself are:
  • Node.js

  • pandoc (document conversion)

    • Debian/Ubuntu:
      sudo apt-get install pandoc

    • OS X:

  • LaTeX (output to PDF with Pandoc via LaTeX)

    • Debian/Ubuntu: sudo apt-get install texlive
    • Arch Linux: sudo pacman -S texlive-most
    • OS X: Get the MacTeX distribution
  1. Install mill with:
    sudo npm install --global mill-cli

There is just 1 command for now:

output                 Output from a papermil project config file
  • can have different names, we search for this list and pick the first result:

    • "_papermill/config.json"
    • "_papermill/papermill.json"
    • "papermill/config.json"
    • "papermill/papermill.json"
    • ".papermill/config.json"
    • ".papermill/papermill.json"
    • ".papermill"
    • ".papermill.json"
    • "papermill.json"
  • spec TBD

Simple example:

{
  "author": "Author Name",
  "name": "project_identifier",
  "input": "paper.md", // can be string, object or array of objects 
  "output": {
    "path": "_print",  // folder where files are put 
    "web": false       // 'print' and 'web' are default targets 
    "class": "article" // 'LaTeX' config 
  }
}

More complicated example:

{
  "author": "Max F. Albrecht", 
  "name": "Papermill", 
  "bibliography": "bibliography.bib", 
  "input": {
    "path": "Text",           // folder where subfolders are 
    "list": [                 // 'list' several documents  
 
      {
        "path": "p0-Preface"  // a sub-folder (`./Text/p0-Preface/`) 
      },                      // all files in it will get combined in order 
      {
        "path": "p1-Information"
      }, 
      {
        "path": "p2-MANUAL"
      }, 
      {
        "path": "p3-CODE"
      }, 
      {
        "path": "p4-Appendix"
      }
    ]
  }, 
  "output": {
    "path": "_output", 
    "web": true,
    "print": {
      "class": "book"
    }
  }
}

All the configuration is in JSON format. The nconf module is used to handle different sources of configuration.

  • Local (system) config for mill: /path/to/mill/config/config.json
  • uses the flatiron anti-framework
  • gets config from papermill.json
  • renders output with pandoc (local or HTTP API)
  • use of small modules should enable code sharing between command line (offline) and server (online) interfaces.
  • extend this tool: read, fork, send pull request

MIT