Example #1
0
 const codes = codeBlocks.map(codeBlock => {
     var code = "";
     try {
         code = toDoc.convertCode(codeBlock.value, file.path);
     } catch (error) {
     }
     return code;
 });
Example #2
0
        transform: function (file, encoding, next) {
            if (file.isBuffer()) {
                file.contents = Buffer(toDoc.convertCode(String(file.contents), file.path));
            }

            if (file.isStream()) {
                throw new Error("not support");
            }
            this.push(file);
            next();
        }