diff --git a/distribusi/distribusi.py b/distribusi/distribusi.py index 3749fac..8b67730 100644 --- a/distribusi/distribusi.py +++ b/distribusi/distribusi.py @@ -12,6 +12,7 @@ import re MIME_TYPE = magic.Magic(mime=True) PATTERN_TSTR = re.compile(r"(?P(?P\d{4})(?P\d{2})(?P\d{2})T(?P\d{2})(?P\d{2})(?P\d{2})(?P[+|-]\d{4}))_(?P.+)") +PATTERN_TSTR_TXT = re.compile(r"(?P(?P\d{4})(?P\d{2})(?P\d{2})T(?P\d{2})(?P\d{2})(?P\d{2})(?P[+|-]\d{4}))_(?P.*)\.txt") def caption(image): @@ -156,13 +157,17 @@ def render_dir(args, root): #elif subtype in CODE_TYPES or name.endswith('.txt'): elif name.endswith('.txt'): #check - time string - m = PATTERN_TSTR.search(name) + m = PATTERN_TSTR_TXT.search(name) tstring = "" rename = name if m: tstring = m.group('tstring') rename = m.group('name') - a = "
" + open(full_path).read() + "
" + if rename == "": + a = "
" + else: + a = "
{}
".replace('{}', rename) + a = a + open(full_path).read() + "
" a = a.replace('{}', tstring) else: subtype = subtype + ' unkown-file' @@ -271,15 +276,18 @@ def distribusify(args, directory): # noqa #elif subtype in CODE_TYPES or name.endswith('.txt'): elif name.endswith('.txt'): #check - time string - m = PATTERN_TSTR.search(name) + m = PATTERN_TSTR_TXT.search(name) tstring = "" rename = name if m: tstring = m.group('tstring') rename = m.group('name') - a = "
" + open(full_path).read() + "
" + if rename == "": + a = "
" + else: + a = "
{}
".replace('{}', rename) + a = a + open(full_path).read() + "
" a = a.replace('{}', tstring) - #a = "
" + open(full_path).read() + "
" else: subtype = subtype+' unkown-file' a = "{}" diff --git a/styles/yoshi.css b/styles/yoshi.css index 185f8f1..9c340d0 100644 --- a/styles/yoshi.css +++ b/styles/yoshi.css @@ -161,6 +161,14 @@ a:hover { padding-left: 0; } +.unfolded .plain .named { + display: block; + font-weight: 700; + border: unset; + /* color: rgba(180, 64, 134, 0.5); */ + color: rgba(37, 176, 118, 0.25); +} + time { color: rgba(37, 176, 118, .2); }