diff --git a/.gitignore b/.gitignore index 57d99ad0..c7352739 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /htdocs /*.pyc +/html/copy/jquery-ui.min.js +/html/copy/jquery.min.js diff --git a/compile.py b/compile.py index 799b4100..7d601828 100644 --- a/compile.py +++ b/compile.py @@ -77,8 +77,94 @@ def create_directory(dir): search_fp = open("html/docs.gl.search.js") search = search_fp.read() search_fp.close() + +index_fp = open("html/index.html") +index = index_fp.read() +index_fp.close() print "Done." +if os.path.exists('html/copy/jquery.min.js'): + index = index.replace("{$jquery}", "") +else: + index = index.replace("{$jquery}", "") + +if os.path.exists('html/copy/jquery-ui.min.js'): + index = index.replace("{$jqueryui}", "") +else: + index = index.replace("{$jqueryui}", "") + +index_commands_version = opengl.commands_version_flat.keys() +index_commands_version.sort() +index_versions_commands = "" +for command in index_commands_version: + major_versions = opengl.get_major_versions_available(command) + + aliases = {} + # Add aliases to this command. Need to do this because ES has glClearDepthf while GL has glClearDepth + for alias in opengl.aliased_functions[command]: + if alias == command: + continue + if alias in index_commands_version: + for version in opengl.get_major_versions_available(alias): + if not version in major_versions: + major_versions.append(version) + aliases[version] = alias + + # If the command is an alias we've already done it, skip + if command in opengl.function_aliases and command != opengl.function_aliases[command] and opengl.function_aliases[command] in index_commands_version: + continue + + latest_version = '' + all_major_versions_available = [] + for version in major_versions: + if len(latest_version) == 0 or (latest_version[:2] == 'es' and version[:2] == 'gl') or (latest_version[:2] == version[:2] and float(version[2:]) > float(latest_version[2:])): + latest_version = version + + all_major_versions_available.append(version) + + index_versions_commands += "" + command + "" + + all_major_versions = opengl.get_major_versions(opengl.version_commands_flat.keys()) + for version in all_major_versions: + if int(version[2:3]) < 2: + continue + alias = command + + if version in aliases: + alias = aliases[version] + + if version in all_major_versions_available: + index_versions_commands += "" + version + "" + else: + index_versions_commands += " " + index_versions_commands += "
\n" + +index = index.replace("{$commandlist}", index_versions_commands) + +index_fp = open(output_dir + "/index.html", "w") +index_fp.write(index) +index_fp.close() + + + + search_versions_commands = "var search_versions = {" search_function_aliases = {} for version in opengl.version_commands: diff --git a/html/copy/style_dark.css b/html/copy/style_dark.css index fe256fe1..11fe941b 100644 --- a/html/copy/style_dark.css +++ b/html/copy/style_dark.css @@ -15,6 +15,10 @@ a:hover { color: #71acf1; } +.commandcolumn, .versioncolumn { + background-color: #111; +} + .function { color: #ccc; background-color: #252525; diff --git a/html/copy/style_light.css b/html/copy/style_light.css index f4eed40f..42544272 100644 --- a/html/copy/style_light.css +++ b/html/copy/style_light.css @@ -15,6 +15,10 @@ a:hover { color: #358acc; } +.commandcolumn, .versioncolumn { + background-color: #eee; +} + .function { color: #333; background-color: #e5e5e5; diff --git a/html/copy/index.html b/html/index.html similarity index 63% rename from html/copy/index.html rename to html/index.html index f4e81d2c..c0d4c54f 100644 --- a/html/copy/index.html +++ b/html/index.html @@ -4,41 +4,67 @@ docs.gl - +{$jquery} - +{$jqueryui} + + \ No newline at end of file