mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Merge pull request #3212 from takluyver/print-color
Patch out bootstrap rule forcing black and white printing
This commit is contained in:
commit
0254c8bc01
24
setupbase.py
24
setupbase.py
@ -398,6 +398,28 @@ class Bower(Command):
|
||||
update_package_data(self.distribution)
|
||||
|
||||
|
||||
def patch_out_bootstrap_bw_print():
|
||||
"""Hack! Manually patch out the bootstrap rule that forces printing in B&W.
|
||||
|
||||
We haven't found a way to override this rule with another one.
|
||||
"""
|
||||
print_less = pjoin(static, 'components', 'bootstrap', 'less', 'print.less')
|
||||
with open(print_less) as f:
|
||||
lines = f.readlines()
|
||||
|
||||
for ix, line in enumerate(lines):
|
||||
if 'Black prints faster' in line:
|
||||
break
|
||||
else:
|
||||
return # Already patched out, nothing to do.
|
||||
|
||||
rmed = lines.pop(ix)
|
||||
print("Removed line", ix, "from bootstrap print.less:")
|
||||
print("-", rmed)
|
||||
print()
|
||||
with open(print_less, 'w') as f:
|
||||
f.writelines(lines)
|
||||
|
||||
class CompileCSS(Command):
|
||||
"""Recompile Notebook CSS
|
||||
|
||||
@ -424,6 +446,8 @@ class CompileCSS(Command):
|
||||
self.run_command('jsdeps')
|
||||
env = os.environ.copy()
|
||||
env['PATH'] = npm_path
|
||||
|
||||
patch_out_bootstrap_bw_print()
|
||||
|
||||
for src, dst in zip(self.sources, self.targets):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user