Skip to content

Commit 160d426

Browse files
committed
[jsdoc] Refactoring
1 parent de1d437 commit 160d426

28 files changed

+777
-1340
lines changed

scripts/sdkjs_common/jsdoc/README.md

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
21
# Documentation Generation Guide
32

4-
This guide explains how to generate documentation for Onlyoffice Builder/Plugins API using the provided Python scripts: `generate_docs_json.py`, `generate_docs_plugins_json.py`, `generate_docs_md.py`. These scripts are used to create JSON and Markdown documentation for the `apiBuilder.js` files from the word, cell, and slide editors.
3+
This guide explains how to generate documentation for Onlyoffice Builder and
4+
Plugins (Methods/Events) API using the following Python scripts:
5+
6+
- `office-api/generate_docs_md.py`
7+
- `plugins/generate_docs_methods_json.py`
8+
- `plugins/generate_docs_events_md.py`
59

610
## Requirements
711

@@ -20,61 +24,112 @@ npm install
2024

2125
## Scripts Overview
2226

23-
### `generate_docs_json.py`
27+
### `office-api/generate_docs_json.py`
2428

2529
This script generates JSON documentation based on the `apiBuilder.js` files.
2630

2731
- **Usage**:
32+
2833
```bash
2934
python generate_docs_json.py output_path
3035
```
3136

3237
- **Parameters**:
33-
- `output_path` (optional): The directory where the JSON documentation will be saved. If not specified, the default path is `../../../../office-js-api-declarations/office-js-api`.
38+
- `output_path` (optional): The directory where the JSON documentation will be
39+
saved. If not specified, the default path is
40+
`../../../../office-js-api-declarations/office-js-api`.
41+
42+
### `office-api/generate_docs_md.py`
43+
44+
This script generates Markdown documentation from the `apiBuilder.js` files.
45+
46+
- **Usage**:
47+
48+
```bash
49+
python generate_docs_md.py output_path
50+
```
51+
52+
- **Parameters**:
53+
- `output_path` (optional): The directory where the Markdown documentation will
54+
be saved. If not specified, the default path is
55+
`../../../../office-js-api/`.
3456

35-
### `generate_docs_plugins_json.py`
57+
### `plugins/generate_docs_methods_json.py`
3658

3759
This script generates JSON documentation based on the `api_plugins.js` files.
3860

3961
- **Usage**:
62+
4063
```bash
41-
python generate_docs_plugins_json.py output_path
64+
python generate_docs_methods_json.py output_path
4265
```
4366

4467
- **Parameters**:
45-
- `output_path` (optional): The directory where the JSON documentation will be saved. If not specified, the default path is `../../../../office-js-api-declarations/office-js-api-plugins`.
68+
- `output_path` (optional): The directory where the JSON documentation will be
69+
saved. If not specified, the default path is
70+
`../../../../office-js-api-declarations/office-js-api-plugins`.
4671

47-
### `generate_docs_md.py`
72+
### `plugins/generate_docs_events_json.py`
4873

49-
This script generates Markdown documentation from the `apiBuilder.js` files.
74+
This script generates JSON documentation based on the `plugin-events.js` files.
5075

5176
- **Usage**:
77+
5278
```bash
53-
python generate_docs_md.py output_path
79+
python generate_docs_events_json.py output_path
5480
```
5581

5682
- **Parameters**:
57-
- `output_path` (optional): The directory where the Markdown documentation will be saved. If not specified, the default path is `../../../../office-js-api/`.
83+
- `output_path` (optional): The directory where the JSON documentation will be
84+
saved. If not specified, the default path is
85+
`../../../../office-js-api-declarations/office-js-api-plugins`.
86+
87+
### `plugins/generate_docs_methods_md.py`
88+
89+
This script generates Markdown documentation from the `api_plugins.js` files.
90+
91+
- **Usage**:
92+
93+
```bash
94+
python generate_docs_methods_md.py output_path
95+
```
96+
97+
- **Parameters**:
98+
- `output_path` (optional): The directory where the Markdown documentation will
99+
be saved. If not specified, the default path is
100+
`../../../../office-js-api/`.
101+
102+
### `plugins/generate_docs_events_md.py`
103+
104+
This script generates Markdown documentation from the `plugin-events.js` files.
105+
106+
- **Usage**:
107+
108+
```bash
109+
python generate_docs_events_md.py output_path
110+
```
111+
112+
- **Parameters**:
113+
- `output_path` (optional): The directory where the Markdown documentation will
114+
be saved. If not specified, the default path is
115+
`../../../../office-js-api/`.
58116

59117
## Example
60118

61119
To generate JSON documentation with the default output path:
62-
```bash
63-
python generate_docs_json.py /path/to/save/json
64-
```
65120

66-
To generate JSON documentation with the default output path:
67121
```bash
68-
python generate_docs_plugins_json.py /path/to/save/json
122+
python generate_docs_json.py /path/to/save/json
69123
```
70124

71125
To generate Markdown documentation and specify a custom output path:
126+
72127
```bash
73128
python generate_docs_md.py /path/to/save/markdown
74129
```
75130

76131
## Notes
77132

78-
- Make sure to have all necessary permissions to run these scripts and write to the specified directories.
133+
- Make sure to have all necessary permissions to run these scripts and write to
134+
the specified directories.
79135
- The output directories will be created if they do not exist.
80-

scripts/sdkjs_common/jsdoc/config/builder/slide.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)