INNER CODE UNIT · JavaScript

headingAt

codeceptjs/CodeceptJS · Bunoshfile.js:76

    const headingAt = lines.findIndex(l => l.startsWith('## '))
    const summary = []
    for (let i = headingAt + 1; i < lines.length; i++) {
      const line = lines[i].trim()
      if (!summary.length && !line) continue
      if (summary.length && (!line || line.startsWith('#') || line.startsWith('```'))) break
      summary.push(line)
    }
    index.push({ name, summary: summary.join(' ').trim() })

    await writeToFile(pluginMarkDownFile(name), line => {
      line`---
permalink: /plugins/${name}
editLink: false
sidebar: auto
title: ${name}
---

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…