Skip to content

Commit

Permalink
Remove build options for GLSL and GL only, we always want to build bo…
Browse files Browse the repository at this point in the history
…th. Update the front page CSS for alignment and prettiness.
  • Loading branch information
BSVino committed May 9, 2015
1 parent 6da7642 commit 2786319
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 127 deletions.
112 changes: 10 additions & 102 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

parser.add_argument('--full', dest='buildmode', action='store_const', const='full', default='fast', help='Full build (Default: fast build)')

parser.add_argument('--only-gl', dest='buildtype', action='store_const', const='gl', default='all', help='build GLSL docs only (Default: GL and GLSL)')

parser.add_argument('--only-glsl', dest='buildtype', action='store_const', const='glsl', default='all', help='build OpenGL docs only (Default: GL and GLSL)')

########################## Print ##########################

args = parser.parse_args()
Expand All @@ -34,27 +30,13 @@
else:
print "FAST BUILD"

if args.buildtype == 'gl':
print "BUILD OpenGL Docs only"
elif args.buildtype == 'glsl':
print "BUILD GLSL Docs only"
else:
print "BUILD OpenGL and GLSL Docs only"

def create_directory(dir):
if not os.path.exists(dir):
os.makedirs(dir)

########################## Output Directory Selection ##########################

output_dir = ""

if args.buildtype == 'gl':
output_dir = "htdocs_gl/"
elif args.buildtype == 'glsl':
output_dir = "htdocs_glsl/"
else:
output_dir = "htdocs/"
output_dir = "htdocs/"

print "Resetting output dir..."
while os.path.exists(output_dir):
Expand Down Expand Up @@ -100,14 +82,7 @@ def create_directory(dir):
#Todo: use one index only
#the header and index is different for each build

index_path = ""

if args.buildtype == 'glsl':
index_path = "html_index/index_glsl.html"
elif args.buildtype == 'gl':
index_path = "html/index.html"
else: #both GL GLSL
index_path = "html_index/index_all.html"
index_path = "html/index.html"

################### Open Header, Footer and Search.js template #####################

Expand Down Expand Up @@ -155,10 +130,6 @@ def create_directory(dir):
#OpenGL Loop
for command in index_commands_version:

#Quick Hack instead of including the whole loop in a IF statement
if args.buildtype == 'glsl':
break

major_versions = opengl.get_major_versions_available(command)

aliases = {}
Expand Down Expand Up @@ -228,9 +199,6 @@ def create_directory(dir):
#GLSL Loop
for command in glsl_index_commands_version:

if args.buildtype == 'gl':
break;

major_versions = glsl.get_major_versions_available(command)

aliases = {}
Expand Down Expand Up @@ -319,9 +287,6 @@ def create_directory(dir):
#OpenGL Loop
for version in opengl.version_commands:

if args.buildtype == 'glsl':
break;

if version[0:2] == "gl" and float(version[2:]) < 2.1:
continue

Expand Down Expand Up @@ -355,9 +320,6 @@ def create_directory(dir):
#GLSL Loop
for version in glsl.version_commands:

if args.buildtype == 'gl':
break;

if version[0:2] == "sl" and float(version[2:]) < 4.0:
continue

Expand Down Expand Up @@ -397,9 +359,6 @@ def create_directory(dir):
#OpenGL Loop
for command in opengl.commands_version:

if args.buildtype == 'glsl':
break;

major_versions = opengl.get_major_versions(opengl.commands_version[command])
for version in major_versions:
if int(version[2]) < 2:
Expand All @@ -409,9 +368,6 @@ def create_directory(dir):
#GLSL Loop
for command in glsl.commands_version:

if args.buildtype == 'gl':
break;

major_versions = glsl.get_major_versions(glsl.commands_version[command])
for version in major_versions:
if int(version[2]) < 3:
Expand All @@ -424,9 +380,6 @@ def create_directory(dir):
#OpenGL Loop
for command in opengl.commands_version_flat:

if args.buildtype == 'glsl':
break;

if command in opengl.commands_version:
continue

Expand All @@ -439,9 +392,6 @@ def create_directory(dir):
#GLSL Loop
for command in glsl.commands_version_flat:

if args.buildtype == 'gl':
break;

if command in glsl.commands_version:
continue
major_versions = glsl.get_major_versions(glsl.commands_version_flat[command])
Expand All @@ -464,9 +414,6 @@ def create_directory(dir):
#OpenGL Aliases
for version in search_function_aliases:

if args.buildtype == 'glsl':
break;

search_versions_commands += "'" + version + "':{"
for alias in search_function_aliases[version]:
search_versions_commands += alias + ":'" + search_function_aliases[version][alias] + "',"
Expand All @@ -475,9 +422,6 @@ def create_directory(dir):
#GLSL Aliases
for version in glsl_search_function_aliases:

if args.buildtype == 'gl':
break;

if version == 'sl3':
continue

Expand All @@ -502,9 +446,6 @@ def create_directory(dir):
#OpenGL Loop
for version_option in glsl.version_commands.keys():

if args.buildtype == 'gl':
break;

if version_option[0:2] == "sl" and float(version_option[2:]) < 4.0:
continue

