Removed Python script used earlier with Bash
This commit is contained in:
parent
b4cc751b6d
commit
4c54e1e62f
1 changed files with 0 additions and 26 deletions
26
html_conv.py
26
html_conv.py
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
SCRIPTS = r'((<script src="js/\w+\.js"></script>[\s\r\n]+)+)'
|
||||
MINJS = '<script src="{}"></script>'
|
||||
|
||||
LESSJS = '<script src="https://cdn.jsdelivr.net/npm/less"></script>'
|
||||
STYLES = '<link rel="stylesheet/less" type="text/css" href="styles.less" />'
|
||||
CSS = '<link rel="stylesheet" href="{}" />'
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
stdin = sys.stdin.read()
|
||||
|
||||
conv = re.sub(SCRIPTS, MINJS.format(sys.argv[1]), stdin)
|
||||
conv = conv.replace(LESSJS, '')
|
||||
conv = conv.replace(STYLES, CSS.format(sys.argv[2]))
|
||||
|
||||
sys.stdout.write(conv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Reference in a new issue