vscode: Create renpy.json when the documentation is built.

This commit is contained in:
Tom Rothamel
2024-07-09 22:05:46 -04:00
parent 5b01a7c678
commit 0db128da75
3 changed files with 9 additions and 4 deletions
+1
View File
@@ -1 +1,2 @@
build
/renpy.json
+5 -4
View File
@@ -3,6 +3,8 @@ import os
import re
import json
SPHINX = os.path.abspath(os.path.dirname(__file__) + "/..")
DEPRECATED = [
"ui."
"im."
@@ -29,7 +31,7 @@ class LineIterator:
and blank lines.
"""
filename = "source/" + filename
filename = SPHINX + "/source/" + filename
last_indent = 0
@@ -108,7 +110,7 @@ class Documentation:
self.config = { }
self.internal = { }
for i in os.listdir("source"):
for i in os.listdir(SPHINX + "/source"):
if i.endswith(".rst"):
basename = i[:-4]
li = LineIterator(i)
@@ -254,7 +256,6 @@ class Documentation:
self.renpy[name] = entry
def main():
os.chdir(os.path.dirname(__file__) + "/../..")
d = Documentation()
@@ -267,7 +268,7 @@ def main():
"internal": sort(d.internal),
}
with open("renpy.json", "w") as f:
with open(SPHINX + "/renpy.json", "w") as f:
json.dump(renpy_json, f, indent=2)
+3
View File
@@ -4,6 +4,7 @@
init 1000000 python:
import doc
import shaderdoc
import renpy_json
del object.__init__
@@ -54,4 +55,6 @@ init 1000000 python:
with open(os.path.join(incdir, "console_commands"), "w") as f:
f.write(console_commands)
renpy_json.main()
raise SystemExit