|
1 | 1 | There are several steps needed to document new API command:
|
2 | 2 |
|
3 |
| -1. edit cmds-list and add the new command |
4 |
| -2. (optional) run: ./generate-templates cmds-list |
5 |
| - This will go through the list of commands listed in cmds-list |
6 |
| - and will check if there are corresponding JSON files in api/name.json |
| 3 | +1. (optional) run: ./generate-templates cmd1 cmd2... |
| 4 | + This will go through the list of commands given in arguments |
| 5 | + and will check if there are corresponding JSON files in name.json |
7 | 6 | If the file is missing, a new JSON will be created using template.
|
8 | 7 | If you dislike this generator, you can always use _template.json
|
9 | 8 | and copy it over under the name of a new command.
|
10 |
| -3. Edit api/command-name.json. If the command is provided by the daemon |
| 9 | +2. Edit command-name.json. If the command is provided by the daemon |
11 | 10 | out of its own (and not via hook), simply delete the hook entry.
|
12 | 11 | If you don't want to provide command syntax (cmd-syntax key),
|
13 | 12 | any comments about the syntax (cmd-comment key) or response syntax
|
14 | 13 | (resp-syntax) or any comment about response (resp-comment), simply
|
15 | 14 | remove those unused keys. The generator will attempt to generate
|
16 | 15 | boilerplates for it.
|
| 16 | +3. Update api_files.mk. You can also run: ./generate-api-files > api_files.mk |
| 17 | + or check the update by: ./generate-api-files | diff - api_files.mk |
17 | 18 | 4. Rebuild User's Guide as usual, run in doc/sphinx folder: make
|
18 | 19 |
|
19 | 20 | Files in this directory:
|
20 | 21 | - README: this file
|
21 | 22 | - _template.json: template used by generate-templates
|
22 | 23 | - api-files.mk: list of command files for inclusion in Makefiles
|
23 |
| - (build from 'ls [a-z]*.json > api-files.mk') |
24 |
| - - cmds-list: list of commands, used as the argument of generate-templates |
25 |
| - (build by 'ls [a-z]*.json | sed 's/\.json//' | sort') |
26 |
| - - generate-templates: script generating a new command file from the |
27 |
| - command list (cmds-list) and the template (_template.json) |
| 24 | + (can be build by ./generata-api-files) |
| 25 | + - generate-templates: script generating new command files from the |
| 26 | + the template (_template.json) |
| 27 | + - generate-api-files: script generating api-files.mk |
0 commit comments