Expand All @@ -519,9 +460,6 @@ def create_directory(dir):
#GLSL Loop
for version_option in opengl.version_commands.keys():

if args.buildtype == 'glsl':
break;

if version_option[0:2] == "gl" and float(version_option[2:]) < 2.1:
continue

Expand Down Expand Up @@ -614,13 +552,7 @@ def spew_category(name, commands, current_command, api):
glsl_version_numbers = glsl.version_commands.keys()
glsl_major_versions = glsl.get_major_versions(glsl.version_commands.keys())

if args.buildtype == 'gl':
#keep major_versions as it is
print ""
elif args.buildtype == 'glsl':
major_versions = glsl_major_versions
else:
major_versions += glsl_major_versions
major_versions += glsl_major_versions

major_versions.sort()

Expand All @@ -641,14 +573,9 @@ def spew_category(name, commands, current_command, api):

all_versions = [];

if args.buildtype == 'gl':
all_versions = opengl.version_commands.keys()
elif args.buildtype == 'glsl':
all_versions = glsl.version_commands.keys()
else:
all_versions = opengl.version_commands.keys()
glsl_all_versions = glsl.version_commands.keys()
all_versions += glsl_all_versions
all_versions = opengl.version_commands.keys()
glsl_all_versions = glsl.version_commands.keys()
all_versions += glsl_all_versions

all_versions.sort()

Expand Down Expand Up @@ -751,15 +678,8 @@ def spew_category(name, commands, current_command, api):
if len(glsl_unhandled_commands):
glsl_api_commands += spew_category("Uncategorized", glsl_unhandled_commands, command,"sl")

if args.buildtype == 'gl':
header_for_command = header_for_command.replace("{$api_commands}", api_commands)
header_for_command = header_for_command.replace("{$glsl_api_commands}", "")
elif args.buildtype == 'glsl':
header_for_command = header_for_command.replace("{$glsl_api_commands}", glsl_api_commands)
header_for_command = header_for_command.replace("{$api_commands}", "")
else:
header_for_command = header_for_command.replace("{$api_commands}", api_commands)
header_for_command = header_for_command.replace("{$glsl_api_commands}", glsl_api_commands)
header_for_command = header_for_command.replace("{$api_commands}", api_commands)
header_for_command = header_for_command.replace("{$glsl_api_commands}", glsl_api_commands)

header_for_command = header_for_command.replace("{$current_api}", latest_version.replace(".", ""))

Expand Down Expand Up @@ -975,20 +895,8 @@ def replace_alias(matchobj):
if len(glsl_unhandled_commands):
glsl_api_commands += spew_category("Uncategorized", glsl_unhandled_commands, "","sl")

#header_for_page = header_for_page.replace("{$api_commands}", api_commands)
#header_for_page = header_for_page.replace("{$glsl_api_commands}", glsl_api_commands)

#May not be necessary but just to be on the safe side
if args.buildtype == 'gl':
header_for_page = header_for_page.replace("{$api_commands}", api_commands)
header_for_page = header_for_page.replace("{$glsl_api_commands}", "")
elif args.buildtype == 'glsl':
header_for_page = header_for_page.replace("{$api_commands}", "")
header_for_page = header_for_page.replace("{$glsl_api_commands}", glsl_api_commands)
else:
header_for_page = header_for_page.replace("{$api_commands}", api_commands)
header_for_page = header_for_page.replace("{$glsl_api_commands}", glsl_api_commands)

header_for_page = header_for_page.replace("{$api_commands}", api_commands)
header_for_page = header_for_page.replace("{$glsl_api_commands}", glsl_api_commands)

header_for_page = header_for_page.replace("{$current_api}", latest_minor.replace(".", ""))
header_for_page = header_for_page.replace("{$command_versions}", "")
Expand Down
16 changes: 15 additions & 1 deletion html/copy/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ a {
float: left;
font-size: 20px;
margin-left: 20px;
margin-top: 10px;
}

#es_api {
Expand All @@ -361,12 +362,25 @@ a {
}

#buttonpanel {
width: 850px;
width: 780px;
margin-left: auto;
margin-right: auto;
margin-bottom: 80px;
}

#buttonpanel_sl {
width: 550px;
margin-left: auto;
margin-right: auto;
margin-bottom: 180px;
}

#front_instructions {
font-style: italic;
color: #bbb;
text-align: center;
}

#frontsearch {
font-size: 22px;
}
Expand Down
87 changes: 63 additions & 24 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@

$( "#es_api" ).buttonset();
$( "#gl_api" ).buttonset();
$( "#el_api" ).buttonset();
$( "#sl_api" ).buttonset();
$( "#allapi" ).buttonset();
window.base_directory = "";

