Skip to content

Commit ccb23bb

Browse files
committed
Reorganize Halite Documentation
Reorganize how Halite is documented and switch from using HTML to using Markdown.
1 parent bbe7cbe commit ccb23bb

26 files changed

+1158
-46
lines changed

website/bot_overview.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<html lang="en">
2+
<head>
3+
<?php include 'includes/header.php'; ?>
4+
5+
<title><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></title>
6+
7+
<?php include 'includes/prism_styles.php'; ?>
8+
<link href="lib/bootstrap.min.css" rel="stylesheet">
9+
<link href="style/general.css" rel="stylesheet">
10+
<link href="style/learn.css" rel="stylesheet">
11+
</head>
12+
<body>
13+
<div class="container">
14+
<?php include 'includes/navbar.php'; ?>
15+
<div class="row">
16+
<?php include 'includes/learn_sidebar.php'; ?>
17+
<div class="col-sm-9">
18+
<h1><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></h1>
19+
<?php echo $Parsedown->text(file_get_contents(__DIR__ . "/learn/bot/a_bots_life.md")); ?>
20+
</div>
21+
</div>
22+
<?php include 'includes/footer.php'; ?>
23+
</div>
24+
25+
26+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
27+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
28+
<?php include 'includes/prism_scripts.php'; ?>
29+
<script src="script/backend.js"></script>
30+
<script src="script/general.js"></script>
31+
</body>
32+
</html>

website/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"require": {
33
"lusitanian/oauth": "~0.3",
44
"swiftmailer/swiftmailer": "^5.4.3",
5-
"aws/aws-sdk-php": "^3.19"
5+
"aws/aws-sdk-php": "^3.19",
6+
"erusev/parsedown": "^1.6.1"
67
}
78
}

website/developing_a_bot.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<html lang="en">
2+
<head>
3+
<?php include 'includes/header.php'; ?>
4+
5+
<title><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></title>
6+
7+
<?php include 'includes/prism_styles.php'; ?>
8+
<link href="lib/bootstrap.min.css" rel="stylesheet">
9+
<link href="style/general.css" rel="stylesheet">
10+
<link href="style/learn.css" rel="stylesheet">
11+
</head>
12+
<body>
13+
<div class="container">
14+
<?php include 'includes/navbar.php'; ?>
15+
<div class="row">
16+
<?php include 'includes/learn_sidebar.php'; ?>
17+
<div class="col-sm-9">
18+
<h1><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></h1>
19+
<?php echo $Parsedown->text(file_get_contents(__DIR__ . "/learn/developing/local_development_environment.md")); ?>
20+
<?php echo $Parsedown->text(file_get_contents(__DIR__ . "/learn/developing/submitting_a_bot.md")); ?>
21+
</div>
22+
</div>
23+
<?php include 'includes/footer.php'; ?>
24+
</div>
25+
26+
27+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
28+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
29+
<script src="https://cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.0/seedrandom.min.js"></script>
30+
<?php include 'includes/prism_scripts.php'; ?>
31+
<script src="script/backend.js"></script>
32+
<script src="script/general.js"></script>
33+
<script src="lib/xss.js"></script>
34+
<script src="lib/pixi.min.js"></script>
35+
<script src="script/parsereplay.js"></script>
36+
<script src="script/visualizer.js"></script>
37+
</body>
38+
</html>

website/faqs.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<html lang="en">
2+
<head>
3+
<?php include 'includes/header.php'; ?>
4+
5+
<title><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></title>
6+
7+
<?php include 'includes/prism_styles.php'; ?>
8+
<link href="lib/bootstrap.min.css" rel="stylesheet">
9+
<link href="style/general.css" rel="stylesheet">
10+
<link href="style/learn.css" rel="stylesheet">
11+
</head>
12+
<body>
13+
<div class="container">
14+
<?php include 'includes/navbar.php'; ?>
15+
<div class="row">
16+
<?php include 'includes/learn_sidebar.php'; ?>
17+
<div class="col-sm-9">
18+
<h1>FAQs</h1>
19+
<?php echo $Parsedown->text(file_get_contents(__DIR__ . "/learn/faqs.md")); ?>
20+
</div>
21+
</div>
22+
<?php include 'includes/footer.php'; ?>
23+
</div>
24+
25+
26+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
27+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
28+
<?php include 'includes/prism_scripts.php'; ?>
29+
<script src="script/backend.js"></script>
30+
<script src="script/general.js"></script>
31+
</body>
32+
</html>

