Skip to content

Commit

Permalink
Site design improvements by Felix Kaaman.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSVino committed Jun 15, 2015
1 parent 08806af commit f2e0355
Show file tree
Hide file tree
Showing 11 changed files with 510 additions and 346 deletions.
21 changes: 12 additions & 9 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def create_directory(dir):
if version in all_major_versions_available:
index_versions_commands += "<span class='versioncolumn'><a href='" + version + "/" + alias + "'>" + version + "</a></span>"
else:
index_versions_commands += "<span class='versioncolumn'>&nbsp;</span>"
index_versions_commands += "<br /></span>\n"
index_versions_commands += "<span class='versioncolumn disabled'>" + version + "</span>"
index_versions_commands += "</span>\n"

#GLSL Loop
for command in glsl_index_commands_version:
Expand Down Expand Up @@ -267,8 +267,11 @@ def create_directory(dir):
else:
glsl_index_versions_commands += "<span class='slversioncolumn'><a href='" + version + "/" + alias + "'>glsl-es" + version[2:3] + "</a></span>"
else:
glsl_index_versions_commands += "<span class='slversioncolumn'>&nbsp;</span>"
glsl_index_versions_commands += "<br /></span>\n"
if version[0:2] == "sl":
glsl_index_versions_commands += "<span class='slversioncolumn disabled'>glsl" + version[2:3] + "</span>"
else:
glsl_index_versions_commands += "<span class='slversioncolumn disabled'>glsl-es" + version[2:3] + "</a></span>"
glsl_index_versions_commands += "</span>\n"

index = index.replace("{$commandlist}", index_versions_commands+glsl_index_versions_commands)

Expand Down Expand Up @@ -611,13 +614,13 @@ def spew_category(name, commands, current_command, api):
selected = " selected='selected'"

if version_option[:2] == 'gl':
toc_versions_options = toc_versions_options + "<option value='" + version_option.replace(".", "") + "'" + selected + ">GL" + version_option[2:] + "</option>"
toc_versions_options = toc_versions_options + "<option class='versions_option' value='" + version_option.replace(".", "") + "'" + selected + ">OpenGL " + version_option[2:] + "</option>"
elif version_option[:2] == 'es':
toc_versions_options = toc_versions_options + "<option value='" + version_option.replace(".", "") + "'" + selected + ">GLES" + version_option[2:] + "</option>"
toc_versions_options = toc_versions_options + "<option class='versions_option' value='" + version_option.replace(".", "") + "'" + selected + ">OpenGL ES " + version_option[2:] + "</option>"
elif version_option[:2] == 'sl':
toc_versions_options = toc_versions_options + "<option value='" + version_option.replace(".", "") + "'" + selected + ">GLSL" + version_option[2:] + "</option>"
toc_versions_options = toc_versions_options + "<option class='versions_option' value='" + version_option.replace(".", "") + "'" + selected + ">GLSL " + version_option[2:] + "</option>"
elif version_option[:2] == 'el':
toc_versions_options = toc_versions_options + "<option value='" + version_option.replace(".", "") + "'" + selected + ">GLSL ES" + version_option[2:] + "</option>"
toc_versions_options = toc_versions_options + "<option class='versions_option' value='" + version_option.replace(".", "") + "'" + selected + ">GLSL ES " + version_option[2:] + "</option>"


header_for_version = header_for_version.replace("{$versions_options}", toc_versions_options)
Expand Down Expand Up @@ -814,7 +817,7 @@ def replace_alias(matchobj):
code = re.sub(r"\{%([a-zA-Z_][a-zA-Z_0-9]*?)\}", replace_alias, code).replace("\t", " ").replace("&", "&amp;")

