INNER CODE UNIT · JavaScript

files

codeceptjs/CodeceptJS · Bunoshfile.js:50

  const files = fs.readdirSync('lib/plugin').filter(f => path.extname(f) === '.js')

  const sharedPartials = fs.readdirSync('docs/shared').filter(f => path.extname(f) === '.mustache')
  const sharedPlaceholders = sharedPartials.map(file => `{{ ${path.basename(file, '.mustache')} }}`)
  const sharedTemplates = sharedPartials.map(file => fs.readFileSync(`docs/shared/${file}`).toString()).map(template => `\n\n\n${template}`)

  const index = []

  for (const file of files) {
    const name = path.basename(file, '.js')
    say(`Writing documentation for ${name} plugin`)

    await shell`npx documentation build lib/plugin/${file} -o ${pluginMarkDownFile(name)} ${documentjsCliArgs}`

    replaceInFile(pluginMarkDownFile(name), cfg => {
      cfg.replace(/\(optional, default.*?\)/gm, '')
      cfg.replace(/\\*/gm, '')
    })

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…