added --no-underscore to support better _style.css & _main.js
This commit is contained in:
parent
1317784a43
commit
d8f6451123
6 changed files with 24 additions and 4 deletions
|
|
@ -79,6 +79,11 @@ def build_argparser():
|
||||||
help="Exclude hidden directories",
|
help="Exclude hidden directories",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--no-underscore',
|
||||||
|
help="Exclude files/dirs starts with underscore(_)",
|
||||||
|
action="store_true")
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--menu-with-index',
|
'--menu-with-index',
|
||||||
help="Append index.html to menu items to aid navigation",
|
help="Append index.html to menu items to aid navigation",
|
||||||
|
|
|
||||||
|
|
@ -113,12 +113,17 @@ def write_index(args,index, html, html_head, html_footer):
|
||||||
def render_dir(args, root):
|
def render_dir(args, root):
|
||||||
html = []
|
html = []
|
||||||
|
|
||||||
for name in sorted(os.listdir(root)):
|
#for name in sorted(os.listdir(root)):
|
||||||
|
for name in sorted(os.listdir(root),reverse=True):
|
||||||
|
|
||||||
if args.no_hidden:
|
if args.no_hidden:
|
||||||
if name.startswith('.'):
|
if name.startswith('.'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if args.no_underscore:
|
||||||
|
if name.startswith('_'):
|
||||||
|
continue
|
||||||
|
|
||||||
lv = root.split("/")
|
lv = root.split("/")
|
||||||
relative = lv[len(lv) - 1]
|
relative = lv[len(lv) - 1]
|
||||||
relative_path = "./{}/{}".format(relative, name)
|
relative_path = "./{}/{}".format(relative, name)
|
||||||
|
|
@ -218,6 +223,10 @@ def distribusify(args, directory): # noqa
|
||||||
dirs = list(filter(lambda d: not d.startswith('.'), dirs))
|
dirs = list(filter(lambda d: not d.startswith('.'), dirs))
|
||||||
files = list(filter(lambda f: not f.startswith('.'), files))
|
files = list(filter(lambda f: not f.startswith('.'), files))
|
||||||
|
|
||||||
|
if args.no_underscore:
|
||||||
|
dirs = list(filter(lambda d: not d.startswith('_'), dirs))
|
||||||
|
files = list(filter(lambda f: not f.startswith('_'), files))
|
||||||
|
|
||||||
dirs.sort()
|
dirs.sort()
|
||||||
files.sort()
|
files.sort()
|
||||||
|
|
||||||
|
|
@ -227,7 +236,8 @@ def distribusify(args, directory): # noqa
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
print('Generating directory listing for', root)
|
print('Generating directory listing for', root)
|
||||||
|
|
||||||
for name in sorted(files):
|
#for name in sorted(files):
|
||||||
|
for name in sorted(files,reverse=True):
|
||||||
|
|
||||||
if 'index.html' not in name:
|
if 'index.html' not in name:
|
||||||
full_path = os.path.join(root, name)
|
full_path = os.path.join(root, name)
|
||||||
|
|
@ -296,7 +306,9 @@ def distribusify(args, directory): # noqa
|
||||||
else:
|
else:
|
||||||
html.append('<a href="../">../</a>')
|
html.append('<a href="../">../</a>')
|
||||||
|
|
||||||
for name in dirs:
|
#for name in dirs:
|
||||||
|
for name in sorted(dirs,reverse=True):
|
||||||
|
|
||||||
#check - time string
|
#check - time string
|
||||||
m = PATTERN_TSTR.search(name)
|
m = PATTERN_TSTR.search(name)
|
||||||
tstring = ""
|
tstring = ""
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ html_head = """
|
||||||
<style>
|
<style>
|
||||||
%s
|
%s
|
||||||
</style>
|
</style>
|
||||||
|
<link rel="stylesheet" href="_style.css">
|
||||||
|
<script src="_main.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="header"></div>
|
<div id="header"></div>
|
||||||
|
|
|
||||||
0
inst_deps.sh
Normal file → Executable file
0
inst_deps.sh
Normal file → Executable file
2
run.sh
2
run.sh
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
python run.py -d ./data/ -nf -s styles/dark.css --no-hidden --unfolding
|
python run.py -d ./data/ -nf -s styles/white.css --no-hidden --no-underscore --unfolding
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ body::-webkit-scrollbar {
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
padding-bottom: 3em;
|
padding-bottom: 3em;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unfolded {
|
.unfolded {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue