vscode: Create renpy.json when the documentation is built.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
build
|
||||
/renpy.json
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user