Skip to content

Commit bea782f

Browse files
authored
docs: don't use kroki (#2284)
The Kroki server is currently experiencing some issues which breaks our build, this change eliminates the use of Kroki in favour of directly using the generated SVG images which is checked into git alongside the PlantUML sources. I also added a task to the Taskfile to re-generate the SVG images from the PlantUML sources by calling docker.
1 parent 334787b commit bea782f

File tree

7 files changed

+245
-265
lines changed

7 files changed

+245
-265
lines changed

Taskfile.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,19 @@ tasks:
329329
{{.DOCKER}} image push {{.OCI_REFERENCE}}:latest
330330
{{.DOCKER}} image push {{.OCI_REFERENCE}}:${_latest_rdflib_version}
331331
fi
332+
333+
docs:build-diagrams:
334+
desc: Build documentation diagrams
335+
cmds:
336+
- cmd: |
337+
shopt -s globstar;
338+
for plantuml_file in ./**/*.plantuml
339+
do
340+
cat "${plantuml_file}" \
341+
| docker run --rm -i plantuml/plantuml -tsvg -pipe \
342+
> "${plantuml_file%.*}.svg"
343+
done
344+
332345
_rimraf:
333346
# This task is a utility task for recursively removing directories, it is
334347
# similar to rm -rf but not identical and it should work wherever there is
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
@startuml
2+
skinparam shadowing false
3+
skinparam monochrome true
4+
skinparam packageStyle rectangle
5+
skinparam backgroundColor FFFFFE
6+
7+
class Node
8+
9+
class Identifier {
10+
eq(other) -> bool
11+
neq(other) -> bool
12+
startswith(prefix: str, start, end) -> bool
13+
}
14+
Identifier -up-|> Node
15+
16+
class IdentifiedNode {
17+
toPython() -> str
18+
}
19+
IdentifiedNode -up-|> Identifier
20+
21+
class URIRef {
22+
n3(namespace_manager) -> str
23+
defrag() -> URIRef
24+
de_skolemize() -> BNode
25+
}
26+
URIRef -up-|> IdentifiedNode
27+
28+
29+
class Genid
30+
Genid -up-|> URIRef
31+
32+
class RDFLibGenid
33+
RDFLibGenid -up-|> Genid
34+
35+
class BNode {
36+
n3(namespace_manager) -> str
37+
skolemize(authority, basepath) -> RDFLibGenid
38+
}
39+
BNode -up-|> IdentifiedNode
40+
41+
class Literal {
42+
datatype: Optional[str]
43+
lang: Optional[str]
44+
value: Any
45+
46+
normalize() -> Literal
47+
n3(namespace_manager) -> str
48+
toPython() -> str
49+
}
50+
Literal -up-|> Identifier
51+
52+
class Variable {
53+
n3(namespace_manager) -> str
54+
toPython() -> str
55+
}
56+
Variable -up-|> Identifier
57+
58+
@enduml

docs/_static/term_class_hierarchy.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"sphinx.ext.ifconfig",
4545
"sphinx.ext.viewcode",
4646
"myst_parser",
47-
"sphinxcontrib.kroki",
4847
"sphinx.ext.autosectionlabel",
4948
]
5049

docs/rdf_terms.rst

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -17,68 +17,11 @@ Class hierarchy
1717
All terms in RDFLib are sub-classes of the :class:`rdflib.term.Identifier` class. A class diagram of the various terms is:
1818

1919
.. _term_class_hierarchy:
20-
.. kroki::
21-
:caption: Term Class Hierarchy
22-
:type: plantuml
23-
24-
@startuml
25-
skinparam shadowing false
26-
skinparam monochrome true
27-
skinparam packageStyle rectangle
28-
skinparam backgroundColor FFFFFE
29-
30-
class Node
31-
32-
class Identifier {
33-
eq(other) -> bool
34-
neq(other) -> bool
35-
startswith(prefix: str, start, end) -> bool
36-
}
37-
Identifier -up-|> Node
38-
39-
class IdentifiedNode {
40-
toPython() -> str
41-
}
42-
IdentifiedNode -up-|> Identifier
43-
44-
class URIRef {
45-
n3(namespace_manager) -> str
46-
defrag() -> URIRef
47-
de_skolemize() -> BNode
48-
}
49-
URIRef -up-|> IdentifiedNode
50-
51-
52-
class Genid
53-
Genid -up-|> URIRef
54-
55-
class RDFLibGenid
56-
RDFLibGenid -up-|> Genid
57-
58-
class BNode {
59-
n3(namespace_manager) -> str
60-
skolemize(authority, basepath) -> RDFLibGenid
61-
}
62-
BNode -up-|> IdentifiedNode
63-
64-
class Literal {
65-
datatype: Optional[str]
66-
lang: Optional[str]
67-
value: Any
68-
69-
normalize() -> Literal
70-
n3(namespace_manager) -> str
71-
toPython() -> str
72-
}
73-
Literal -up-|> Identifier
74-
75-
class Variable {
76-
n3(namespace_manager) -> str
77-
toPython() -> str
78-
}
79-
Variable -up-|> Identifier
80-
81-
@enduml
20+
.. figure:: /_static/term_class_hierarchy.svg
21+
:alt: Term Class Hierarchy
22+
23+
Term Class Hierarchy
24+
8225

8326
Nodes are a subset of the Terms that underlying stores actually persist.
8427

0 commit comments

Comments
 (0)