|
|
@ -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) |
|
|
|