Skip to content

Commit

Permalink
docs: don't use kroki (#2284)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aucampia committed Mar 17, 2023
1 parent 334787b commit bea782f
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 265 deletions.
13 changes: 13 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,19 @@ tasks:
{{.DOCKER}} image push {{.OCI_REFERENCE}}:latest
{{.DOCKER}} image push {{.OCI_REFERENCE}}:${_latest_rdflib_version}
fi
docs:build-diagrams:
desc: Build documentation diagrams
cmds:
- cmd: |
shopt -s globstar;
for plantuml_file in ./**/*.plantuml
do
cat "${plantuml_file}" \
| docker run --rm -i plantuml/plantuml -tsvg -pipe \
> "${plantuml_file%.*}.svg"
done
_rimraf:
# This task is a utility task for recursively removing directories, it is
# similar to rm -rf but not identical and it should work wherever there is
Expand Down
58 changes: 58 additions & 0 deletions docs/_static/term_class_hierarchy.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@startuml
skinparam shadowing false
skinparam monochrome true
skinparam packageStyle rectangle
skinparam backgroundColor FFFFFE

class Node

class Identifier {
eq(other) -> bool
neq(other) -> bool
startswith(prefix: str, start, end) -> bool
}
Identifier -up-|> Node

class IdentifiedNode {
toPython() -> str
}
IdentifiedNode -up-|> Identifier

class URIRef {
n3(namespace_manager) -> str
defrag() -> URIRef
de_skolemize() -> BNode
}
URIRef -up-|> IdentifiedNode


class Genid
Genid -up-|> URIRef

class RDFLibGenid
RDFLibGenid -up-|> Genid

class BNode {
n3(namespace_manager) -> str
skolemize(authority, basepath) -> RDFLibGenid
}
BNode -up-|> IdentifiedNode

class Literal {
datatype: Optional[str]
lang: Optional[str]
value: Any

normalize() -> Literal
n3(namespace_manager) -> str
toPython() -> str
}
Literal -up-|> Identifier

class Variable {
n3(namespace_manager) -> str
toPython() -> str
}
Variable -up-|> Identifier

@enduml
1 change: 1 addition & 0 deletions docs/_static/term_class_hierarchy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"myst_parser",
"sphinxcontrib.kroki",
"sphinx.ext.autosectionlabel",
]

Expand Down
67 changes: 5 additions & 62 deletions docs/rdf_terms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,68 +17,11 @@ Class hierarchy
All terms in RDFLib are sub-classes of the :class:`rdflib.term.Identifier` class. A class diagram of the various terms is:

.. _term_class_hierarchy:
.. kroki::
:caption: Term Class Hierarchy
:type: plantuml

@startuml
skinparam shadowing false
skinparam monochrome true
skinparam packageStyle rectangle
skinparam backgroundColor FFFFFE

class Node

class Identifier {
eq(other) -> bool
neq(other) -> bool
startswith(prefix: str, start, end) -> bool
}
Identifier -up-|> Node
class IdentifiedNode {
toPython() -> str
}
IdentifiedNode -up-|> Identifier
class URIRef {
n3(namespace_manager) -> str
defrag() -> URIRef
de_skolemize() -> BNode
}
URIRef -up-|> IdentifiedNode

class Genid
Genid -up-|> URIRef
class RDFLibGenid
RDFLibGenid -up-|> Genid
class BNode {
n3(namespace_manager) -> str
skolemize(authority, basepath) -> RDFLibGenid
}
BNode -up-|> IdentifiedNode
class Literal {
datatype: Optional[str]
lang: Optional[str]
value: Any

normalize() -> Literal
n3(namespace_manager) -> str
toPython() -> str
}
Literal -up-|> Identifier
class Variable {
n3(namespace_manager) -> str
toPython() -> str
}
Variable -up-|> Identifier
@enduml
.. figure:: /_static/term_class_hierarchy.svg
:alt: Term Class Hierarchy

Term Class Hierarchy


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

Expand Down
Loading

0 comments on commit bea782f

Please sign in to comment.