https://github.com/tensorly/tensorly
Revision db1eb97a113d2dfe213e4053969f0aeef2884a9e authored by Aaron Meyer on 25 September 2022, 18:01:17 UTC, committed by GitHub on 25 September 2022, 18:01:17 UTC
Fix the documentation build by pinning the matplotlib version
2 parent s a628f79 + fed449d
Raw File
Tip revision: db1eb97a113d2dfe213e4053969f0aeef2884a9e authored by Aaron Meyer on 25 September 2022, 18:01:17 UTC
Merge pull request #450 from tensorly/fix-docs
Tip revision: db1eb97
minify.py
from slimit import minify
from rcssmin import cssmin

from pathlib import Path
asset_path = Path('./themes/tensorly/static')

for path in asset_path.glob('*.js'):
    # Ignore already minified files
    if '.min.' in str(path):
        continue
    target_path = path.with_suffix('.min.js')
    with open(path.as_posix(), 'r') as f:
        text = f.read()
    minified = minify(text, mangle=True, mangle_toplevel=True)
    with open(target_path.as_posix(), 'w') as f:
        f.write(minified)

for path in asset_path.glob('*.css'):
    # Ignore already minified files
    if '.min.' in str(path):
        continue
    target_path = path.with_suffix('.min.css')
    with open(path.as_posix(), 'r') as f:
        text = f.read()
    minified = cssmin(text)
    with open(target_path.as_posix(), 'w') as f:
        f.write(minified)

back to top