utils/generateMarkdown.js
// function to build ToC based on user preferences
function to build ToC based on user preferences
function to build ToC based on user preferences
function tableOfContents(data) {
  if (data.toc) {
    let tocData = `## Table of Contents:\n`;
    if (data.license !== 'none') {
      tocData += `* [License](#License)\n`;
    };
    tocData += data.installation ? `* [Installation](#Installation)\n` : '';
    tocData += data.usage ? `* [Usage](#Usage)\n` : '';
    tocData += data.tests ? `* [Tests](#Tests)\n` : '';
    tocData += data.contributing ? `* [Contributing](#Contributing)\n` : '';
    tocData += data.questions ? `* [Questions](#Questions)\n` : '';
    return tocData;
  } else {
    return '';
  };
}
function tableOfContents ( data ) { if ( data . toc ) { let tocData = ` \n ` ; if ( data . license !== 'none' ) { tocData += ` \n ` ; } ; tocData += data . installation ? ` \n ` : '' ; tocData += data . usage ? ` \n ` : '' ; tocData += data . tests ? ` \n ` : '' ; tocData += data . contributing ? ` \n ` : '' ; tocData += data . questions ? ` \n ` : '' ; return tocData ; } else { return '' ; } ; }
function to build ToC based on user preferences
function to build ToC based on user preferences
// create heading // check if license data to be included // check installation data