-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtasks.py
More file actions
34 lines (25 loc) · 991 Bytes
/
tasks.py
File metadata and controls
34 lines (25 loc) · 991 Bytes
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
# Tech Writing support.
# https://docs.pyinvoke.org/en/stable/getting-started.html
import shlex
import subprocess
from invoke import task
@task
def inv(c, url: str, format_: str = "text"):
"""
Display intersphinx inventory for individual project, using selected output format.
Synopsis:
invoke inv https://cratedb.com/docs/crate/reference/en/latest/objects.inv
invoke inv https://cratedb.com/docs/crate/reference/en/latest/objects.inv --format=markdown
"""
cmd = f"linksmith inventory {url} --format={format_}"
subprocess.check_call(shlex.split(cmd))
@task
def allinv(c, format_: str = "text"):
"""
Display intersphinx inventory for all projects, using selected output format.
Synopsis:
invoke allinv
invoke allinv --format=markdown
"""
cmd = f"linksmith inventory https://github.com/crate/crate-docs/raw/main/registry/sphinx-inventories.txt --format={format_}"
subprocess.check_call(shlex.split(cmd))