html5tidy as proper tool
This commit is contained in:
parent
55fbdea410
commit
ad6e190048
@ -6,15 +6,17 @@ usage = """Usage:
|
||||
etherdump CMD
|
||||
|
||||
where CMD could be:
|
||||
sync
|
||||
pull
|
||||
index
|
||||
dumpcsv
|
||||
gettext
|
||||
gethtml
|
||||
creatediffhtml
|
||||
dumpcsv
|
||||
list
|
||||
listauthors
|
||||
revisionscount
|
||||
showmeta
|
||||
html5tidy
|
||||
|
||||
For more information on each command try:
|
||||
etherdump CMD --help
|
||||
|
@ -83,8 +83,7 @@ def html5tidy (doc, charset="utf-8", title=None, scripts=None, links=None, inden
|
||||
etree_indent(doc)
|
||||
return doc
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main (args):
|
||||
p = ArgumentParser("")
|
||||
p.add_argument("input", nargs="?", default=None)
|
||||
p.add_argument("--indent", default=False, action="store_true")
|
||||
@ -103,7 +102,7 @@ if __name__ == "__main__":
|
||||
p.add_argument("--rss", action="append", default=[], nargs="+", help="ensure/add alternate link of type application/rss+xml")
|
||||
p.add_argument("--atom", action="append", default=[], nargs="+", help="ensure/add alternate link of type application/atom+xml")
|
||||
|
||||
args = p.parse_args()
|
||||
args = p.parse_args(args)
|
||||
links = []
|
||||
def add_links (links, items, rel, _type=None):
|
||||
for href in items:
|
||||
@ -164,3 +163,7 @@ if __name__ == "__main__":
|
||||
if tmppath:
|
||||
os.rename(args.input, args.input+"~")
|
||||
os.rename(tmppath, args.input)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
||||
|
Loading…
Reference in New Issue
Block a user