summaryrefslogtreecommitdiffstats
path: root/src/share/api/README
blob: fa659f6f2dff3f39671e443fc3bfefd0cd093eff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
There are several steps needed to document new API command:

1. (optional) run: ./generate-templates cmd1 cmd2...
   This will go through the list of commands given in arguments
   and will check if there are corresponding JSON files in name.json
   If the file is missing, a new JSON will be created using template.
   If you dislike this generator, you can always use _template.json
   and copy it over under the name of a new command.
2. Edit command-name.json. If the command is provided by the daemon
   out of its own (and not via hook), simply delete the hook entry.
   If you don't want to provide command syntax (cmd-syntax key),
   any comments about the syntax (cmd-comment key) or response syntax
   (resp-syntax) or any comment about response (resp-comment), simply
   remove those unused keys. The generator will attempt to generate
   boilerplates for it.
3. Update api_files.mk. You can also run: ./generate-api-files > api_files.mk
   or check the update by: ./generate-api-files | diff - api_files.mk
4. Rebuild User's Guide as usual, run in doc/sphinx folder: make

Files in this directory:
 - README: this file
 - _template.json: template used by generate-templates
 - api-files.mk: list of command files for inclusion in Makefiles
   (can be build by ./generate-api-files)
 - generate-templates: script generating new command files from the
  the template (_template.json)
 - generate-api-files: script generating api-files.mk