0

I am looking to use apiDoc to document a WebAPI interface. The apiDoc documentation mentions the use of a package.json file to specify things like the project name and latest API version. Unfortunately, I can't get this to work. Where should this file be placed? I have tried placing it in the folder with the documented code, in the folder with the generated documentation code, and in the folder from which apiDoc is called, but in all cases I receive the message:

apidoc: No package.json found!

Is there a trick I haven't found here?

Darren Oster
  • 9,146
  • 10
  • 48
  • 66

2 Answers2

1

Place it into the root dir of your project (where your source-files are). Run apidoc in your root-dir.

Peter
  • 42
  • 1
  • Thanks Peter. For those who come after, I found that it also doesn't work if the package.json file is UTF-8 encoded - it needs to be ANSI. Gotta love standards! – Darren Oster Jun 17 '14 at 00:44
0

If you are using gulp-apidoc or grunt-apidoc, you can use the config -c flag to specify the location of the package.json or apidoc.json. Like so:

apidoc({
      src: ["../pathToSrc"],
      dest: "./docs",
      config: "./pathToConfig"
    },done);
zx485
  • 28,498
  • 28
  • 50
  • 59
jonatans
  • 13
  • 1
  • 3