()
| 58 | <!-- AUTO-GENERATED-CONTENT:END --> |
| 59 | */ |
| 60 | SERVERLESS_EXAMPLE_TABLE() { |
| 61 | const examplesPath = path.join(__dirname, "examples.json"); |
| 62 | const examples = JSON.parse(fs.readFileSync(examplesPath, "utf8")); |
| 63 | |
| 64 | // Make table header |
| 65 | let md = "| Example | Runtime |\n"; |
| 66 | md += "|:--------------------------- |:-----|\n"; |
| 67 | examples.forEach((example) => { |
| 68 | const dirname = example.dirname || ""; |
| 69 | const exampleUrl = `https://github.com/serverless/examples/tree/master/${dirname}`; |
| 70 | const runtime = getRuntime(dirname); |
| 71 | const description = example.description |
| 72 | ? `<br/> ${example.description}` |
| 73 | : ""; |
| 74 | // add table rows |
| 75 | md += `| [${ |
| 76 | example.title || formatPluginName(example.name) |
| 77 | }](${exampleUrl}) ${description} | ${runtime} |\n`; |
| 78 | }); |
| 79 | |
| 80 | return md; |
| 81 | }, |
| 82 | }, |
| 83 | }; |
| 84 |
nothing calls this directly
no test coverage detected