-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.py
48 lines (34 loc) · 1.32 KB
/
make.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
from bat import __version__
import shutil
from pathlib import Path
import pdoc
here = Path(__file__).parent
modules = [
"bat",
]
print('Building docs for v{}'.format(__version__))
# Render pdoc's documentation into docs/api...
pdoc.render.configure(
template_directory = here / "pdoc-dark-mode",
footer_text="Black-box Adversarial Toolbox v" + str(__version__),
search=True,
logo="https://bat.wuhanstudio.uk/images/bat_dark.png",
logo_link="https://github.com/wuhanstudio/blackbox-adversarial-toolbox")
pdoc.pdoc(*modules, output_directory = here / "docs")
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print("Encountered a start tag:", tag)
def handle_endtag(self, tag):
print("Encountered an end tag :", tag)
def handle_data(self, data):
print("Encountered some data :", data)
print('Generating index.html')
# homepage ='docs/index.html'
# with open(homepage, 'w') as filetowrite:
# filetowrite.write('<!DOCTYPE html><html><head><script type="text/javascript">')
# filetowrite.write('window.location.href = window.location.href + "v')
# filetowrite.write(str(__version__))
# filetowrite.write('" + "/bat.html";')
# filetowrite.write('</script></head><body></body></html>')