Files: 9e4b77aeb7181a93a9ee3ceb1c21d11841a35f57 / tmpl / com.part.js
427 bytesRaw
1 | |
2 | // `examples` is an object, mapping language->example |
3 | module.exports.code = examples => { |
4 | return `<div class="code-examples"> |
5 | <div class="head"> |
6 | ${ Object.keys(examples).map(lang => `<div class="tab">${lang}</div>`).join('') } |
7 | </div> |
8 | <div class="body"> |
9 | ${ Object.keys(examples).map(lang => `<pre><code class="language-${lang}">${examples[lang].trim()}</code></pre>`).join('') } |
10 | </div> |
11 | </div>` |
12 | } |
Built with git-ssb-web