File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Copyright AGNTCY Contributors (https://github.com/agntcy)
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Note: This script generates the sphinx rst docs for the
6
+ # package models.
7
+
8
+ echo " API Models
9
+ ===============
10
+ "
11
+
12
+ for model in agntcy_acp/acp_v0/models/[a-z]* .py ; do
13
+ awk -f - " ${model} " << 'EOF '
14
+ /^class/ && /BaseModel/ {
15
+ match($2, "[^(]+");
16
+ MODEL = substr($2,RSTART,RLENGTH-RSTART+1);
17
+ printf("\`\`%s\`\`\n", MODEL);
18
+ print("***************************************");
19
+ printf(".. autopydantic_model:: agntcy_acp.models.%s\n", MODEL);
20
+ print(" :members:");
21
+ print(" :undoc-members:");
22
+ print(" :show-inheritance:\n");
23
+ }
24
+ /^class/ && /Enum/ {
25
+ match($2, "[^(]+");
26
+ MODEL = substr($2,RSTART,RLENGTH-RSTART+1);
27
+ printf("\`\`%s\`\`\n", MODEL);
28
+ print("***************************************");
29
+ printf(".. autoclass:: agntcy_acp.models.%s\n", MODEL);
30
+ print(" :members:");
31
+ print(" :undoc-members:");
32
+ print(" :show-inheritance:\n");
33
+ }
34
+ EOF
35
+ done
You can’t perform that action at this time.
0 commit comments