website/game_overview.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<html lang="en">
2+
<head>
3+
<?php include 'includes/header.php'; ?>
4+
5+
<title><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></title>
6+
7+
<?php include 'includes/prism_styles.php'; ?>
8+
<link href="lib/bootstrap.min.css" rel="stylesheet">
9+
<link href="style/general.css" rel="stylesheet">
10+
<link href="style/learn.css" rel="stylesheet">
11+
<style>
12+
img {
13+
max-width: 500px;
14+
text-align: center;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<div class="container">
20+
<?php include 'includes/navbar.php'; ?>
21+
<div class="row">
22+
<?php include 'includes/learn_sidebar.php'; ?>
23+
<div class="col-sm-9">
24+
<h1><?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?></h1>
25+
<?php echo $Parsedown->text(file_get_contents(__DIR__ . "/learn/game/what_is_halite.md")); ?>
26+
<?php echo $Parsedown->text(file_get_contents(__DIR__ . "/learn/game/game_rules.md")); ?>
27+
</div>
28+
</div>
29+
<?php include 'includes/footer.php'; ?>
30+
</div>
31+
32+
33+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
34+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
35+
<script src="https://cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.0/seedrandom.min.js"></script>
36+
<?php include 'includes/prism_scripts.php'; ?>
37+
<script src="script/backend.js"></script>
38+
<script src="script/general.js"></script>
39+
<script src="lib/xss.js"></script>
40+
<script src="lib/pixi.min.js"></script>
41+
<script src="script/parsereplay.js"></script>
42+
<script src="script/visualizer.js"></script>
43+
</body>
44+
</html>

website/includes/dropdowns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<li>
2-
<a href="basics_quickstart.php">Learn</a>
2+
<a href="quickstart.php">Learn</a>
33
</li>
44
<li>
55
<a href="downloads.php">Download</a>
@@ -15,4 +15,4 @@
1515
</li>
1616
<li>
1717
<a href="about.php">About</a>
18-
</li>
18+
</li>

website/includes/learn_sidebar.php

Lines changed: 83 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,85 +25,106 @@
2525
}
2626
2727
/* active & hover links */
28-
.bs-docs-sidebar .nav>.active>a,
29-
.bs-docs-sidebar .nav>li>a:hover,
28+
.bs-docs-sidebar .nav>.active>a,
29+
.bs-docs-sidebar .nav>li>a:hover,
3030
.bs-docs-sidebar .nav>li>a:focus {
31-
text-decoration: none;
32-
background-color: transparent;
31+
text-decoration: none;
32+
background-color: transparent;
33+
border-left-color: #63ceca;
3334
}
3435
3536
/* nested active links */
36-
.bs-docs-sidebar .nav .nav>.active>a,
37+
.bs-docs-sidebar .nav .nav>.active>a,
3738
.bs-docs-sidebar .nav .nav>.active:hover>a,
3839
.bs-docs-sidebar .nav .nav>.active:focus>a {
3940
font-weight: 700;
40-
border-left-color: #63ceca;
41+
border-left-color: #63ceca;
4142
font-weight: 500;
4243
}
4344
4445
</style>
4546

