Commit 0ce934ec authored by nachtgold's avatar nachtgold
Browse files

merged other changes and reduced the color blue in the docs

parents b2004684 a944821f
......@@ -30,7 +30,6 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'widget_tweaks',
'core',
'visualization',
'ide',
......
......@@ -17,6 +17,35 @@
border: none;
}
.markdown-body code,
.markdown-body tt {
color: white;
background-color: #333;
}
.markdown-body dl dt {
font-size: 1.2em;
}
table thead tr td {
background: rgb(0,0,0,.50);
font-weight: 700;
}
.markdown-body table tr {
background-color: #1a1a1a;
}
.markdown-body table tr:nth-child(2n) {
background-color: #242424;
}
th,
.markdown-body table td {
border-color: #303030;
}
.markdown-body a {
color: white;
text-decoration: underline;
}
......@@ -63,12 +63,24 @@ return [==[
# for kind,items in module.kinds() do
<h2><a href="#$(no_spaces(kind))">$(kind)</a></h2>
<table class="function_list">
<thead>
<tr>
<td>
Function name
</td>
<td>
Description
</td>
</tr>
</thead>
<tbody>
# for item in items() do
<tr>
<td class="name" $(nowrap)><a href="#$(item.name)">$(display_name(item))</a></td>
<td class="summary">$(M(item.summary,item))</td>
</tr>
# end -- for items
</tbody>
</table>
#end -- for kinds
......
......@@ -2,6 +2,7 @@
--- Every bot is allowed to store 100MB within the global namespace and the
--- data persists until the bot dies. So the bot can save data from frame
--- to frame.
--- <h2>Lua global namespace</h2>
--- <p>The following Lua standard functions are allowed:</p>
--- <p><a href="http://pgl.yoyo.org/luai/i/assert">assert</a>,
--- <a href="http://pgl.yoyo.org/luai/i/print">print</a>,
......@@ -59,7 +60,11 @@
--- <a href="http://pgl.yoyo.org/luai/i/table.sort">sort</a></p>
--- <h2>Globals</h2>
--- <p>Every snake can describe itself with the following attributes of the global variable <code>self</code>:</p>
--- <table><tbody>
--- <table>
--- <thead>
--- <tr><td>Variable within self</td><td>Type</td><td>Description</td></tr>
--- </thead>
--- <tbody>
--- <tr><td>id</td><td>number</td><td>internal identifier</td></tr>
--- <tr><td>segment_radius</td><td>number</td><td>the size of the snake</td></tr>
--- <tr><td>mass</td><td>number</td><td>the weight of the snake</td></tr>
......@@ -121,9 +126,13 @@ end
-- A negative angle means turn left and a positive angle
-- means turn right. With 0, the snake keeps its direction.
-- @return new angle relative to the head direction
--@return if true the snake will use boost, otherwise false or empty (optional)
-- @usage function step()
-- return 0.005
-- end
-- @usage function step()
-- return 0.005, true
-- end
function step()
return 0.005
end
......@@ -29,6 +29,7 @@
Every bot is allowed to store 100MB within the global namespace and the
data persists until the bot dies. So the bot can save data from frame
to frame.
<h2>Lua global namespace</h2>
<p>The following Lua standard functions are allowed:</p>
<p><a href="http://pgl.yoyo.org/luai/i/assert">assert</a>,
<a href="http://pgl.yoyo.org/luai/i/print">print</a>,
......@@ -84,9 +85,12 @@
<a href="http://pgl.yoyo.org/luai/i/table.insert">insert</a>,
<a href="http://pgl.yoyo.org/luai/i/table.remove">remove</a>,
<a href="http://pgl.yoyo.org/luai/i/table.sort">sort</a></p>
<h2>Globals</h2>
<p>Every snake can describe itself with the following attributes of the global variable <code>self</code>:</p>
<table><tbody>
<table>
<thead>
<tr><td>Variable within self</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody>
<tr><td>id</td><td>number</td><td>internal identifier</td></tr>
<tr><td>segment_radius</td><td>number</td><td>the size of the snake</td></tr>
<tr><td>mass</td><td>number</td><td>the weight of the snake</td></tr>
......@@ -107,6 +111,17 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<thead>
<tr>
<td>
Function name
</td>
<td>
Description
</td>
</tr>
</thead>
<tbody>
<tr>
<td class="name" nowrap><a href="#init">init ()</a></td>
<td class="summary">This function is called upon creation of a bot
......@@ -128,6 +143,7 @@
<td class="name" nowrap><a href="#step">step ()</a></td>
<td class="summary">That function is called each frame.</td>
</tr>
</tbody>
</table>
......@@ -255,17 +271,22 @@
<h4>Returns:</h4>
<ol>
new angle relative to the head direction
<li>
new angle relative to the head direction</li>
<li>
if true the snake will use boost, otherwise false or empty (optional)</li>
</ol>
<h4>Usage:</h4>
<ul>
<pre class="usage"><code class="lua"> <span class="keyword">function</span> step()
<li><pre class="usage"><code class="lua"> <span class="keyword">function</span> step()
<span class="keyword">return</span> <span class="number">0.005</span>
<span class="keyword">end</span></code></pre>
<span class="keyword">end</span></code></pre></li>
<li><pre class="usage"><code class="lua"> <span class="keyword">function</span> step()
<span class="keyword">return</span> <span class="number">0.005</span>, <span class="keyword">true</span>
<span class="keyword">end</span></code></pre></li>
</ul>
</dd>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment