Gitlab will be down on Friday 25th May (from 9:00 am to 12:00 )

Commit f8217e39 by murtaugh

simple targets display

parent d119ac1c
mdsrc=$(shell ls *.md)
# map *.mp => *.html for mdsrc
html_from_md=$(mdsrc:%.md=%.html)
......@@ -7,6 +8,10 @@ html: $(html_from_md)
test:
echo hello world
now:
touch `date +"%Y-%m-%d-%H%M%S"`.md
%.html: %.md
pandoc --from markdown \
--to html \
......
......@@ -6,6 +6,11 @@
<script src="/__makeserver__/draggable/draggable.js"></script>
<link rel="stylesheet" type="text/css" href="/__makeserver__/draggable/draggable.css">
<script src="/__makeserver__/index.js"></script>
<style>
form.target {
display: inline;
}
</style>
</head>
<body>
<h1>Index of {{ request_label }}</h1>
......@@ -23,8 +28,12 @@
{% endif %}
{% endfor %}
</table>
<div style="margin-top: 1em">
<button id="touch">touch</button>
<div id="buttons" style="margin-top: 1em">
<button id="touch">touch</button>
<span id="targetbuttons">
{% for t in targets %}
<form class="target" action="{{t}}"><input type="submit" value="{{t }}"></form>{% endfor %}
</span>
</div>
<script>
function getjson (url, callback) {
......
......@@ -85,6 +85,11 @@ def is_text_file (p):
except IOError:
return None
def targets (makefile):
with open(makefile) as f:
text = f.read().decode("utf-8")
return re.findall(r"^(\w+):", text, flags=re.M)
def make_n (path, makefile=None):
output = ""
if makefile:
......@@ -199,6 +204,10 @@ class MakeDirectoryListing (object):
})
tvars['items'] = items
tvars['targets'] = targets(self.makefile)
return self.template.render(tvars).encode("utf-8")
class MakeDirectoryListingFactory (object):
......
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