-
Notifications
You must be signed in to change notification settings - Fork 110
/
tasks.py
49 lines (37 loc) · 1.19 KB
/
tasks.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
49
from pathlib import Path
import shutil
from docutils.core import publish_cmdline
from invoke import task
from rellu.tasks import clean
from robot.libdoc import libdoc
assert Path.cwd() == Path(__file__).parent
@task
def kw_docs(ctx):
"""Generates the library keyword documentation
Documentation is generated by using the Libdoc tool.
"""
libdoc(str(Path('CalculatorLibrary.py')),
str(Path('docs/CalculatorLibrary.html')))
@task
def project_docs(ctx):
"""Generate project documentation.
These docs are visible at http://robotframework.org/RobotDemo/.
"""
args = ['--stylesheet=style.css,extra.css',
'--link-stylesheet',
'README.rst',
'docs/index.html']
publish_cmdline(writer_name='html5', argv=args)
print(Path(args[-1]).absolute())
@task
def move_docs(ctx):
"""Move report.html and log.html to docs
These docs are visible http://robotframework.org/RobotDemo/.
"""
log = Path('./log.html')
report = Path('./report.html')
dest = Path('.') / 'docs'
print(log.absolute())
shutil.copy(log.absolute(), str(dest))
print(report.absolute())
shutil.copy(report.absolute(), str(dest))