(title, tutorial, filename)
| 665 | |
| 666 | // TODO: move the tutorial functions to templateHelper.js |
| 667 | function generateTutorial(title, tutorial, filename) { |
| 668 | const tutorialData = { |
| 669 | title: title, |
| 670 | header: tutorial.title, |
| 671 | content: tutorial.parse(), |
| 672 | children: tutorial.children |
| 673 | }; |
| 674 | const tutorialPath = path.join(outdir, filename); |
| 675 | let html = view.render('tutorial.tmpl', tutorialData); |
| 676 | |
| 677 | // yes, you can use {@link} in tutorials too! |
| 678 | html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a> |
| 679 | |
| 680 | fs.writeFileSync(tutorialPath, html, 'utf8'); |
| 681 | } |
| 682 | |
| 683 | // tutorials can have only one parent so there is no risk for loops |
| 684 | function saveChildren({children}) { |
no test coverage detected
searching dependent graphs…