4647
<nav class="col-sm-3 bs-docs-sidebar">
4748
<ul id="sidebar" class="nav nav-stacked">
48-
<li class="">
49-
<span>The Basics</span>
49+
<li id="quickstart">
50+
<a href="quickstart.php">Quickstart</a>
5051
<ul class="nav nav-stacked">
51-
<li id="basics_quickstart">
52-
<a href="basics_quickstart.php">Getting Started</a>
52+
<li id="quickstart_dive_in">
53+
<a href="quickstart.php#dive_in">Dive In</a>
5354
</li>
54-
<li id="basics_intro_halite">
55-
<a href="basics_intro_halite.php">Introducing Halite</a>
55+
</ul>
56+
</li>
57+
<li id="game_overview">
58+
<a href="game_overview.php">Game Overview</a>
59+
<ul class="nav nav-stacked">
60+
<li id="game_overview_what_is_halite">
61+
<a href="game_overview.php#what_is_halite">What is Halite?</a>
5662
</li>
57-
<li id="basics_improve_random">
58-
<a href="basics_improve_random.php">Improving the Random Bot</a>
63+
<li id="game_overview_game_rules">
64+
<a href="game_overview.php#game_rules">Game Rules</a>
5965
</li>
60-
<li id="basics_faqs">
61-
<a href="basics_faqs.php">FAQs</a>
66+
</ul>
67+
</li>
68+
<li id="bot_overview">
69+
<a href="bot_overview.php">Bot Overview</a>
70+
<ul class="nav nav-stacked">
71+
<li id="bot_overview_a_bots_life">
72+
<a href="bot_overview.php#a_bots_life">A Bot's Life</a>
6273
</li>
6374
</ul>
6475
</li>
65-
<li class="">
66-
<span>Guides</span>
76+
<li id="developing_a_bot">
77+
<a href="developing_a_bot.php">Developing A Bot</a>
6778
<ul class="nav nav-stacked">
68-
<li id="guides_development">
69-
<a href="guides_development.php">Bot Development</a>
79+
<li id="developing_a_bot_local_development_environment">
80+
<a href="developing_a_bot.php#local_development_environment">Local Development Environment</a>
7081
</li>
71-
<li id="guides_libraries">
72-
<a href="guides_libraries.php">Using 3rd Party Libraries</a>
82+
<li id="developing_a_bot_submitting_a_bot">
83+
<a href="developing_a_bot.php#submitting_a_bot">Submitting A Bot</a>
7384
</li>
74-
<li id="guides_strategy">
75-
<a href="guides_strategy.php">Strategy Considerations</a>
85+
</ul>
86+
</li>
87+
<li id="tournament_overview">
88+
<a href="tournament_overview.php">Tournament Overview</a>
89+
<ul class="nav nav-stacked">
90+
<li id="tournament_overview_about_the_tournament">
91+
<a href="tournament_overview.php#about_the_tournament">About the Tournament</a>
7692
</li>
7793
</ul>
7894
</li>
79-
<li class="">
80-
<span>Rules</span>
95+
<li id="server_overview">
96+
<a href="server_overview.php">Server Overview</a>
8197
<ul class="nav nav-stacked">
82-
<li id="rules_game">
83-
<a href="rules_game.php">Game Rules</a>
98+
<li id="server_overview_hardware">
99+
<a href="server_overview.php#hardware">Hardware</a>
84100
</li>
85-
<li id="rules_contest">
86-
<a href="rules_contest.php">Contest Rules</a>
101+
<li id="server_overview_software">
102+
<a href="server_overview.php#software">Software</a>
87103
</li>
88104
</ul>
89105
</li>
90-
<li class="">
91-
<span>Advanced</span>
106+
<li id="tutorials">
107+
<a href="tutorials.php">Tutorials</a>
92108
<ul class="nav nav-stacked">
93-
<li id="advanced_command_line">
94-
<a href="advanced_command_line.php">Environment Command Reference</a>
109+
<li id="tutorials_improving_the_random_bot">
110+
<a href="tutorials.php#improving_the_random_bot">Improving The Random Bot</a>
95111
</li>
112+
</ul>
113+
</li>
114+
<li id="reference">
115+
<span>Reference</span>
116+
<ul class="nav nav-stacked">
96117
<li id="advanced_replay_file">
97-
<a href="advanced_replay_file.php">Replay File Reference</a>
98-
</li>
99-
<li id="advanced_game_server">
100-
<a href="advanced_game_server.php">Game Server Reference</a>
118+
<a href="advanced_replay_file.php">Replay File Format</a>
101119
</li>
102120
<li id="advanced_writing_sp">
103121
<a href="advanced_writing_sp.php">Writing Your Own Starter Package</a>
104122
</li>
105123
</ul>
106124
</li>
125+
<li id="faqs">
126+
<a href="faqs.php">FAQs</a>
127+
</li>
107128
</ul>
108129
<hr>
109130
<p style="line-height: 1.5em; font-size: 13px;">You can <a id="githubLink" href="">edit this content on GitHub</a> and send us a pull request!</p>
@@ -113,6 +134,28 @@
113134
var fileName = location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
114135
document.getElementById("githubLink").href = "https://github.com/HaliteChallenge/Halite/blob/master/website/"+fileName;
115136
116-
var name = fileName.split(".")[0];
117-
document.getElementById(name).className = "active";
137+
function markNavActive(event) {
138+
var name = fileName.split(".")[0];
139+
140+
if (event) {
141+
var l = document.createElement("a");
142+
l.href = event.oldURL;
143+
if (l.hash) {
144+
document.getElementById(name + "_" + l.hash.substr(1)).removeAttribute("class")
145+
} else {
146+
document.getElementById(name).removeAttribute("class")
147+
}
148+
}
149+
150+
if (location.hash) {
151+
document.getElementById(name).removeAttribute("class")
152+
document.getElementById(name + "_" + location.hash.substr(1)).className = "active"
153+
} else {
154+
document.getElementById(name).className = "active"
155+
}
156+
}
157+
158+
markNavActive();
159+
160+
window.addEventListener("hashchange", markNavActive, false);
118161
</script>

website/includes/prism_scripts.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/prism.min.js"></script>
2+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/plugins/autolinker/prism-autolinker.min.js"></script>
3+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/plugins/show-language/prism-show-language.min.js"></script>
4+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/plugins/highlight-keywords/prism-highlight-keywords.min.js"></script>
5+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/plugins/autoloader/prism-autoloader.min.js"></script>
6+
<script>Prism.plugins.autoloader.languages_path = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/components/'</script>

website/includes/prism_styles.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
require __DIR__ . '/../vendor/autoload.php';
3+
$Parsedown = new Parsedown();
4+
?>
5+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism.min.css" />
6+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/plugins/autolinker/prism-autolinker.min.css" />
7+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/plugins/show-language/prism-show-language.min.css" />

website/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
22
apt-get update
33

4-
apt-get install -y php5.6 php5.6-mysql apache2
4+
apt-get install -y php5.6 php5.6-mbstring php5.6-mysql apache2
55
a2enmod rewrite expires
66

7-
apt-get install -y python3 python3-pip
7+
apt-get install -y python3 python3-pip
88

99
pip3 install trueskill boto paramiko pymysql
1010

11-
apt-get install -y zip
11+
apt-get install -y zip
1212

1313
curl -sS https://getcomposer.org/installer | php
1414
mv composer.phar /usr/local/bin/composer

0 commit comments

Comments
 (0)