Fix broken links

This commit is contained in:
Matthias Richter 2013-08-23 17:34:08 +02:00
parent bfba6cda51
commit e5c9bfbac7
3 changed files with 24 additions and 20 deletions

View File

@ -342,7 +342,7 @@ executed *after* the whole file is loaded.
## Module hump.timer [Delayed and time-limited function calls.]
## Module hump.timer [Delayed and time-limited function calls, and tweening support.]
Timer = require "hump.timer"
@ -610,7 +610,7 @@ games](http://www.youtube.com/watch?v=Fy0aCDmgnxg).
[`timer.tween()`](#hump.timertween).
To see which tweening methods hump offers, [see
below](#hump.timerTweening%20methods).
below](#hump.timerTweening_methods).
#### Parameters:
@ -621,7 +621,7 @@ below](#hump.timerTweening%20methods).
=table target=
Target values.
=string method (optional)=
Tweening method, defaults to 'linear' ([see here](#hump.timerTweening%20methods)).
Tweening method, defaults to 'linear' ([see here](#hump.timerTweening_methods)).
=function after (optiona)=
Function to execute after the tween has finished.
=mixed ...=

View File

@ -9,6 +9,10 @@ local function filter(t, p)
return r
end
local function anchorname(s)
return s:gsub('%s$', ''):gsub('%s','_')
end
-- generic
function actions.textblock(info)
return discount(info[1])
@ -18,14 +22,14 @@ function actions.section(info)
local htype = 'h'..(info[3]+1)
if info[3] >= 3 then
return table.concat{
'<div class="section-block" id="{{MODULE}}', info[1], '">',
'<div class="section-block" id="{{MODULE}}', anchorname(info[1]), '">',
'<',htype,'>', info[1], '<a class="top" href="#{{MODULE}}">^top</a></',htype,'>',
discount(info[4]),
'</div>'
}
end
return table.concat{
'<div class="outer-block" id="{{MODULE}}', info[1], '">',
'<div class="outer-block" id="{{MODULE}}', anchorname(info[1]), '">',
'<',htype,'>', info[1], '<a class="top" href="#top">^top</a></',htype,'>',
'<div class="preamble">', discount(info[4]), '</div>',
'</div>'
@ -59,7 +63,7 @@ end
actions['function'] = function(info)
local arg_delim = info.has_table_args and {'{','}'} or {'(',')'}
local out = {
'<div class="ref-block" id="{{MODULE}}', info[1], '">',
'<div class="ref-block" id="{{MODULE}}', anchorname(info[1]), '">',
'<h4>',
'function <span class="name">', info[1], '</span>',
'<span class="arglist">', arg_delim[1], info[2], arg_delim[2], '</span>',
@ -122,7 +126,7 @@ end
function actions.module(info)
local modname = info[1]
local out = {
'<div class="outer-block" id="', modname, '">',
'<div class="outer-block" id="', anchorname(modname), '">',
'<h3>', modname, '<a class="top" href="#top">^top</a></h3>',
'<div class="preamble">', discount(info[3]), '</div>'
}
@ -135,7 +139,7 @@ function actions.module(info)
if info.type == 'function' then
out[#out+1] = table.concat{
'<dt>',
'<a href="#', modname, info[1], '">',
'<a href="#', anchorname(modname), anchorname(info[1]), '">',
info[1], '()',
'</a>',
'</dt><dd>',
@ -145,7 +149,7 @@ function actions.module(info)
elseif info.type == 'section' then
out[#out+1] = table.concat{
'<dt>',
'<a href="#', modname, info[1], '">',
'<a href="#', anchorname(modname), anchorname(info[1]), '">',
info[1],
'</a>',
'</dt><dd>',
@ -182,7 +186,7 @@ function actions.preprocess(doctree)
out[#out+1] = '<dl>'
for _, info in ipairs(filter(doctree, function(v) return v.type == 'module' end)) do
out[#out+1] = table.concat{
'<dt><a href="#', info[1], '">', info[1], '</a></dt>',
'<dt><a href="#', anchorname(info[1]), '">', info[1], '</a></dt>',
'<dd>', info[2], '</dd>',
}
end

View File

@ -36,7 +36,7 @@ for the awesome LÖVE Engine.</p>
<p>hump differs from other libraries in that every component is independent of the
remaining ones. hump's footprint is very small and thus should fit nicely into
your projects.</p>
</div></div><div class="outer-block" id="Modules"><h3>Modules<a class="top" href="#top">^top</a></h3><div class="preamble"><dl><dt><a href="#hump.gamestate">hump.gamestate</a></dt><dd>A gamestate system.</dd><dt><a href="#hump.timer">hump.timer</a></dt><dd>Delayed and time-limited function calls.</dd><dt><a href="#hump.vector">hump.vector</a></dt><dd>2D vector math.</dd><dt><a href="#hump.vector-light">hump.vector-light</a></dt><dd>Lightweight 2D vector math.</dd><dt><a href="#hump.class">hump.class</a></dt><dd>Object oriented programming for Lua.</dd><dt><a href="#hump.signal">hump.signal</a></dt><dd>Simple Signal/Slot (aka. Observer) implementation.</dd><dt><a href="#hump.camera">hump.camera</a></dt><dd>A camera for LÖVE.</dd></dl>
</div></div><div class="outer-block" id="Modules"><h3>Modules<a class="top" href="#top">^top</a></h3><div class="preamble"><dl><dt><a href="#hump.gamestate">hump.gamestate</a></dt><dd>A gamestate system.</dd><dt><a href="#hump.timer">hump.timer</a></dt><dd>Delayed and time-limited function calls, and tweening support.</dd><dt><a href="#hump.vector">hump.vector</a></dt><dd>2D vector math.</dd><dt><a href="#hump.vector-light">hump.vector-light</a></dt><dd>Lightweight 2D vector math.</dd><dt><a href="#hump.class">hump.class</a></dt><dd>Object oriented programming for Lua.</dd><dt><a href="#hump.signal">hump.signal</a></dt><dd>Simple Signal/Slot (aka. Observer) implementation.</dd><dt><a href="#hump.camera">hump.camera</a></dt><dd>A camera for LÖVE.</dd></dl>
</div></div><div class="outer-block" id="hump.gamestate"><h3>hump.gamestate<a class="top" href="#top">^top</a></h3><div class="preamble"><pre><code class="lua">Gamestate = require "hump.gamestate"
</code></pre>
@ -307,7 +307,7 @@ function love.update(dt)
Timer.update(dt)
end
</code></pre>
</div><div class="overview"><h4>Module overview</h4><dl><dt><a href="#hump.timernew">new()</a></dt><dd>Create new timer instance.</dd><dt><a href="#hump.timeradd">add()</a></dt><dd>Schedule a function.</dd><dt><a href="#hump.timeraddPeriodic">addPeriodic()</a></dt><dd>Add a periodic function.</dd><dt><a href="#hump.timerdo_for">do_for()</a></dt><dd>Run a function for the next few seconds.</dd><dt><a href="#hump.timercancel">cancel()</a></dt><dd>Cancel a scheduled function.</dd><dt><a href="#hump.timerclear">clear()</a></dt><dd>Remove all timed and periodic functions.</dd><dt><a href="#hump.timerupdate">update()</a></dt><dd>Update scheduled functions.</dd><dt><a href="#hump.timertween">tween()</a></dt><dd>Add a tween.</dd><dt><a href="#hump.timerTweening methods ">Tweening methods </a></dt><dd>Predefined tweening methods.</dd><dt><a href="#hump.timerCustom interpolators ">Custom interpolators </a></dt><dd>Advanced: Adding custom tweening methods.</dd></dl></div><div class="ref-block" id="hump.timernew"><h4>function <span class="name">new</span><span class="arglist">()</span><a class="top" href="#hump.timer">^top</a></h4><p><strong>If you don't need multiple independent schedulers, you can use the
</div><div class="overview"><h4>Module overview</h4><dl><dt><a href="#hump.timernew">new()</a></dt><dd>Create new timer instance.</dd><dt><a href="#hump.timeradd">add()</a></dt><dd>Schedule a function.</dd><dt><a href="#hump.timeraddPeriodic">addPeriodic()</a></dt><dd>Add a periodic function.</dd><dt><a href="#hump.timerdo_for">do_for()</a></dt><dd>Run a function for the next few seconds.</dd><dt><a href="#hump.timercancel">cancel()</a></dt><dd>Cancel a scheduled function.</dd><dt><a href="#hump.timerclear">clear()</a></dt><dd>Remove all timed and periodic functions.</dd><dt><a href="#hump.timerupdate">update()</a></dt><dd>Update scheduled functions.</dd><dt><a href="#hump.timertween">tween()</a></dt><dd>Add a tween.</dd><dt><a href="#hump.timerTweening_methods">Tweening methods </a></dt><dd>Predefined tweening methods.</dd><dt><a href="#hump.timerCustom_interpolators">Custom interpolators </a></dt><dd>Advanced: Adding custom tweening methods.</dd></dl></div><div class="ref-block" id="hump.timernew"><h4>function <span class="name">new</span><span class="arglist">()</span><a class="top" href="#hump.timer">^top</a></h4><p><strong>If you don't need multiple independent schedulers, you can use the
global/default timer (see examples).</strong></p>
<p>Creates a new timer instance that is independent of the global timer: It will
@ -463,14 +463,14 @@ games</a>.</p>
<a href="#hump.timerdofor"><code class="lua">timer.to_for()</code></a> and the higher level interface
<a href="#hump.timertween"><code class="lua">timer.tween()</code></a>.</p>
<p>To see which tweening methods hump offers, <a href="#hump.timerTweening%2520methods">see
<p>To see which tweening methods hump offers, <a href="#hump.timerTweening_methods">see
below</a>.</p>
<div class="arguments">Parameters:<dl>
<dt>number <code class="lua">duration</code></dt>
<dd>Duration of the tween.</dd><dt>table <code class="lua">subject</code></dt>
<dd>Object to be tweened.</dd><dt>table <code class="lua">target</code></dt>
<dd>Target values.</dd><dt>string <code class="lua">method</code> (optional)</dt>
<dd>Tweening method, defaults to 'linear' (<a href="#hump.timerTweening%2520methods">see here</a>).</dd><dt>function <code class="lua">after</code> (optiona)</dt>
<dd>Tweening method, defaults to 'linear' (<a href="#hump.timerTweening_methods">see here</a>).</dd><dt>function <code class="lua">after</code> (optiona)</dt>
<dd>Function to execute after the tween has finished.</dd><dt>mixed <code class="lua">...</code></dt>
<dd>Additional arguments to the <em>tweening</em> function.</dd></dl>
</div><div class="returns">Returns:<dl>
@ -536,7 +536,7 @@ function love.draw()
love.graphics.circle('fill', circle.x, circle.y, circle.rad)
end
</code></pre>
</div></div><div class="section-block" id="hump.timerTweening methods "><h4>Tweening methods <a class="top" href="#hump.timer">^top</a></h4><p>At the core of tweening lie interpolation methods. These methods define how the
</div></div><div class="section-block" id="hump.timerTweening_methods"><h4>Tweening methods <a class="top" href="#hump.timer">^top</a></h4><p>At the core of tweening lie interpolation methods. These methods define how the
output should look depending on how much time has passed. For example, consider
the following tween:</p>
@ -629,7 +629,7 @@ function love.draw()
end
end
</code></pre>
</div><div class="section-block" id="hump.timerCustom interpolators "><h4>Custom interpolators <a class="top" href="#hump.timer">^top</a></h4><p><strong>This is a stub</strong></p>
</div><div class="section-block" id="hump.timerCustom_interpolators"><h4>Custom interpolators <a class="top" href="#hump.timer">^top</a></h4><p><strong>This is a stub</strong></p>
<p>You can add custom interpolation methods by adding them to the <code class="lua">tween</code> table:</p>