<commit_before>const fs = require('fs');

const PDFDocument = require('pdfkit');

var schedule = JSON.parse(fs.readFileSync('contents/wanneer.json'));

var doc = new PDFDocument();
doc.pipe(fs.createWriteStream('templates/resources/pdf/schedule.pdf'));

const font = 'Times-Bold';
const font_size = 8;

doc.font(font);
doc.fontSize(font_size);

const cell_width = 95;
const header_height = 10;
const cell_height = 39;
const padding_width = 5;
const padding_height = 3;

["Tijd", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag"]
    .forEach(function(header, index){
        var x = padding_width + index * (cell_width + padding_width);
        var y = padding_height;
        doc.rect(x, y, cell_width, header_height);
        var text_y = y + header_height/2 - font_size/3;
        doc.text(header, x, text_y, { align: 'center', width: cell_width });
    });

const timetable = schedule.timetable;
timetable
    .forEach(function(row, row_index){
        var y = 2*padding_height + header_height + row_index * (padding_height + cell_height);
        var x = padding_width;
        doc.rect(x, y, cell_width, cell_height);
        var text_y = y + cell_height/2 - font_size/3;
        var time_text = row.time.start + "-" + row.time.end;
        doc.text(time_text, x, text_y, { align: 'center', width: cell_width });
        ["monday", "tuesday", "wednesday", "thursday", "friday"].forEach(function(day, column_index){
            var x = padding_width + (column_index + 1) * (padding_width + cell_width);
            doc.rect(x, y, cell_width, cell_height);
            var data = row.columns[day];
            if (data.hasOwnProperty('class')) {
                var text_y = y + font_size/2;
                doc.text(data.class + " (" + data.teacher + ")", x, text_y, { align: 'center', width: cell_width });
                doc.moveDown(0.25).text(data.description, { align: 'center', width: cell_width });
            }
        });
    });

doc.rect(0, 0,
         6 * (padding_width + cell_width) + padding_width,
         timetable.length * (padding_height + cell_height) + 2*padding_height + header_height);
doc.stroke();

doc.end();
<commit_msg>Make titles bold<commit_after>const fs = require('fs');

const PDFDocument = require('pdfkit');

var schedule = JSON.parse(fs.readFileSync('contents/wanneer.json'));

var doc = new PDFDocument();
doc.pipe(fs.createWriteStream('templates/resources/pdf/schedule.pdf'));

const font = 'Times-Bold';
const font_size = 8;

doc.font(font);
doc.fontSize(font_size);

const cell_width = 95;
const header_height = 10;
const cell_height = 39;
const padding_width = 5;
const padding_height = 3;

["Tijd", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag"]
    .forEach(function(header, index){
        var x = padding_width + index * (cell_width + padding_width);
        var y = padding_height;
        doc.rect(x, y, cell_width, header_height);
        var text_y = y + header_height/2 - font_size/3;
        doc.font('Times-Bold').text(header, x, text_y, { align: 'center', width: cell_width });
    });

const timetable = schedule.timetable;
timetable
    .forEach(function(row, row_index){
        var y = 2*padding_height + header_height + row_index * (padding_height + cell_height);
        var x = padding_width;
        doc.rect(x, y, cell_width, cell_height);
        var text_y = y + cell_height/2 - font_size/3;
        var time_text = row.time.start + "-" + row.time.end;
        doc.font('Times-Roman').text(time_text, x, text_y, { align: 'center', width: cell_width });
        ["monday", "tuesday", "wednesday", "thursday", "friday"].forEach(function(day, column_index){
            var x = padding_width + (column_index + 1) * (padding_width + cell_width);
            doc.rect(x, y, cell_width, cell_height);
            var data = row.columns[day];
            if (data.hasOwnProperty('class')) {
                var text_y = y + font_size/2;
                doc.font('Times-Bold').text(data.class + " (" + data.teacher + ")", x, text_y, { align: 'center', width: cell_width });
                doc.moveDown(0.25).font('Times-Roman').text(data.description, { align: 'center', width: cell_width });
            }
        });
    });

doc.rect(0, 0,
         6 * (padding_width + cell_width) + padding_width,
         timetable.length * (padding_height + cell_height) + 2*padding_height + header_height);
doc.stroke();

doc.end();

{'fraction_non_alphanumeric': 0.1524846834581348, 'fraction_numerical': 0.010437939641479465, 'mean_word_length': 3.1312089971883785, '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': '1742427', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1450, 'n_words': 318}