<commit_before>var fs = require("fs")
  , path = require("path")
  , through = require("through")
  , extend = require("extend")
  , marked = require("marked")
  , pygments = require('pygmentize-bundled')
  , tmp = require("tmp")
  , childProcess = require("child_process")
  , duplexer = require("duplexer")
  , streamft = require("stream-from-to")

tmp.setGracefulCleanup()

function markdownpdf (opts) {
  opts = opts || {}
  opts.phantomPath = opts.phantomPath || require("phantomjs").path
  opts.runningsPath = path.resolve(__dirname + "/..", opts.runningsPath || '') || __dirname + "/runnings.js"
  opts.cssPath = opts.cssPath || __dirname + "/../pdf.css"
  opts.highlightCssPath = opts.highlightCssPath || __dirname + "/../highlight.css"
  opts.paperFormat = opts.paperFormat || "A4"
  opts.paperOrientation = opts.paperOrientation || "portrait"
  opts.paperBorder = opts.paperBorder || "1cm"
  opts.renderDelay = opts.renderDelay || 500
  opts.preProcessMd = opts.preProcessMd || function () { return through() }
  opts.preProcessHtml = opts.preProcessHtml || function () { return through() }

  var md = ""

  // set options for marked
  var markedOptions = {
    highlight: function (code, language, callback) {

      pygments({ lang: language, format: 'html' }, code, function (err, result) {
        callback(err, result ? result.toString() : code)
      })
    }
  }

  // Argh! marked, why you no stream?<commit_msg>lowercasing the lang-name<commit_after>var fs = require("fs")
  , path = require("path")
  , through = require("through")
  , extend = require("extend")
  , marked = require("marked")
  , pygments = require('pygmentize-bundled')
  , tmp = require("tmp")
  , childProcess = require("child_process")
  , duplexer = require("duplexer")
  , streamft = require("stream-from-to")

tmp.setGracefulCleanup()

function markdownpdf (opts) {
  opts = opts || {}
  opts.phantomPath = opts.phantomPath || require("phantomjs").path
  opts.runningsPath = path.resolve(__dirname + "/..", opts.runningsPath || '') || __dirname + "/runnings.js"
  opts.cssPath = opts.cssPath || __dirname + "/../pdf.css"
  opts.highlightCssPath = opts.highlightCssPath || __dirname + "/../highlight.css"
  opts.paperFormat = opts.paperFormat || "A4"
  opts.paperOrientation = opts.paperOrientation || "portrait"
  opts.paperBorder = opts.paperBorder || "1cm"
  opts.renderDelay = opts.renderDelay || 500
  opts.preProcessMd = opts.preProcessMd || function () { return through() }
  opts.preProcessHtml = opts.preProcessHtml || function () { return through() }

  var md = ""

  // set options for marked
  var markedOptions = {
    highlight: function (code, lang, callback) {

      pygments({ lang: lang.toLowerCase(), format: 'html' }, code, function (err, result) {
        callback(err, result ? result.toString() : code)
      })
    }
  }

  // Argh! marked, why you no stream?
{'fraction_non_alphanumeric': 0.1597222222222222, 'fraction_numerical': 0.003472222222222222, 'mean_word_length': 3.825795644891122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1261529', 'n_tokens_mistral': 925, 'n_tokens_neox': 892, 'n_words': 195}