ht and audio_full
This commit is contained in:
parent
68dea8b842
commit
68de0eb54e
@ -102,12 +102,26 @@ table td img {
|
||||
padding: 10;
|
||||
}
|
||||
|
||||
.lst ul li sound.full {
|
||||
display: inline-block;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 2em;
|
||||
width: 985;
|
||||
}
|
||||
|
||||
.lst ul li sound track {
|
||||
display: block;
|
||||
margin-top: 0.3em;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
.lst ul li sound.full track {
|
||||
display: block;
|
||||
margin-top: 0.6em;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
|
||||
.lst ul li sound info {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
15
gen.py
15
gen.py
@ -55,12 +55,16 @@ def emit_img(file, data_dir):
|
||||
def emit_video_mp4(file, data_dir):
|
||||
return '<video controls><source src="' + file + '" type="video/mp4"</video>'
|
||||
|
||||
def emit_audio(file, data_dir):
|
||||
def emit_audio(file, data_dir, full=False):
|
||||
# an '.audio' file is a json file with a list of audio elements
|
||||
# which need to be bundles as a type of list in a single <li>
|
||||
|
||||
filename = os.path.join(data_dir, file);
|
||||
with open(filename) as f:
|
||||
audio = json.loads(f.read())
|
||||
if full:
|
||||
out = '<sound class="full">\n'
|
||||
else:
|
||||
out = "<sound>\n"
|
||||
for a in audio:
|
||||
out += "<track>\n"
|
||||
@ -85,6 +89,9 @@ def emit_audio(file, data_dir):
|
||||
|
||||
return "to do to do to do"
|
||||
|
||||
def emit_audio_full(file, data_dir):
|
||||
return emit_audio(file, data_dir, full=True)
|
||||
|
||||
def default(file, data_dir):
|
||||
return None;
|
||||
|
||||
@ -95,6 +102,7 @@ content_map = {
|
||||
'.mov': emit_video_mp4,
|
||||
'.mp4': emit_video_mp4,
|
||||
'.audio': emit_audio,
|
||||
'.audio_full': emit_audio_full,
|
||||
'.html': default,
|
||||
'.txt': default
|
||||
};
|
||||
@ -281,6 +289,11 @@ if __name__ == '__main__':
|
||||
if os.path.isfile(indx_txt):
|
||||
shutil.copy(robots_in, output_dir)
|
||||
|
||||
# .htaccess?
|
||||
ht_in = os.path.join('.', '.htaccess')
|
||||
if os.path.isfile(indx_txt):
|
||||
shutil.copy(ht_in, output_dir)
|
||||
|
||||
template.close();
|
||||
content_indx_template.close();
|
||||
out.close();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user