ht and audio_full

This commit is contained in:
gauthiier 2019-07-12 16:44:56 +02:00
parent 68dea8b842
commit 68de0eb54e
3 changed files with 30 additions and 2 deletions

View File

@ -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%;
}

1
.htaccess Normal file
View File

@ -0,0 +1 @@
RedirectMatch 404 /\.git

17
gen.py
View File

@ -55,13 +55,17 @@ 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())
out = "<sound>\n"
if full:
out = '<sound class="full">\n'
else:
out = "<sound>\n"
for a in audio:
out += "<track>\n"
out += "<info>\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();