docs: function blocksToMarkdown(blocks, level, threshold) {
    var md = [];
    var inClass = false;
    var i = 0;
    var j = 0;
  
    if (level < 1 || level > 6) {
      level = 1;
    }
  
    nextBlock: for (i = 0; i < blocks.length; i++) {
      let tagArgs = null;
      let isClass = false;
      let visibility = '';
      let type = '';
      let name = '';
      let implem = '';
      let params = [];
      let returnType = '';
      let returnDesc = '';
  
      // Gather useful information from tags
      for (j = 0; j < blocks[i].tags.length; j++) {
        let tag = blocks[i].tags[j];
  
        switch (tag.tag) {
  
          case 'class':
          case 'module':
          case 'interface':
            inClass = true;
            isClass = true;
            tagArgs = tag.line.match(re.tagTypeName);
            if (tagArgs !== null) {
              type = tag.tag + ' ' + (tagArgs[1] || '');
              name = tagArgs[2] || '';
            }
            break;
  
          case 'endclass':
          case 'endmodule':
          case 'endinterface':
            inClass = false;
            continue nextBlock;
  
          case 'implements':
            tagArgs = tag.line.match(re.tagType);
            if (tagArgs !== null) {
              implem = tagArgs[1] || '';
            }
            break;
  
          case 'private':
            visibility = tag.tag;
            if (threshold < 2) {
              continue nextBlock;
            }
            break;
          case 'protected':
            visibility = tag.tag;
            if (threshold < 1) {
              continue nextBlock;
            }
            break;
          case 'public':
            visibility = tag.tag;
            break;
  
          case 'access':
            switch (tag.line) {
              case 'public':
                visibility = tag.line;
                break;
              case 'protected':
                if (threshold < 1) {
                  continue nextBlock;
                }
                visibility = tag.line;
                break;
              case 'private':
                if (threshold < 2) {
                  continue nextBlock;
                }
                visibility = tag.line;
                break;
              default:
            }
            break;
  
          case 'param':
          case 'parameter':
            tagArgs = tag.line.match(re.tagTypeNameDesc);
            if (tagArgs !== null) {
              params.push({
                type: (tagArgs[1] || ''),
                name: (tagArgs[2] || ''),
                desc: (tagArgs[3] || '')
              });
            }
            break;
  
          case 'return':
          case 'returns':
            tagArgs = tag.line.match(re.tagTypeName);
            if (tagArgs !== null) {
              returnType = tagArgs[1] || '';
              returnDesc = tagArgs[2] || '';
            }
            break;
  
          case 'ignore':
            continue nextBlock;
  
          default:
        }
      }
  
      // Header
      md.push(
        '#'.repeat(Number(level) + (inClass && !isClass ? 1 : 0))
        + ' `'
        // + (visibility ? visibility + ' ' : '')
        // + (type ? type + ' ' : '')
        // + (name ? name + ' ' : '')
        + (implem ? 'implements ' + implem + ' ' : '')
        + blocks[i].code + '`\n\n'
      );
  
      // Verbatim lines
      for (j = 0; j < blocks[i].lines.length; j++) {
        if (blocks[i].lines[j] === '') {
          md.push('\n\n');
        } else if (blocks[i].lines[j].match(/^\s/)) {
          md.push(blocks[i].lines[j] + '\n');
        } else {
          md.push(blocks[i].lines[j] + ' ');
        }
      }
  
      // Parameters
      if (params.length > 0) {
        md.push('\n**Parameters:**\n\n');
      }
      for (j = 0; j < params.length; j++) {
        md.push(
          '* `'
          + params[j].name
          + '` — '
          + params[j].type
          + (params[j].desc ? ' — ' + params[j].desc : '')
          + '\n'
        );
      }
  
      // Return value
      if (returnType !== '' || returnDesc !== '') {
        md.push('\n**Returns:**');
        if (returnType !== '') {
          md.push(' `' + returnType + '`');
        }
        if (returnDesc !== '') {
          md.push(
            (returnType !== '' ? ' — ' : ' ')
            + returnDesc
            + '\n'
          );
        }
      }
  
      // Final empty line
      md.push('\n');
    }
  
    return md.join('');
  }