INNER CODE UNIT · JavaScript

sharedTemplates

codeceptjs/CodeceptJS · Bunoshfile.js:54

  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, '')
    })

    replaceInFile(pluginMarkDownFile(name), cfg => {
      for (const i in sharedPlaceholders) {
        cfg.replace(sharedPlaceholders[i], sharedTemplates[i])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…