summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xmake_doc.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/make_doc.py b/make_doc.py
new file mode 100755
index 00000000..57285790
--- /dev/null
+++ b/make_doc.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python3
+"""Generate pydoc documentation and move it to the doc directory.
+THIS WILL DELETE ALL EXISTING HTML FILES IN THAT DIRECTORY, so don't
+store important content there."""
+
+import pydoc, os, sys
+if __name__ == '__main__':
+	docdir = 'doc'
+	os.chdir(sys.path[0])
+	try: os.mkdir(docdir)
+	except: pass
+
+
+	for fname in os.listdir(docdir):
+		if fname.endswith('.html'):
+			os.remove(os.path.join(docdir, fname))
+
+	pydoc.writedocs('.')
+
+	for fname in os.listdir('.'):
+		if fname.endswith('.html'):
+			os.rename(fname, os.path.join(docdir, fname))
+