Skip to content

Commit ff3c8c5

Browse files
committed
Use Linksmith for having an overview about possible link targets
1 parent 5a7b02f commit ff3c8c5

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ run commands like this::
5353

5454
invoke inv https://cratedb.com/docs/crate/reference/en/latest/objects.inv
5555
invoke allinv --format=markdown
56+
invoke allinv --format=html+table
5657

5758

5859
Contributing

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
invoke<3
2-
pueblo[sphinx] @ git+https://github.com/pyveci/pueblo.git@amo/sphinx
3-
sphinx<8
2+
linksmith==0.0.1

tasks.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Tech Writing support.
22
# https://docs.pyinvoke.org/en/stable/getting-started.html
3-
from pathlib import Path
3+
import shlex
4+
import subprocess
45

56
from invoke import task
6-
import typing as t
7-
8-
from pueblo.sphinx.inventory import SphinxInventoryDecoder
97

108

119
@task
12-
def inv(c, url: str, format: t.Literal["text", "markdown"] = "text"):
10+
def inv(c, url: str, format_: str = "text"):
1311
"""
1412
Display intersphinx inventory for individual project, using selected output format.
1513
@@ -18,19 +16,12 @@ def inv(c, url: str, format: t.Literal["text", "markdown"] = "text"):
1816
invoke inv https://cratedb.com/docs/crate/reference/en/latest/objects.inv
1917
invoke inv https://cratedb.com/docs/crate/reference/en/latest/objects.inv --format=markdown
2018
"""
21-
name = Path(url).parent.parent.parent.name
22-
inventory = SphinxInventoryDecoder(name=name, url=url)
23-
if format == "text":
24-
inventory.as_text()
25-
elif format == "markdown":
26-
inventory.as_markdown(omit_documents=True)
27-
#inventory.as_markdown(labels_only=True)
28-
else:
29-
raise NotImplementedError(f"Output format not implemented: {format}")
19+
cmd = f"linksmith inventory {url} --format={format_}"
20+
subprocess.check_call(shlex.split(cmd))
3021

3122

3223
@task
33-
def allinv(c, format: t.Literal["text", "markdown"] = "text"):
24+
def allinv(c, format_: str = "text"):
3425
"""
3526
Display intersphinx inventory for all projects, using selected output format.
3627
@@ -39,6 +30,5 @@ def allinv(c, format: t.Literal["text", "markdown"] = "text"):
3930
invoke allinv
4031
invoke allinv --format=markdown
4132
"""
42-
urls = Path("./registry/sphinx-inventories.txt").read_text().splitlines()
43-
for url in urls:
44-
inv(c, url, format)
33+
cmd = f"linksmith inventory https://github.com/crate/crate-docs/raw/main/registry/sphinx-inventories.txt --format={format_}"
34+
subprocess.check_call(shlex.split(cmd))

0 commit comments

Comments
 (0)