Expand All @@ -91,6 +93,16 @@
window.search_api = id.substring(0, 3) + "." + id.substring(3, 4);
front_filter_fn();
});
$( "#el_api" ).change(function( event, ui ) {
id = event.target.id;
window.search_api = id.substring(0, 3) + "." + id.substring(3, 4);
front_filter_fn();
});
$( "#sl_api" ).change(function( event, ui ) {
id = event.target.id;
window.search_api = id.substring(0, 3) + "." + id.substring(3, 4);
front_filter_fn();
});
$( "#allapi" ).change(function( event, ui ) {
id = event.target.id;
window.search_api = 'all';
Expand All @@ -113,34 +125,61 @@
<div style="width: 950px; margin-left: auto; margin-right: auto; text-align: right"><a href="about.html">about docs.gl</a></div>
<div id="front_page">
<img src="logo-lg.png" /><br />
OpenGL API Documentation<br /><br /><br />


OpenGL API Documentation<br /><br />
<div id="buttonpanel">
<div id="es_api" class="apibuttons">
OpenGL ES<br />
<input type="radio" id="es20" name="api"><label for="es20">2.0</label>
<input type="radio" id="es30" name="api"><label for="es30">3.0</label>
<input type="radio" id="es31" name="api"><label for="es31">3.1</label>
</div>
<div id="gl_api" class="apibuttons">
OpenGL<br />
<input type="radio" id="gl21" name="api"><label for="gl21">2.1</label>
<input type="radio" id="gl30" name="api"><label for="gl30">3.0</label>
<input type="radio" id="gl31" name="api"><label for="gl31">3.1</label>
<input type="radio" id="gl32" name="api"><label for="gl32">3.2</label>
<input type="radio" id="gl33" name="api"><label for="gl33">3.3</label>
<input type="radio" id="gl40" name="api"><label for="gl40">4.0</label>
<input type="radio" id="gl41" name="api"><label for="gl41">4.1</label>
<input type="radio" id="gl42" name="api"><label for="gl42">4.2</label>
<input type="radio" id="gl43" name="api"><label for="gl43">4.3</label>
<input type="radio" id="gl44" name="api"><label for="gl44">4.4</label>
<input type="radio" id="gl45" name="api"><label for="gl45">4.5</label>
</div>
<div id="allapi" class="apibuttons">
<br />
<input type="radio" id="all" name="api" checked="checked"><label for="all">All</label>
<div id="es_api" class="apibuttons">
OpenGL ES<br />
<input type="radio" id="es20" name="api"><label for="es20">2.0</label>
<input type="radio" id="es30" name="api"><label for="es30">3.0</label>
<input type="radio" id="es31" name="api"><label for="es31">3.1</label>
</div>
<div id="gl_api" class="apibuttons">
OpenGL<br />
<input type="radio" id="gl21" name="api"><label for="gl21">2.1</label>
<input type="radio" id="gl30" name="api"><label for="gl30">3.0</label>
<input type="radio" id="gl31" name="api"><label for="gl31">3.1</label>
<input type="radio" id="gl32" name="api"><label for="gl32">3.2</label>
<input type="radio" id="gl33" name="api"><label for="gl33">3.3</label>
<input type="radio" id="gl40" name="api"><label for="gl40">4.0</label>
<input type="radio" id="gl41" name="api"><label for="gl41">4.1</label>
<input type="radio" id="gl42" name="api"><label for="gl42">4.2</label>
<input type="radio" id="gl43" name="api"><label for="gl43">4.3</label>
<input type="radio" id="gl44" name="api"><label for="gl44">4.4</label>
<input type="radio" id="gl45" name="api"><label for="gl45">4.5</label>
</div>
</div>
<div id="buttonpanel_sl">
<div id="el_api" class="apibuttons">
GLSL ES<br />
<!--<input type="radio" id="el10" name="api"><label for="el10">1.0</label>-->
<input type="radio" id="el30" name="api"><label for="el30">3.0</label>
<input type="radio" id="el31" name="api"><label for="el31">3.1</label>
</div>
<div id="sl_api" class="apibuttons">
GLSL<br />
<!--<input type="radio" id="sl11" name="api"><label for="sl11">1.1</label>
<input type="radio" id="sl12" name="api"><label for="sl12">1.2</label>
<input type="radio" id="sl13" name="api"><label for="sl13">1.3</label>
<input type="radio" id="sl14" name="api"><label for="sl14">1.4</label>
<input type="radio" id="sl15" name="api"><label for="sl15">1.5</label>
<input type="radio" id="sl33" name="api"><label for="sl33">3.3</label>-->
<input type="radio" id="sl40" name="api"><label for="sl40">4.0</label>
<input type="radio" id="sl41" name="api"><label for="sl41">4.1</label>
<input type="radio" id="sl42" name="api"><label for="sl42">4.2</label>
<input type="radio" id="sl43" name="api"><label for="sl43">4.3</label>
<input type="radio" id="sl44" name="api"><label for="sl44">4.4</label>
<input type="radio" id="sl45" name="api"><label for="sl45">4.5</label>
</div>
<div id="allapi" class="apibuttons">
<br />
<input type="radio" id="all" name="api" checked="checked"><label for="all">All</label>
</div>
</div>

<br clear="both" />
<div id="front_instructions">Type the name of a GL or GLSL command.</div>
<div><input id="frontsearch" size=50 /></div>
<div id="commandlist">{$commandlist}</div>
</div>
Expand Down
Loading

0 comments on commit 2786319

Please sign in to comment.