code = re.sub(r"(?<![a-zA-Z0-9_])(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|size_t|NULL|GLbyte|GLshort|GLint|GLsizei|GLfloat|GLclampf|GLdouble|GLclampd|GLubyte|GLboolean|GLushort|GLuint|GLenum|GLbitfield|GLchar)(?![a-zA-Z0-9_])", r"<span class='ckeyword'>\1</span>", code)
code = re.sub(r"(GL_[A-Z_]*)", r"<span class='constant'>\1</span>", code)
code = re.sub(r"(GL_[A-Z_0-9]*)", r"<span class='constant'>\1</span>", code)
code = re.sub(r'(".*?")', r"<span class='codestring'>\1</span>", code)
code = re.sub(r'(//.*?)\n', r"<span class='codecomment'>\1</span>\n", code)

Expand Down
52 changes: 44 additions & 8 deletions html/copy/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,54 @@
});
</script>

<style>
.logo-bg {
text-align: center;

padding-top: 20px;
padding-bottom: 20px;
}

.logo {
font-family: "Helvetica Neue", "Helvetica";
font-weight: 300;
font-size: 76px;
padding: 20px;
margin: 0;
margin-top: 20px;
}

.logo-desc {
font-family: "Helvetica Neue", "Helvetica";
font-weight: 200;
}

.center-container {
margin-left: auto;
margin-right: auto;
text-align: center;
display: inline-block;
width: 800px;
}
</style>
</head>
<body>

<div id="front_page">
<img src="logo-lg.png" /><br />
OpenGL API Documentation<br /><br /><br />
<div style="width: 950px; margin-left: auto; margin-right: auto; text-align: right">
</div>
<div class="logo-bg">
<div class="logo-container">
<h1 class="logo">docs.<span class="thicken">GL</span></h1>
<p class="logo-desc">OpenGL API Documentation</p>
</div>
</div>

<p>docs.gl is an improvement of the official OpenGL documentation. It was written by <a href="http://twitter.com/VinoBS">Jorge Rodr&iacute;guez</a>. Each reference page is under individual copyright listed in that entry, all other content is in the public domain. docs.gl is completely unaffiliated with OpenGL and Khronos.</p>
<p>Anyone can contribute to docs.gl to improve the OpenGL documentation. The source code to docs.gl is <a href="https://github.com/BSVino/docs.gl">available on GitHub</a>. Pull requests and suggestions are welcome.</p>
<p><a href="https://github.com/BSVino/docs.gl/graphs/contributors">Full list of contributors</a></p>
<p><a href="docs.gl.zip">Download docs.gl for offline use.</a></p>
<p><a href="/">Back</a></p></div>
<div class="center-container">
<p>docs.gl is an improvement of the official OpenGL documentation. It was written by <a href="http://twitter.com/VinoBS">Jorge Rodr&iacute;guez</a>. GLSL support was contributed by <a href="https://github.com/Sohail05">Sohail Ajmal</a>. Additional site design improvements were contributed by <a href="https://github.com/fkaa">Felix Kaaman</a>. Each reference page is under individual copyright listed in that entry, all other content is in the public domain. docs.gl is completely unaffiliated with OpenGL and Khronos.</p>
<p>Anyone can contribute to docs.gl to improve the OpenGL documentation. The source code to docs.gl is <a href="https://github.com/BSVino/docs.gl">available on GitHub</a>. Pull requests and suggestions are welcome.</p>
<p><a href="https://github.com/BSVino/docs.gl/graphs/contributors">Full list of contributors</a></p>
<p><a href="docs.gl.zip">Download docs.gl for offline use.</a></p>
</div>

</div>

Expand Down
21 changes: 5 additions & 16 deletions html/copy/docs.gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ function set_api_version(version) {
}

