How to use the documentation.formats function in documentation

To help you get started, we’ve selected a few documentation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keplergl / kepler.gl / scripts / documentation.js View on Github external
.then(res => {
      // res is an array of parsed comments with inferred properties
      // and more: everything you need to build documentation or
      // any other kind of code data.
      let processed = res;

      if (outputPath.includes('actions.md')) {
        // add action type and updater links to action
        processed = res.map(node => _appendActionTypesAndUpdatersToActions(node, actionMap));
      } else if (inputPath.some(p => p.includes('reducers'))) {
        // add action type and updater links to action
        processed = res.map(node => _appendActionToUpdaters(node, actionMap));
      }

      return documentation.formats.remark(processed, OUT_CONFIG)
    })
    .then(output => {
github bhoriuchi / vsphere-connect / build / documentation.build.js View on Github external
], {}, function (err, res) {
  if (err) {
    console.error(err)
    process.exit()
  }

  documentation.formats.html(res, {}, function (err, output) {
    if (err) {
      console.error(err)
      process.exit()
    }
    if (!output) {
      console.error('no output generated, exiting')
      process.exit()
    }
    streamArray(output).pipe(vfs.dest(path.resolve(__dirname, '../docs')))
  })
})
github liferay / alloy-editor / plugins / gatsby-remark-api-table / index.js View on Github external
new Promise(async resolve => {
					const pathFile = path.resolve(
						'../packages/',
						node.value.split('"')[1]
					);

					await docs
						.build([pathFile], {shallow: true})
						.then(docs.formats.json)
						.then(output => {
							const json = JSON.parse(output);
							const documentation = evaluateInstance(
								json[0].members.instance
							);

							node.value = `<div class="table-responsive">
                                <table class="table table-autofit">
                                    <thead>
                                        <tr>
                                            <th>Property</th>
                                            <th>Description</th>
                                            <th>Type</th>
                                            <th>Required</th>
                                            <th>Default</th>
                                        </tr></thead></table></div>
github fhqvst / avanza / scripts / generate-documentation.js View on Github external
},
              {
                type: 'tableCell',
                children: [{
                  type: 'text',
                  value: notes[key.name] || ''
                }]
              }
            ]
          }))]
        })
      }
    }
  }

  const markdown = await documentation.formats.md(docs, { markdownToc: true })
  fs.writeFileSync(path.join(process.cwd(), 'API.md'), markdown)
  process.exit()
}
github Zettlr / Zettlr / scripts / docs.js View on Github external
  .then(comments => documentation.formats.html(comments, {}))
  .then(output => {
github musefind / mobx-models / scripts / docs.js View on Github external
documentation.build(['src/' + fileName + '.js'], {}, function(err, res) {
    if (err) throw err;
    documentation.formats.md(res, {}, function(err, output) {
      if (err) throw err;
      fs.writeFileSync('./docs/api/' + fileName + '.md', output);
    });
  });
});
github dekk-app / dekk / scripts / docgen.js View on Github external
files.forEach(file => {
    documentation
      .build([file], {shallow: true})
      .then(documentation.formats.md)
      .then(output => handleOutput(output, file))
  })
}
github devalpha-io / devalpha-node / scripts / generateApi.js View on Github external
    .then((comments) => documentation.formats.md(comments, {
      markdownToc: true
    }))
    .then(output => {
github downplay / jarl-react / demo / source / docs / api / documentationLoader.js View on Github external
function documentationLoader() {
    return documentation
        .build([this.resourcePath], {})
        .then(documentation.formats.json)
        .then(output => `module.exports = ${output};`);
}
github demiazz / lighty / build / docs.js View on Github external
function format(docs) {
  return documentation.formats.md(docs, {});
}