* Derives a human-readable name from an example path as a fallback. * e.g., 'examples/grid/bigData/index.html' -> 'Big Data' * @param {String} examplePath * @returns {String}
(examplePath)
| 548 | * @returns {String} |
| 549 | */ |
| 550 | function getNameFromExamplePath(examplePath) { |
| 551 | const parts = examplePath.split('/').slice(1, -1); |
| 552 | const name = parts[parts.length - 1]; |
| 553 | |
| 554 | return name.replace(/([A-Z])/g, ' $1') |
| 555 | .split(' ') |
| 556 | .map(word => word.charAt(0).toUpperCase() + word.slice(1)) |
| 557 | .join(' '); |
| 558 | } |
| 559 | |
| 560 | /** |
| 561 | * Collects all example routes by scanning the filesystem and reading their titles. |
no test coverage detected