Skip to content

Commit

Permalink
docs: don't use kroki
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 favor 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 48f69a7
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 48f69a7

Please sign in to comment.