+# and monkey-patch the function generating the output to do some post-processing
+generate_documentation_orig = pycco.main.generate_documentation
+generate_documentation_called = False
+def generate_documentation(*args, **kwargs):
+ global generate_documentation_called
+ generate_documentation_called = True
+ result = generate_documentation_orig(*args, **kwargs)
+ # now patch it
+ result = patch_html(result, b'<link rel="stylesheet" href="pycco.css">',
+ b'<link rel="stylesheet" href="pycco_custom.css"><meta name="viewport" content="width=device-width">')
+ result = patch_html(result, b'<title>', b'Rust-101: ')
+ ## remove empty code blocks
+ result = re.sub(b'''<div class='code'>
+ *<div class="highlight"><pre>(<span></span>)?</pre></div>
+ *</div>''', b'<!-- empty code block -->', result)
+ # done
+ return result
+pycco.main.generate_documentation = generate_documentation