$(function() {

$( "#command_categories" ).bonsai();
$( "#glsl_command_categories" ).bonsai();

$( "#versions_dropdown" ).selectmenu({
change: function( event, ui ) {
set_api_version(ui.item.value);
}
},
width: 150
});

if (typeof $.cookie("hide_deprecated") != 'undefined')
Expand Down Expand Up @@ -223,9 +225,7 @@ $(function() {


search_fn = function(value) {
version = $("#search_versions").val();
if (!version || typeof version == 'undefined')
version = 'all';
var version = 'all';

if (search_versions[version].indexOf(value) < 0)
return;
Expand Down Expand Up @@ -259,19 +259,8 @@ $(function() {
},
});

$( "#search_versions" ).selectmenu({
change: function( event, ui ) {
$("#search").val("");
$("#search").autocomplete( "option", "source", search_versions[$("#search_versions").val()] );
},
width: 70,
});

if (typeof $.cookie("api_version") != 'undefined')
{
$("#search_versions").val($.cookie("api_version").substring(0, 3) + "." + $.cookie("api_version").substring(3, 4)).selectmenu('refresh');
$("#search").autocomplete( "option", "source", search_versions[$("#search_versions").val()] );
}
$("#search").autocomplete( "option", "source", "all" );

$('#hide_deprecated').click(function() {
window.hide_deprecated = $(this).is(':checked');
Expand Down
Binary file removed html/copy/logo-lg.png
Binary file not shown.
Binary file removed html/copy/logo.png
Binary file not shown.
145 changes: 74 additions & 71 deletions html/copy/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,56 @@ a {
overflow-y: scroll;
}

#header {
width: 100%;
background-color: #aaa;
height: 55px;
border-bottom: 1px solid #666;
.toggle-container {
position: absolute;
top: 0;
right: 5px;
}

.thicken {
font-weight: 500;
}

.function {
border-radius: 2px;
}

.header-bg {

}

#header_inner {
.header-container {
width: 950px;
height: 55px;

margin-left: auto;
margin-right: auto;

padding-top: 20px;
padding-bottom: 20px;
}

.header-inner {
display: inline-block;
position: relative;
width: 100%;
}

.header-logo {
display: inline-block;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 20px;
}

#search_div {
.search-div {
float: right;
margin: 18px;
margin-top: 8px;
display: inline-block;
}

#search {

}

#search_button {
Expand All @@ -194,11 +226,6 @@ a {
top: -1px;
}

#search_versions-button {
position: relative;
top: 8px;
}

#styles {
float: right;
color: black;
Expand All @@ -216,10 +243,6 @@ a {
margin: 20px;
}

#hide_label {
font-size: 11px;
}

#khronos {
width: 610px;
float: left;
Expand All @@ -245,26 +268,23 @@ a {
#versions_container {
float: left;
display: block;
width: 120px;
text-align: right;
margin-bottom: 30px;
}

#api {
padding: 2px;
margin-left: 8px;
float: left;
#versions_dropdown-button > span.ui-selectmenu-text {
font-size: 18px;
font-weight: bold;
}

#command_versions {
float: right;
#hide_label {
font-size: 11px;
}

#opengl_name {
width: 125px;
display: block;
float: left;
margin-top: 2px;
font-size: 16px;
#hide_deprecated {
}

#command_versions {
float: right;
}

#command_categories, #command_categories a {
Expand Down Expand Up @@ -338,51 +358,35 @@ a {
width: 950px;
margin-left: auto;
margin-right: auto;
margin-top: 180px;
margin-top: 30px;
text-align: center;
}

.apibuttons {
float: left;
font-size: 20px;
margin-left: 20px;
margin-top: 10px;
}

#es_api {
width: 150px;
}

#gl_api {
width: 550px;
}

#allapi {
width: 50px;
}

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

#buttonpanel_sl {
width: 550px;
margin-left: auto;
margin-right: auto;
margin-bottom: 180px;
#frontsearch, #search {
font-size: 14px;
border-radius: 4px;
outline: none;
padding: 4px;
width: 275px;
font-family: Roboto, Helvetica;
margin-left: 10px;
float:left;
}

#front_instructions {
font-style: italic;
color: #bbb;
text-align: center;
#search {
margin:0;
position: absolute;
bottom:0;
right: 30px;
}

#frontsearch {
font-size: 22px;
#search_button {
margin: 0;
margin-top: 13px;
position: absolute;
bottom: 0px;
right: 0px;
height: 30px;
}

#frontsearch_button {
Expand All @@ -394,7 +398,6 @@ a {
}

#outer_disqus_thread {
background-color: #eee;
padding: 10px;
margin-top: 10px;
}
}
Loading

0 comments on commit f2e0355

Please sign in to comment.