diff --git a/doc/makepanda/makedocs.bat b/doc/makepanda/makedocs.bat new file mode 100644 index 0000000000..dcbe71bc9b --- /dev/null +++ b/doc/makepanda/makedocs.bat @@ -0,0 +1,26 @@ +@echo off + +REM +REM Verify that we can find the 'makedocs' python script +REM and the python interpreter. If we can find both, then +REM run 'makedocs'. +REM + +if not exist makepanda\makedocs.py goto :missing1 +if not exist thirdparty\win-python\python.exe goto :missing2 +thirdparty\win-python\python.exe makepanda\makedocs.py %* +goto done + +:missing1 + echo You need to change directory to the root of the panda source tree + echo before invoking makedocs. + goto done + +:missing2 + echo You seem to be missing the 'thirdparty' directory. You probably checked + echo the source code out from sourceforge. The sourceforge repository is + echo missing the 'thirdparty' directory. You will need to supplement the + echo code by downloading the 'thirdparty' directory from panda3d.etc.cmu.edu + goto done + +:done diff --git a/doc/makepanda/makedocs.py b/doc/makepanda/makedocs.py new file mode 100644 index 0000000000..1f69f8e780 --- /dev/null +++ b/doc/makepanda/makedocs.py @@ -0,0 +1,77 @@ +######################################################################## +## +## Win32 Usage: makepanda\makedocs.bat +## Linux Usage: makepanda/makedocs.py +## +######################################################################## + +import sys,os,re +sys.path = ["direct/src/directscripts"] + sys.path +import gendocs + +######################################################################## +## +## Some handy utility functions. +## +######################################################################## + +def MakeDirectory(path): + if os.path.isdir(path): return 0 + os.mkdir(path) + +######################################################################## +## +## Read the version number from built/include/pandaVersion.h +## +######################################################################## + +VERSION="0.0.0" +try: + f = file("built/include/pandaVersion.h","r") + pattern = re.compile('^\s*[#]\s*define\s+PANDA_VERSION_STR\s+["]([0-9.]+)["]') + for line in f: + match = pattern.match(line,0) + if (match): + VERSION = match.group(1) + break + f.close() +except: sys.exit("Cannot read version number from built/include/pandaVersion.h") + +print "Generating docs for "+VERSION + +######################################################################## +## +## Make sure panda has been built. +## +######################################################################## + +if (os.path.isfile("built/pandac/input/libpgraph.in")==0) or (os.path.isfile("built/pandac/input/libputil.in")==0): + sys.exit("Cannot read the interrogate-output files in built/pandac/input") + +######################################################################## +## +## Generate the PHP version. +## +## The manual is in the form of a bunch of HTML files that can be +## included by a PHP script called "/apiref.php". +## +######################################################################## + +MakeDirectory("apiref-php") +gendocs.generate(VERSION, "built/pandac/input", "direct", "apiref-php", "", "", "/apiref.php?page=", "") + +######################################################################## +## +## Generate the HTML version. +## +## The manual is in the form of a bunch of standalone HTML files +## that contain links to each other. +## +######################################################################## + +HEADER = "\n" +FOOTER = "\n" + +MakeDirectory("apiref-html") +gendocs.generate(VERSION, "built/pandac/input", "direct", "apiref-html", HEADER, FOOTER, "", ".html") +