Skip to content

Commit 92350a8

Browse files
committed
Updates script to persist references
1 parent e868e23 commit 92350a8

File tree

4 files changed

+4698
-3
lines changed

4 files changed

+4698
-3
lines changed

bin/docs_scripts/doc_constant.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
from typing import Dict, Union
6+
from posthog.version import VERSION
67

78
# Documentation generation metadata
89
DOCUMENTATION_METADATA = {
@@ -27,8 +28,9 @@
2728

2829
# Output file configuration
2930
OUTPUT_CONFIG: Dict[str, Union[str, int]] = {
30-
"output_dir": ".",
31-
"filename": "posthog-python-references.json",
31+
"output_dir": "./references",
32+
"filename": f"posthog-python-references-{VERSION}.json",
33+
"filename_latest": "posthog-python-references-latest.json",
3234
"indent": 2,
3335
}
3436

bin/docs_scripts/generate_json_schemas.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,19 @@ def generate_sdk_documentation():
460460
try:
461461
documentation = generate_sdk_documentation()
462462

463-
# Write to file
464463
output_file = os.path.join(
465464
str(OUTPUT_CONFIG["output_dir"]), str(OUTPUT_CONFIG["filename"])
466465
)
466+
output_file_latest = os.path.join(
467+
str(OUTPUT_CONFIG["output_dir"]), str(OUTPUT_CONFIG["filename_latest"])
468+
)
469+
470+
# Write to current version
467471
with open(output_file, "w") as f:
468472
json.dump(documentation, f, indent=int(OUTPUT_CONFIG["indent"]))
473+
# Write to latest
474+
with open(output_file_latest, "w") as f:
475+
json.dump(documentation, f, indent=int(OUTPUT_CONFIG["indent"]))
469476

470477
print(f"✓ Generated {output_file}")
471478

0 commit comments

Comments
 (0)